XSL Testing multiple nodes
Like a kid with a new toy.I'd like to credit the author but can't find the reference any more. This is a nice readable solution to testing against multiple nodes.
<xsl:variable name="testresult">
<xsl:for-each select="element/attribute">
<xsl:if test="test1">x</xsl:if>
<xsl:if test="test2">x</xsl:if>
<xsl:if test="test3">x</xsl:if>
<xsl:if test="test4">x</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:if test="string-length($testresult)!=0">
Do something.....
</xsl:if>
Labels: xslt

0 Comments:
Post a Comment
<< Home