Pretty XML tree view for Opera
Pretty XML tree view is a user JavaScript for the Opera browser that automatically transforms raw unstyled XML files (i.e. RSS feeds) into a pretty – Firefox like – tree view which is much more user friendly.
The transformation is done using XSLT (the stylesheet is embeded into the JavaScript file), so that it’s much faster than i.e. the first XML tree user JavaScript (written by Mark “Tarquin” Wilton-Jones) even with large documents.
See Pretty XML tree sample output.
Note that the formatted output allows you to fold elements – just click either the opening or the closing tag of an element and its content will be replaced with three green dots; click again to unfold it.
If you want to know which namespace particular element belongs to, just hold your mouse over it and the URI of the namespace appears in a few seconds.
Download
- pretty-xml-tree.js – the user JavaScript file
- pretty-xml-tree.xsl – the original XSLT file (you most likely don’t need this file, it’s here in case you want to study it)
Screenshot
Update
Some guys’ve created a Chrome extension based on my script – XML Tree for Chrome. I really like the idea to allow search in the tree by XPath expressions!
July 20th, 2009 at 18.43
Hi Man:
Thank for this appz. It’s really instererinsting. However, its have a little error because show … and not the real xml ….
I don’t know if you have seen this…
greetings.
July 20th, 2009 at 19.28
Hi Alfredo, I’m affraid I don’t understand what exactly you mean, could you maybe take a screenshot of the error?
July 20th, 2009 at 22.41
Hi man…
Aparently, this textarea don’t support html tag
when you have an HTML/XML well formed, you will has a tag like …. (without the spaces, of course), but with this app, you obtains … (the tag attribute haven’t “/” simbol, at finish the tag)… when the tag… only appears with this case :p
Thanks…
July 20th, 2009 at 22.45
mmmmm…
again don’t show the tags..
review this image and you undertand…
http://www.argoideas.cl/img_xml.png
thanks.
July 20th, 2009 at 23.07
Aha, now I see what you meant
It’s fixed now.
July 20th, 2009 at 23.50
Thank man..
what was the change?… I saw only one a ,, extra…
thanks again :p
August 4th, 2009 at 17.45
Thanks a lot! very useful!
I changed the stylesheet a littlebit, font: 12px/1.5 Consolas, monospace; to use the new Vista Consolas font (very nice monospace coding font) and white-space: pre-wrap to make large runs of text wrap, avoiding scrollbars.
another improvement would be to have the filename and the name of the XML root node as the first words in the title, so you can recognize different documents if you have multiple tabs open (now they all just say “Pretty XML”), but I don’t have time to refresh my XSLT right now to implement this.
once again, great work!
September 1st, 2009 at 21.47
Hi,
today I installed the new Opera 10.
Your script isn’t working properly anymore, since the XML data is now displayed twice.
It’s a pity, since I prefer your script to the display style of Opera.
Is there an easy way to fix this?
Thanks, Mike
September 1st, 2009 at 22.00
BigMike, I’m having the same problem but unfortunately have no idea how to avoid that
Maybe ask directly Opera developers?
September 2nd, 2009 at 11.22
Ok, it’s very ugly, but it works for me
I modified the “unstyledxml.css” in \styles
I did just add the two lines at the beginning of the document:
div.header {display:none;}
div.syntax {display:none;}
The first will hide the “No style information header”, the second the styled tree.
I wasn’t able to get any of these div elements with “document.getElementsByTagName” and enumerating from within your script. Only the div elements created by your script seem to be accessible. So, I can’t provide a fix for the script, just a workaround for the moment.
Maybe this helps
September 3rd, 2009 at 19.46
Thanks BigMike, that works fine. The fix is included in the user js now.
September 4th, 2009 at 13.14
Thank you for updating the script.
Having all in one file is much more convenient.
And thank you for opening my eyes – sometimes (mostly??) I don’t see the easy solutions…
September 5th, 2009 at 0.49
thanks for the script guys!
September 16th, 2009 at 10.30
Hey,
Thanks a lot – it’s a nice tool…
Nevertheless, there are some more issues I’ve found… check the following pic:
http://www.imageno.com/oa9cg6d4o7mgpic.html
1) is the issue with adding ‘,’ characters in front of comments
2) is the changing of the “xml version / encoding” meta-info in the beginning of the document
3) is suggestion… maybe just leave the comments the way they are!? I mean – not to remove ‘\n’… Usually, comments are user-friendly and easy to read, because they are purposly typed that way…
Thanks
–Alex
September 16th, 2009 at 10.31
PS. Sorry – forget to mention Opera version…
Version: 9.64
Build: 2480
Platform: Linux
System: x86_64, 2.6.18-128.2.1.el5
Qt library: 3.3.6
Java: No Java Runtime Environment installed
Browser identification: Opera/9.64 (X11; Linux x86_64; U; en) Presto/2.1.1
September 21st, 2009 at 20.27
@Alexandre – comments are handled better now
September 24th, 2009 at 1.44
looks awesome !!
thanks, Jakub
–Alex
February 16th, 2010 at 21.30
Alfredo, no serás RC por siaca???
que andas publicando xml del STE??????????
RC no más
June 23rd, 2010 at 8.05
I happened on Pretty XML tree view with Google opera view xml
I do not know how to use it or if it provides a mechanism to solve my problem.
I want to view locations such as on a Windows Mobile 6.1 system with an anonymous version Opera Browser pre-installed and Opera Mobile 10 downloaded.
Both show XML as empty. My PC browsers show XML as a tree, similar to what Pretty XML does.
Is Pretty XML a tool to do what I want? How would I use it?
If not, what should I read?
I hope you can point me at URLs, I can read, understand and enhance my Mobile capability.
Thanks!
August 31st, 2010 at 18.35
[...] [...]
February 3rd, 2012 at 0.49
thanks for the script guys! Its working fine. best regards
April 4th, 2012 at 21.37
Habe neulich bei Kugelbunt online Holzspielzeug bestellt und bin von der Qualität und dem Service begeistert, würde dort jederzeit wieder bestellen.
May 24th, 2012 at 21.14
Schools for Interior Design…
PUBLOG » Pretty XML tree view for Opera…