The context node in the XPath is
- either the root node, when the XPath expression is absolute (starts with
/
)
- or the current XSLT node (when the expression is relative)
In your case the context for the second part of the XPath union would be the node that was current before the <xsl:for-each>
.
Within the for-each, the context node switches to each node that is being iterated over.
For the result of an XPath union, document order is relevant. If /ROOT_NODE/NODE_1/NODE_11/LOCALE[CO >= 8]
comes before NODE_2/NODE_22/OCA
in the document, then the first part will be processed first, else the other way around.
In general it is not a good idea to rely on this side effect, though. You should declare sort order (<xsl:sort>
), or not iterate over a union of different things (use two consecutive <xsl:for-each>
loops to make output order fixed and apparent).