Reputation: 7822
I have this curious question. I was looking at XML files and so I did this twitter search: http://search.twitter.com/search.atom?q=basketball
The output for Chrome looks like this:
The output for Firefox looks like this:
Then, the output for Safari looks like this:
My question is, what is going on? How can I get the browser to display it in different forms. In other words, if I want to output the <?xml ...
, how can I do that?
Upvotes: 0
Views: 2273
Reputation: 6424
Well, this is is not just any XML, but an Atom file (Atom is a standard for feeds, like RSS). The browsers (except for chrome) recognize it as such, and format it according to how they format feeds. If you want to view the XML source, just use your browser's View Source function (usually found at the right-click menu).
Upvotes: 0
Reputation: 67376
You most likely never want your end-users to look at raw XML anyway. Different browsers decorate raw XML as they wish to make it easier to find stuff in them, but it's still useless as a presentation format.
You should instead link your XML file with an XSLT file to transform it into HTML for presentation purposes.
Upvotes: 0
Reputation: 2920
Some browsers will render XML with a namespace that they recognize. You can always 'view source' to see the text.
Upvotes: 0
Reputation: 51658
If you want the browser to output the <?xml ...
, send a header that makes the browser think it's a text file, not an XML file:
Content-Type: text/plain
Upvotes: 1