Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 201 users

Comments by non-members will not trigger notification emails to users who starred this issue.
Status: Fixed
Owner:
User never visited
Closed: Mar 2011
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Restricted
  • Only users with Commit permission may comment.



Sign in to add a comment
XML display is unformatted
Reported by jason.st...@gmail.com, Sep 3 2008 Back to list
Product Version      : 0.2.149.27 (1583)
URLs (if applicable) : http://www.w3schools.com/XML/note.xml
Other browsers tested: Yes
Add OK or FAIL after other browsers where you have tested this issue:
     Safari 3: N/A
    Firefox 3: OK
         IE 7: OK

What steps will reproduce the problem?
1. Visit an XML document: http://www.w3schools.com/XML/note.xml
2. Look at the output

What is the expected result?
The output should resemble an XML document

What happens instead?
The output is garbled text

Please provide any additional information below. Attach a screenshot if 
possible.
Attached screenshots show what is expected (fx3_xml), and what is given 
(chrome_xml).
 
fx3_xml.PNG
38.9 KB View Download
chrome_xml.PNG
27.3 KB View Download
This issue is the only reason for me to still open FireFox. Please fix it.
No it works fine, just show the source (Ctrl U) and you get the fully formatted 
version.
Ctrl-U just shows the unformatted xml. Compare with what FireFox does (attached).
xml-gc.png
135 KB View Download
xml-ff.png
89.3 KB View Download
Even IE7 formats xml nicely.
xml-ie.png
69.6 KB View Download
Labels: -Area-Unknown Area-Compat
Status: Untriaged
Offending XML:
<!-- Edited by XMLSpy® --> 
<note> 
	<to>Tove</to> 
	<from>Jani</from> 
	<heading>Reminder</heading> 
	<body>Don't forget me this weekend!</body> 
</note> 

Adding the XML header does not help either
<?xml version="1.0" encoding="UTF-8"?>


An XML Parser is needed to be written to test the validity and formating. The tree representation is really nice idea. Let's see how google implements the same.
Comment 7 by kchen...@gmail.com, Sep 15 2008
This is an important feature. I miss this a lot in Chrome
Comment 8 by Deleted ...@, Sep 23 2008
It works at opera.
oprea.JPG
26.6 KB View Download
 Issue 3596  raised with similar issue.
Comment 10 by bksen...@gmail.com, Oct 26 2008
Corresponding bug in Webkit:

   https://bugs.webkit.org/show_bug.cgi?id=13807
Comment 11 by dhh...@gmail.com, Dec 19 2008
See also related bug:  Issue 5286 
 Issue 5709  has been merged into this issue.
Comment 13 by evan@chromium.org, Feb 25 2009
BTW, I tried implementing this a while back.  The problem is that XML allows for 
nested namespaces, so you can have an ordinary-looking XML document that suddenly 
decides to use the HTML namespace on some elements and now the proper thing to do is 
for the browser to render them.  See the WebKit bug for Hixie's comments on this 
behavior.
Comment 14 by jon@chromium.org, Mar 20 2009
Labels: -Type-Bug -Area-Compat Type-Feature Area-WebKit mstone-x HelpWanted
Status: Available
Comment 15 by dhw@chromium.org, Jul 10 2009
 Issue 9767  has been merged into this issue.
Comment 16 by dhw@chromium.org, Jul 10 2009
Labels: -Type-Feature Type-Bug
Status: Upstream
Corresponding bug in Webkit (which backlinks to this Chromium issue):

   https://bugs.webkit.org/show_bug.cgi?id=13807
Comment 17 by Deleted ...@, Sep 17 2009
There is an extension available in the below link
http://www.chromefans.org/chrome-plugins/XML-tree-extension-for-gogole-chrome.htm
Comment 18 by phistuck@gmail.com, Sep 17 2009
If you go to this RSS page -
http://israblog.nana10.co.il/blog_rss.asp?blog=5
It ruins the encoding of the text, it should be displayed as Hebrew, but it is gibberish  
instead.

Thank you, anyway.
 Issue 22692  has been merged into this issue.
