Copied to clipboard

Flag this post as spam?

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


  • Kim Grandgagnage 63 posts 87 karma points
    Oct 11, 2012 @ 23:07
    Kim Grandgagnage
    0

    Count number of nodes within for each

     Hi,

    I want to count the number of records of shops within a certain category (= variable cntshops), but for some reasons the result is equal to 0. What could be the problem?

    The field w_cat is a multinode treepicker of categories.

    <xsl:for-each select="umbraco.library:GetXmlNodeById(1124)/* [name() = 'Categorie']">
        <xsl:sort select="@sortOrder" order="ascending" data-type="number"/>  
        <Categorie>
                <xsl:variable name="catid">         
                    <xsl:text disable-output-escaping="yes">,</xsl:text><xsl:value-of select="@id"/><xsl:text disable-output-escaping="yes">,</xsl:text>
                </xsl:variable>
              
                <xsl:variable name="cntshops" select="count(umbraco.library:GetXmlNodeById(1132)//* [name() = 'Winkel' and contains(concat(',',w_cat,','),$catid)])"/>
               
                <xsl:attribute name="Aantal"><xsl:value-of select="$cntshops"/></xsl:attribute>

     </Categorie>

    </xsl:for-each>

     

    grts,

    Kim

  • 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