I’ve an xsl:variable like this,
<xsl:variable name="flag"
select="(/node1/@attr = 1) or (/node2/@attr = 1)"/>
Is it possible to read the attribute value without specifying the node name? so i can elimniate the or condition. Basically I feed two types of xml to the xslt, node1 and node2 are the root node names.
Use:
If you need to eliminate the
oropertor, do:In XPath 2.0 (XSLT 2.0) this can further be abbreviated to: