Copied to clipboard

Flag this post as spam?

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


  • Nagarajan 6 posts 26 karma points
    Jan 06, 2011 @ 18:45
    Nagarajan
    0

    Complete XML schema of umbraco

    Hi 

    i am working in umbraco for the just past 1 weak. I really want to master the XSLT. I would like to get all the possible nodes that is present in the XML schema of umrbaco. Does any one can help me on how to get all the possible values present in the XML schema

    Thanks in advance

  • Dan 1288 posts 3921 karma points c-trib
    Jan 06, 2011 @ 18:53
    Dan
    1

    Hi,

    Welcome to our.umbraco!  You can find an XML cache of the published website content (which is used in your XSLT macros) under data > umbraco.config.

    Chriztian Steinmeier's XML Dump package might also be of use?

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jan 06, 2011 @ 21:26
    Kim Andersen
    1

    Those are great suggestions by Dan. If you just want to see the XML from a certain page that you stand on, and all of the pages' underlying nodes, you can use the good old textarea trick like this:

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

    This will give the entire XML from the current page.

    /Kim A

  • Nagarajan 6 posts 26 karma points
    Jan 07, 2011 @ 18:49
    Nagarajan
    0

    Hi Kim

    That's great. XML dump doesn't seems to be working for me. i don't see any nodes

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jan 07, 2011 @ 23:42
    Kim Andersen
    0

    Well, that's great that you'll use the classic textarea trick. I still use it when I want to see what's inside of variables, the current page, the selected nodes etc. But you should be able to use the XML Dump package as well though. Depending on which version of Umbraco you are running :)

    /Kim A

  • aghy 129 posts 308 karma points
    Jan 08, 2011 @ 07:07
    aghy
    0

    I used to used the textarea thing like Kim but when wokring on xslt for things like top navigation on a site I didnt want to see a big textarea breaking the styling of my site.

    For debugging I use a combination of Firefox and Firebug. Then add this to the xslt:

    <div style="display:none">
      <xsl:copy-of select="$currentPage"/>
    </div>

    And since I'm using Firebug to look at the source of the page it makes looking at the xml output easier.

    Ben

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 08, 2011 @ 10:13
    Jan Skovgaard
    1

    Hi Ben

    I think it's better you avoid having all the XML output in the source. Even though it's not being displayed it's in your markup and that does not make any sense at all and it can add to the documents weight depending on how much XML is in your selection.

    Instead I sugest you use this very comon approach shown below where you use a querystring parameter so you can easily see the XML content if you need to debug something.

    <xsl:if test="umbraco.library:Request('debug')">
    <textarea>
    <xsl:copy-of select="$currentPage" />
    </textarea>
    </xsl:if>


    Then the XML only gets printed if you add debug=1 (the value can be anything, it just needs to contain something) to the url of the page you are working on. For instance

    When normal users visit the site they go to http://mysite.com/news/newsitem.aspx and when you need to debug you go to the same site and add the querstring parameter like this: http://mysite.com/news/newsitem.aspx?debug=1

    Just my 2 cents

    /Jan

  • aghy 129 posts 308 karma points
    Jan 08, 2011 @ 11:02
    aghy
    0

    Hi Jan,

    I like your use of the Request I hadn't thought of that. That would be useful when developing on a live site possibly.

    The reason I output the xml into a hidden div is because it saves me copying the xml from the textarea and saving it as an xml just to make it easy to read. Basically just so I can collapse and expand the xml to view the nodes.

    For debuggin purposes ONLY I find it much easier to view the xml in a div with firebug. I don't leave the xml in the source when the xslt is working.

    Ben

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 08, 2011 @ 11:14
    Jan Skovgaard
    0

    Hi Ben

    Ah ok - yes in that case I can see what you mean. Then it makes sense :-)

    /Jan

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 08, 2011 @ 12:31
    Dirk De Grave
    1

    I tend do output the complete xml using an alternative template, which you can use on any page, wherever in the content tree. For example, let's assume you've created a template getXml (no need for master templates here), add a single macro that refers to an xslt file. In that file, just add a single statement

    <xsl:copy-of select="umbraco.library:GetXmlAll()" />

    If you have a page in the content tree called http://www.domain.com/my-page(.aspx), then just use http://www.domain.com/my-page/getxml(.aspx) and let your browser take care of the xml representation.

    I sometimes even use this on live sites if I don't want or can access the server to get the umbraco.config file.

     

    Hope this helps.

    Regards,

    /Dirk

     

  • Nagarajan 6 posts 26 karma points
    Jan 09, 2011 @ 07:05
    Nagarajan
    0

    hi kim

    you are absolutely right. I am using umbraco 4.5

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jan 09, 2011 @ 13:13
    Kim Andersen
    0

    @Nagarajan:

    Actually the XML Dump package should work with v4.5 as well. As described on the project page:

    "UPDATE: There's an alternate XSLT file for use with the new 4.5 XML Schema. Just download the file and paste its contents into the 'XMLDump.xslt' file (or create it as a separate XSLT and point the macro to the new file). Grab it here (or below): greystate.dk/.../xmldump-41b2.xslt"

    So you might want to try out that file instead. If you still want to use the package of course :)

    /Kim A

Please Sign in or register to post replies

Write your reply to:

Draft