Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • AlexR 39 posts 61 karma points
    May 05, 2010 @ 08:04
    AlexR
    0

    How to print XML tree to html without transformation and removing attributes for debuging ?

    I have some error in XPath selection, and I want to debug it. So  I need to see XML.

    How can I print XML to HTML directly without transformation and removing attributes?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    May 05, 2010 @ 08:17
    Dirk De Grave
    0

    Hi AlexR,

    A very simple trick is to use this piece of code in your xslt which will get the xml of the current node in a textarea field:

    <textarea><xsl-copy-of select="$currentPage" /></textarea>

    Or, you could try to debug your xslt, as per instructions on my blog

     

    Cheers,

    /Dirk

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    May 05, 2010 @ 09:18
    Chriztian Steinmeier
    2

    Hi AlexR (and others interested),

    I created a package that'll let you view the XML colourcoded and stripped down for easier debugging. Does a couple of other tricks too (like getting nodes by @nodeTypeAlias or @id and getting a media item's XML from the @id).

    It's located here: http://our.umbraco.org/projects/xml-dump

    Let me know if you like it or hate it :-)

    /Chriztian

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies