Copied to clipboard

Flag this post as spam?

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


  • Phil Crowe 192 posts 256 karma points
    Jul 05, 2011 @ 14:05
    Phil Crowe
    0

    get all nodes of certain document type under specified node

    I want to get all nodes of type 'product' under a specific node (all, children, granchildren, great gran children etc...)

        <xsl:variable name="productNode" select="umbraco.library:GetXmlNodeById(1132)"  />

        <xsl:for-each select="$productNode/descendant-or-self ">

          <xsl:value-of select="@nodeName"/>

    </xsl:for-each>

     

    this however returns nothing. if i do:

    <textarea><xsl:value-of select="$productNode" /></textarea>

    it does display the xml for the correct node

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jul 05, 2011 @ 14:08
    Tom Fulton
    1

    Hi,

    Either one of these should work:

    <xsl:for-each select="$productNode/descendant::Product [@isDoc]">

    or

    <xsl:for-each select="$productNode//Product [@isDoc]">

    Hope this helps,
    Tom

Please Sign in or register to post replies

Write your reply to:

Draft