In XLST how would you find out the length of a node-set?
Nodesets Length
14.5k views Asked by AudioBubble At
3
There are 3 answers
1
On
there is no need to put that into a
<xsl:variable name="length" select="count(nodes/node)"/>
though... you can just print it out as follows:
<xsl:value-of select="count(nodes/node)"/>
or use it in a if-clause as follows:
<xsl:if test="count(comments/comment) > '0'">
<ul>
<xsl:apply-templates select="comments/comment"/>
</ul>
</xsl:if>