Copied to clipboard

Flag this post as spam?

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


  • Sam 63 posts 126 karma points
    Nov 03, 2011 @ 08:45
    Sam
    0

    How to count number of nodes to display specific items

    Hi , how can i make a count on subnodes, thus that when number is equal to 1...I dont display next and prev arrows arrows else if more than one display those arrows....here is my code:

    <xsl:choose>
            <xsl:when test="count(./node) = 1"> -------this is not working
            
                  <div id="myController">
                  <span class="jFlowPrev" style="display:none;">prev</span>
                  <xsl:for-each select="$nodes">
                  <span class="jFlowControl"><xsl:value-of select="@nodeName"/></span>
                  </xsl:for-each
                  <span class="jFlowNext" style="display:none;">next</span>
                  </div>
            
            </xsl:when
                      
            <xsl:otherwise>
                  <div id="myController">
                  <span class="jFlowPrev">prev</span>
                  <xsl:for-each select="$nodes">
                  <span class="jFlowControl"><xsl:value-of select="@nodeName"/></span>
                  </xsl:for-each
                  <span class="jFlowNext">next</span>
                  </div>
            </xsl:otherwise>           
    </xsl:choose>

    any help please

     

    //Sam

  • Sam 63 posts 126 karma points
    Nov 03, 2011 @ 08:52
    Sam
    0

    ok get it right with  <xsl:when test="count($nodes) = 1">

  • 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