Pretty XML tree view for Opera

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.




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!

Tags: , ,

23 Responses to “Pretty XML tree view for Opera”

  1. Alfredo Says:

    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…

  2. Jakub Says:

    Hi Alfredo, I’m affraid I don’t understand what exactly you mean, could you maybe take a screenshot of the error?

  3. Alfredo Says:

    Hi man…
    Aparently, this textarea don’t support html tag :P

    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


  4. Alfredo Says:

    again don’t show the tags..
    review this image and you undertand…


  5. Jakub Says:

    Aha, now I see what you meant :) It’s fixed now.

  6. Alfredo Says:

    Thank man..
    what was the change?… I saw only one a ,, extra…

    thanks again :p

  7. triple zero Says:

    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!

  8. BigMike Says:


    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

  9. Jakub Says:

    BigMike, I’m having the same problem but unfortunately have no idea how to avoid that :( Maybe ask directly Opera developers?

  10. BigMike Says:

    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 ;)

  11. Jakub Says:

    Thanks BigMike, that works fine. The fix is included in the user js now.

  12. BigMike Says:

    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…

  13. mihau Says:

    thanks for the script guys!

  14. Alexandre Says:

    Thanks a lot – it’s a nice tool… :)
    Nevertheless, there are some more issues I’ve found… check the following pic:

    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…


  15. Alexandre Says:

    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

  16. Jakub Says:

    @Alexandre – comments are handled better now

  17. Alexandre Says:

    looks awesome !! :)
    thanks, Jakub

  18. RC Says:

    Alfredo, no serás RC por siaca???
    que andas publicando xml del STE??????????
    RC no más

  19. Walter Says:

    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.

  20. Safari - XML als Quelltext anzeigen Says:

    [...] [...]

  21. Norbert Says:

    thanks for the script guys! Its working fine. best regards

  22. Holzspielzeug Says:

    Habe neulich bei Kugelbunt online Holzspielzeug bestellt und bin von der Qualität und dem Service begeistert, würde dort jederzeit wieder bestellen.

  23. Schools for Interior Design Says:

    Schools for Interior Design…

    PUBLOG » Pretty XML tree view for Opera…

Leave a Reply