I don't think the tree feature or comparing it to ff is adequate. If I use IE the xml I 
have tried to view worked fine. I don't see why that can't be done on Chrome. 
Attached is an example of http://bsbcwired.com/podcasts/audio/refuge.xml viewed side by 
side in Chrome and IE. Sorry if the picture is big its just a print screen of dual 
monitors. 
xmlexample.png
460 KB View Download
H2oLofty this comparsion is not valid. IE includes rss reader, Chrome not (and Chrome 
don't need it).
You should compare display of non rss or atom xml in IE/FF with Chrome, and that will 
be the issue we are talking about here.
Comment 23 Deleted
 Issue 24939  has been merged into this issue.
 Issue 5407  has been merged into this issue.
 Issue 19564  has been merged into this issue.
Comment 27 by dhw@chromium.org, Dec 10 2009
 Issue 29870  has been merged into this issue.
This bug really needs some love, Chrome should handle raw XML better.
Comment 29 by bdarg...@gmail.com, Jan 26 2010
Just a thought if anyone does get around to implementing this: note that IE displays 
namespace declarations whereas Firefox doesn't. I work a lot with XML content and find 
seeing what prefix corresponds to what namespace very useful. Maybe a flag can toggle 
whether these are displayed or not in the nicely formatted output.
Could someone not discuss with moonty@gmail.com about integrating his extension into 
Chrome? XML Tree - moonty@gmail.com - Version: 1.1 has been out for a while, and seems 
to do the job just fine. Thoughts?
 Issue 33756  has been merged into this issue.
Comment 32 by dhw@chromium.org, Mar 9 2010
Issue 37751 has been merged into this issue.
Cant even render your own damn changelog! Does anyone at google even use Chrome? Must 
not. Random awesome is what google is becoming. Some good, then replaced by total tard.
epic failure.png
64.8 KB View Download
epic failure2.png
44.6 KB View Download
There's an excellent Chrome extension available to solve this issue. It works pretty 
nicely. If you need to view XML files in Chrome I suggest you give it a shot:

https://chrome.google.com/extensions/detail/gbammbheopgpmaagmckhpjbfgdfkpadb
I dont get it. Why does everyone want tons of features like xml formatting or rss 
reader that may just as well be solved by using an extension?
Do you really want chrome to end up as bloated as IE?
Comment 36 by tolzi...@gmail.com, May 28 2010
Note as bloated as IE no, however I would love to be able to push my clients to Chrome however they need a 
viewer for XML to be built in where no styling exists. This is probably the number one functionality missing for 
our group right now. 

The perfect solution in my groups opinion would be to have the developer tools xml viewer enabled when 
their is no styling for the page detected or to give us the option to send an unstyled flag in the header which 
Chrome would use to trigger a raw XML view.

Thank you google for looking into this.
Comment 37 by airto...@gmail.com, May 30 2010
I use XMLTree to provide styling.

https://chrome.google.com/extensions/detail/gbammbheopgpmaagmckhpjbfgdfkpadb



Screenshot.png
36.0 KB View Download
+1 The XMLTree extension is great, but this functionality should really be in the browser/rendering engine itself. 
I should note that XML Tree crashes tabs for me on large XML documents. The ones I'm dealing with are generally 
400KB - 1MB. This is likely a bug or shortcoming in XML Tree, but it shows further that this functionality needs 
official support.
@colindean It is not a bug of the extension. Even if the extension is doing something 
wrong, the renderer should not crash. If the renderer crashes, this is a bug of Chorme. 
Please, search for an existing issue at http://crbug.com and file a new issue, if you 
could not find one, at http://new.crbug.com, with detailed reproduction steps.
Comment 41 by kenorb@gmail.com, Jun 4 2010
XML Tree doesn't work for SRW/SRU/Z39.50 and SOAP.
Comment 42 by mega...@gmail.com, Jun 10 2010
The use of CSS with XML means it is completely valid to have an XML document which defines itself how it is rendered.  IE: http://www.w3schools.com/Xml/xml_display.asp

And the aforementioned embedded HTML is an even bigger problem.

So the question is, how would Chrome know if it should render the XML source or render it as an XML document?

This would have to be done carefully in order to avoid breaking XML documents which are intended to be rendered.
If the user wants to see the rendered XML's source, he can use the already-implemented "view source" feature.
Comment 44 by tolzi...@gmail.com, Jun 10 2010
@grayshade

The problem with that statement is that your average user working with a CMS application (e.g. a business user) doesn't know the garbage or blank screen that they've been presented is actually an xml document that just needs the user to click view-source. So with that statement not only have you alienated a good portion of your user base, you've also made it more difficult by far to debug native XML frameworks.

@megazzt

I agree that this is the core of the problem however it is one that is solvable as the browser knows full well whether any styles have been provided for the XML whether from the xml headers themselves or from the browser. If no stylesheets have been provided then it would be expected that the content be rendered using the view-source xml rendering display. 

Given that the sequence for this implementation should be first try all style paths (css, xforms, xsl-fo, js, etc.) and keep a reference count of found styles, if at the end of the render sequence the reference count is 0 then display using the view-source mechanism.
Maybe if there is no style associated, it still shows the plain document, but has a bar at the top (similar to the translation bar or restore bar, etc) that says "This document has no style information. Would you like to view the source code?" that does  a formatted/color-coded document tree.
If we could vote on individual comments, I'd vote for comment 45.
#45/46 indeed, this seems like a reasonable solution
Comment 48 by kenorb@gmail.com, Jun 17 2010
I prefer the way how it's done for Firefox and IE. It's just showing the XML tree straight away.


 Issue 47151  has been merged into this issue.
 Issue 47152  has been merged into this issue.
Firefox does this by slapping on an XSLT onto the XML. Chrome could just use the same stylesheet, and we could all move on with our lifes.


Comment 52 by ysee...@gmail.com, Jul 10 2010
Yes, the XML should just be shown right away.
Chrome is very developer friendly in other areas, but this is a very important usability bug.
Installing a plugin is not a good option since I'm worried about my users (and it's definitely not friendly to ask everyone to install a plugin).  I guess my only option now is to tell people to use FireFox or IE to follow the tutorial (which returns XML docs from a server).
Comment 53 by kenorb@gmail.com, Jul 12 2010
Chrome parsing files when it's not necessary, and not parsing when necessary.
See this:
http://drupalcode.org/viewvc/drupal/drupal/index.php?revision=1.99&content-type=text%2Fplain&view=co
In Firefox file shows normal, but why Chrome trying to interfere in simple text page? And nobody wants to implement simple XML parser?
Raised separate issue:  Issue 47965 

 Issue 48835  has been merged into this issue.
