Every time I open an XML file, all I get is blank page instead of tag tree. The file itself is correct and loads okay, I can see it via View Source or in the Firebug. I've tried turning off all my addons and tried running Firefox in safe mode, but the problem was not solved.

I'm guessing that I've messed up my configuration somehow and Firefox now tries to render XML files as HTML ones. I've tried googling, but with no success. Help, please?

UPD: example file: http://lj.lain.ru/3/1273657698603.sample.xml Also I've noticed that somehow all of the browsers on the machine are now acting the same, so I'm changing the question accordingly

link|improve this question
Which version of Firefox do you use? The latest? – SjoerdV May 12 '10 at 9:14
yes, of course. – n1313 May 12 '10 at 9:36
Have you tried re-installing or is that not an option? It seems like some files are broken.. – SjoerdV May 12 '10 at 9:36
This problem is here with me, like, for a year. I've upgraded Firefox several times. Does this count as reinstalling? – n1313 May 12 '10 at 9:44
That probably counts. What operating system do you use and what browsers? For example, Internet Explorer, Firefox and Opera have a XML view, while Safari and Chrome display blank pages. – SjoerdV May 12 '10 at 10:04
show 5 more comments
feedback

4 Answers

If the XML file is malformed, then the browser will not know what to do with it, and in my experience show nothing.

If the XML file is valid then most browsers (IE8, Chrome and Firefox) give a message like This XML file does not appear to have any style information associated with it. The document tree is shown below. and go into a special mode for showing XML files with features like being able to collapse code blocks.

Look here: XML Validator

link|improve this answer
feedback

This is specific to Firefox but I reckon is worth a shot:

Go to Help\Troubleshooting Information on the Firefox menu and click the button to open the containing folder of your profile.

Backup and then delete the mimeTypes.rdf file, close all instances of Firefox and open Firefox again.

This will force FF to re-generate the default actions for the mime types it knows about, this may fix the issue if it's caused by something weird FF is doing.

link|improve this answer
feedback

If you are loading the XML from a server, you need to set the header context type to text/xml.

For example, in PHP you need to put this ahead of your text output:

header("Content-type: text/xml");

link|improve this answer
feedback

Does the xml have a tag at the top similar to

this will precursor for the browser so it knows what to do.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.