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
    Oct 18, 2010 @ 11:02
    Phil Crowe
    0

    loop 2 tier loop

    i dont understand why this isnt working. i just want to display a list of nodes(excluding the one specified) and then under each node of that first tier display their child nodes. the top tier works but the 2nd tier isnt. 

    <xsl:for-each select="$currentPage/* [@isDoc and string(@id) != '2144']">

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

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

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

    </xsl:for-each>

    </xsl:for-each>

     

     

  • Phil Crowe 192 posts 256 karma points
    Oct 18, 2010 @ 13:50
    Phil Crowe
    0

    i dont understand this at all. if i change the inner loop to a wild card <xsl:for-each select="$currentPage/* [@isDoc]"> it will show the same values as the outer loop but this is the only value i can get it to loop. i cant even get it to show ancestors. any ideas?

  • Tom Maton 387 posts 660 karma points
    Oct 18, 2010 @ 14:00
    Tom Maton
    0

    Hi Phil,

    Give this a try (not tested)

    <xsl:for-each select="$currentPage/* [@isDoc and string(@id) != '2144']">
    <xsl:value-of select="@nodeName"/>
    <xsl:for-each select="@id/descendant::node [@isDoc]">
    <xsl:value-of select="@nodeName"/>
    </xsl:for-each>
    </xsl:for-each>

    You will see that I've change the 3rd line to @id this should add the id of the page you are looping through and then get those pages below that.

    Tom

  • Kim Andersen 1447 posts 2196 karma points MVP
    Oct 18, 2010 @ 14:04
    Kim Andersen
    0

    Hi Phil

    Could you give this snippet a try:

    <xsl:for-each select="$currentPage/* [@isDoc and string(@id) != '2144']">
    <xsl:value-of select="@nodeName"/>
    <xsl:for-each select="./* [@isDoc]">
    <xsl:value-of select="./@nodeName"/>
    </xsl:for-each>
    </xsl:for-each>

    /Kim A

Please Sign in or register to post replies

Write your reply to:

Draft