As a web developer, I totally switch from firefox to chrome, but now this issue about chrome and formatting xml really hurt! Please fix this... This standard is used widely and I won't work with two browser.

Thanks!
Comment 56 by evan@chromium.org, Aug 6 2010
Status: ExternalDependency
I really need this feature if I'm going to recommend that users start using chrome.  They need to be able to view raw xml representations of content, but I can't teach them all to go through the steps of selecting view source.

I don't think you need to render nested namespaces that are recognized.. personally I'd rather have anything that starts without a stylesheet and that starts with an unrecognized namespace rendered as an xml tree.
Comment 58 by mega...@gmail.com, Aug 20 2010
"but I can't teach them all to go through the steps of selecting view source"

"Hold Control and press U" too hard? :)
Viewing the source is not a sufficient solution and is far more difficult when the source is not indented.
Comment 60 by phistuck@gmail.com, Aug 20 2010
@afishbeck - There is an extension for it. Install once and you (and them) will always see it nicely.
@megazzt - "Hold Control and press U" too hard? :)

lol, bad choice of words, they are smart enough, I just want a solution that is intuitive and consistent across browsers.

I agree that the collapsible tree view shown by other browsers is preferable, but at least as a (temporary?) work around I can pretty print the source for (at least some) of the xml documents.

As for the extension, I can at least document it and recommend it to anyone who asks.
Comment 62 by phistuck@gmail.com, Aug 20 2010
@afishbeck Or, since it seems like you have control over these files, you could simply add an XSLT stylesheet declaration that references a stylesheet file that creates that tree view.
You could borrow the tree view XSLT from Mozilla.
Then, the user will not have to do anything.
I've thought about doing that, and have gone as far as extracting the stylesheet they use.  I think there may have been further dependencies I would have to track down as well.  

It's easier to add a stylesheet reference to some of the xml documents then others but I may pursue this option for at least some of them.  
 Issue 53191  has been merged into this issue.
