i want to show an xml file inside an iframe.
it works fine in firefox and ie but in chrome show the xml as text.
so i wanted to check if this is a general problem.
for example:
if i use the View an XML food menu link that is located in http://www.w3schools.com/xml/xml_examples.asp then i get the xml shown as a text file.
if i right click the link and chose open in new tab it will show the xml as it should.
or if i open a new tab and put the url http://www.w3schools.com/xml/simple.xml it shows the file as an xml file.
if you press the right mouse button and select “open in a new tab” it will show the xml as it should.
i think that whatever causes this problem causes the problem i am facing.
so my questions are:
- what causes this ?
- is there a way around this problem ?
- is this a bug in chrome ?
thanks.
chrome version is 11.0.696.65
OS: windows xp,i have also checked this in windows 7
For me this is definitely Google Chrome bug. Try to use right-click on that link and select “Open link in new tab” or “Open link in new window” to see pretty printed XML.
There is
target="_blank"attribute within anchor element, which causes that problem:Look at another site http://www.xmlfiles.com/examples/. There is no
target="_blank"and links works well.You can use Inspect Element → Edit as HTML option to remove that attribute
target="_blank"and after that XML is printed well too.Finally I found Chromium Issue 84128 (reported 26/5/2011, version 11.0.696.71) for that.
You don’t need to add any explicite XSLT stylesheet. That’s simply not the case here. If there is no stylesheet applied, then browser implicitly uses their built-in, default variant.
Edit:
I downloaded Google Chrome 12 beta (version 12.0.742.77 beta-m) beta-m and here this bug is solved.
(from http://code.google.com/p/chromium/issues/detail?id=434)