Firefox and xml
Posted: Fri Jun 18, 2004 3:35 am
Hi there,
I have an online multi-player game written in PHP/MySQL. One feature which I've just added is an XML output of a player's game stats. There are some 3rd party tools that use this XML to create offline views of games to allow players to plan their strategies whilst their "enemies" are taking their turns.
A PHP script basically writes the XML out to the page. Ultimately, I intend to provide this as a web service (but first things first!).
Anyway, here's the issue: with IE, viewing the XML shows it with the collapsing xml-tree view, even though the file name ends with .php
In Firefox, it just writes out the values within the tags as a stream of text, and the xml tags are only visible in source view. If the xml had a .xml extension, this would show correctly. Not a big deal as the page is there as crude API and not really for "human" reading, but a pain when testing.
So is it possible to either tweak Firefox to display xml in a tree view irrespective of filename extension and thus avoid having to write the file to the server first with an xml extension?
The file has the standard xml header of:
Thanks for any help.
I have an online multi-player game written in PHP/MySQL. One feature which I've just added is an XML output of a player's game stats. There are some 3rd party tools that use this XML to create offline views of games to allow players to plan their strategies whilst their "enemies" are taking their turns.
A PHP script basically writes the XML out to the page. Ultimately, I intend to provide this as a web service (but first things first!).
Anyway, here's the issue: with IE, viewing the XML shows it with the collapsing xml-tree view, even though the file name ends with .php
In Firefox, it just writes out the values within the tags as a stream of text, and the xml tags are only visible in source view. If the xml had a .xml extension, this would show correctly. Not a big deal as the page is there as crude API and not really for "human" reading, but a pain when testing.
So is it possible to either tweak Firefox to display xml in a tree view irrespective of filename extension and thus avoid having to write the file to the server first with an xml extension?
The file has the standard xml header of:
Code: Select all
<?xml version="1.0" ?>