While you are waiting for this to be natively supported, you can install the XML Viewer extension.  It works great. 
I have a report that displays various resources (images, text, HTML, XML) in an iframe. This works fine in other browsers (at least FF & IE), but the XML does not render properly in chrome.

None of the extensions given work in iframes, nor with UNC file: paths. Right click -> view source is not acceptable because it opens in a new window, and the user loses their context.

The frustrating part is that the view-source: display is absolutely adequate, but detecting the case where the target is unstyled XML and the browser is chrome and switching URL schemes is ridiculous.

I appreciate the concern for cases where the XML is styled or becomes styled due to scripts, but as it stands the common case is broken to preserve the obscure one. At some point Hixie's 'evil' testcases need to pass, but surely the common ones should pass first!
Comment 67 by phistuck@gmail.com, Sep 24 2010
@sam.mccall
In case you control these XMLs, you can simply add an XSLT that will create
the look you want it to have.

If not, my guess is that the extensions just have to add "all_frames": true
in their manifest (which you can also do manually) to make that happen in
iFrames as well.
@phistuck
Injecting an XSLT is possible, but at that point I might as well just parse it and generate HTML instead. Currently the resources are opaque to the application, it's assumed the browser can handle them. (Also, this would change the appearance from the native in firefox/IE, which is not ideal)

