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
Objects
XSLT
xsl:choose
xsl:when
Conditional section
Use
Use the <xsl:when> object within <xsl:choose> to output content based on conditional tests on XML data.
Any content added within the <xsl:when> object will be output ONLY when the test expression evaluates to true()
Test expression
The xpath expression to be avaluated
A valid xpath expression or functions addressing xml data and variables.
XSLT code
Using the <xsl:choose> element in textbox content.
Within textbox conent, xsl:choose can be used to perform logical tests in combination with xslt, svg, html or xsl:fo markup.
<xsl:for-each select="item"> <xsl:if test="position() > 1">,</xsl:if> <xsl:value-of select="@number"></xsl:value> </xsl:for-each> Output: 34-233, 35-872
xslt
The above example iterates <item> elements and outputs their @number attribute, delimited by ( , ) The xsl:if test in this case ensures that a delimiter is not added after the last item.
Edit article