[ACCEPTED]-xsl:for-each select=: two conditions-xslt

Accepted answer
Score: 11

If the question is "is it possible 8 to check 2 conditions in a select attribute 7 of a for-each" the answer is: NO. Because

The 6 expression must evaluate to a node-set. (from 5 ZVON)

Hence the data type of the select must 4 be a node-set not a boolean value.

But, if 3 you want to select two node-sets inside 2 a xsl:for-each or xsl:template (the latter is better) etc., you 1 can use the union operator (|):

<xsl:for-each select="/document/line[
                         contains(substring(field[@id='0'], 1,3),'MAR')
                      ] | 
                      /document/line[
                         contains(substring(field[@id='0'],123,4),'0010')
                      ]">

More Related questions