Thanks for the tip on all_frames! Now the extensions work inside iframes. Any idea how to enable them for UNC paths? (file://hostname/path in chrome). I tried adding "file://*/*" to content_scripts[0].matches, but it didn't work.
Can you guys discuss this elsewhere?  Perhaps with the extension developers?  The other 167 of us are waiting to hear about when the fix comes to Chrome via WebKit.
Comment 70 by peter@chromium.org, Oct 17 2010
 Issue 59480  has been merged into this issue.
 Issue 60461  has been merged into this issue.
Comment 73 by Deleted ...@, Dec 6 2010
Workaround: use Firefox.
Comment 74 by vir...@gmail.com, Dec 6 2010
I second for the workaround, haha
Nearly 200 people are receiving emails every time comments are added to this report.  This isn't a forum or a mailing list; it's an issue tracker for developers.  If your best suggestions are "use Firefox" and "I second that," please think about how many people's time you're wasting before you hit the Save Changes button.
Comment 76 by mal@google.com, Feb 14 2011
Labels: -HelpWanted GoodFirstBug
Is this being worked on? 

Why can't at the very least chrome treat the xml as a text document if there's no stylesheet present, and just print it out (nevermind showing a parsed tree like firefox does, which would of course be better).
This will land either today or early next week (https://bugs.webkit.org/show_bug.cgi?id=13807).
Labels: -GoodFirstBug bulkmove Hotlist-GoodFirstBug
Product Version      : 0.2.149.27 (1583)
URLs (if applicable) : http://www.w3schools.com/XML/note.xml
Other browsers tested: Yes
Add OK or FAIL after other browsers where you have tested this issue:
     Safari 3: N/A
    Firefox 3: OK
         IE 7: OK

What steps will reproduce the problem?
1. Visit an XML document: http://www.w3schools.com/XML/note.xml
2. Look at the output

What is the expected result?
The output should resemble an XML document

What happens instead?
The output is garbled text

Please provide any additional information below. Attach a screenshot if 
possible.
Attached screenshots show what is expected (fx3_xml), and what is given 
(chrome_xml).
Comment 80 by Deleted ...@, Mar 19 2011
Ah! Google oh google what pain you caused me today.

I spent an hour trying to debug why my app is not serving xml and then I realized its a Google chrome BUG! 

Whats worst is to file a bug for a google product, I must find the project source code hosting and file a bug here (what fun for normal users) and I can "vote" for this issue which will forcibly send of a slew of emails to me! 

I'm a dev and yes, I would look for a better place to place this rant, but I can't find one! Your forums are loaded with user comments and dupes of the same issue, and there is no proper way to file issues and get fixes and workarounds!
@gidisr...: You could file a generic bug against Chrome, but finding the right one gives you luxury support, directly from the developers, within 10 minutes of time :)

So what are you observing? Please formulate it in terms of steps to reproduce, description of the expected results and the actual picture.
Owner: vsevik@chromium.org
Status: Fixed
If your symptoms are as in the original bug, I have some good news: this very bug is now fixed, you should be able to see formatted XML in the dev channel Chrome. It'll hit beta / stable later.
@pfeldman: Brilliant, please post an update when the "stable" users are supposed to uninstall their XML viewer extension.
Can we get a milestone?
Comment 85 by mega...@gmail.com, Mar 19 2011
Test: data:text/xml,<xml></xml>

Woo it works!

@gidisr It may seem to be an "obvious" feature but you can use XML + CSS to create RENDERED XML pages, which is what Chrome is trying to do I think (except of course most XML docs don't have CSS).  So even to render XML source automatically one must detect the absence of styling that isn't defined by browser defaults.

Sorry to hear it took you so long to figure out but I am thinking it is rather like spending some time debugging a network failure only to find an unplugged ethernet cable... it is easy enough to see when opening View Source or the Developer Tools, and I myself find it easy to spot it just in the document since you just get the text content visible all on one line.  Not that I don't spend hours debugging something stupidly simple myself sometimes.

Normal users aren't going to file bugs, but then again normal users may not know or care what XML is, and especially they won't care about seeing the source tree.

If you don't want the e-mails Gmail filters can work in a pinch to get them out of your way.  But starring really is if you want updates on a particular issue.

Dupes are really the result of lots of people filing duplicate bugs without searching for bugs first; can't really blame the Chrome team for that.  I try to do my part when I find a bunch of dupes by posting on the "main" bug the id numbers of the dupes to make the mods' work a little easier.
@MAL: chrome 11 dev works fine, so 11 is the Mstone.
It means a stable version within a month or two
Comment 87 by phistuck@gmail.com, Mar 19 2011
@fabios4rulez -
Should be released in about a month (a release approximately every six
weeks, 10 was released on March 8, 2011, 11 should be out around April 20,
2011).
Comment 88 by dor...@gmail.com, Mar 23 2011
We need this fixed since we consider chrome as our main browser to work and develop of course.
Comment 89 by mega...@gmail.com, Mar 23 2011
Hey "dor...", Chrome 11 with this feature was just released on Beta channel, if you need it bad enough you can download the beta channel (As usual, a little Googling will get you the download link).

If you would rather stay on Stable you'll have to wait a few weeks for Chrome 11, and in the meantime you can just use the View Source command or the Developer Tools to view the raw XML tree as a workaround.
Comment 90 by dor...@gmail.com, Mar 23 2011
Thanks i will try the beta. 
FYI XML display in Chrome 11 beta seems to work great in the top frame, but not inner frames.  Should another bug be opened?
I'm noticing another strange behaviour:
if the xml is reached via a link with target="_blank", the xml is still parsed as html.
Testcase attached.
test.html
188 bytes View Download
The target="_blank" problem is already fixed in Chrome 12.

XML is getting rendered if file extension is .xml, .wsdl etc. But is not rendering xml output printed by a servlet.
deepumohan.p: Could you please provide an example or some more details?

If you save the servlet output to a file and try to open it locally does it render XML? If not could you please attach an example xml.
What is the mime type of the servlet output (you can look it up in Developer Tools).
When I save output to a file with .xml as extension and open it using Chrome, it is getting rendered properly.Mime type is text/xml. I am attaching sample xml file with amended data before uploading.
test.xml
1.1 KB Download
My issue (comment#94) seems to be solved in version 12.0.742.91.
Now Chrome is rendering xml output printed by my servlet.
JFTR, should I now uninstall the XML extension for Chrome, or keep it, because it still offers features not available in Chrome 12?
It certainly depends on whether you need these other features.
XML doesn't render properly if embedded in an iframe.
Hi please make it work of the xml in iframe.
Comment 102 by Deleted ...@, Aug 22 2012
+1 Would be nice if "Content-Type: text/xml" would render as a XML document properly without viewing the source.
Project Member Comment 103 by bugdroid1@chromium.org, Oct 13 2012
Labels: Restrict-AddIssueComment-Commit
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.
Project Member Comment 104 by bugdroid1@chromium.org, Mar 11 2013
Labels: -Area-WebKit Cr-Content
Project Member Comment 105 by bugdroid1@chromium.org, Apr 6 2013
Labels: -Cr-Content Cr-Blink
Sign in to add a comment