DIGIFORMS
Digiforms Designer Documentation
Search
About
+
Getting started
+
Howto
Help by samples
+
Objects
+
Page template
Capture or output data in a defined layout
+
XML
Extensible Markup Language
Howto
XSLT and XPath
Counting nodes
XPATH count() Function
Usage
The count() returns number of nodes matching input criteria.
Syntax
<xsl:value-of select="count ( (item,item,...) )"/>
xslt
attribute="{ count( item,item,...) )}"
attribute template
Examples
Counting occurence of elements with the specific name 'item' in current contex.
<xsl:value-of select="count(*[name() = 'item')"/>
xslt
Testing for occourence of 'item' elements in current context.
<xsl:if test="count(item) = 0"> There are no items </xsl:if>
xslt
Edit article