Union
The |
operator was available in XPath 1.0; the keyword union
was
added in XPath 2.0 as a synonym, because it is familiar to SQL users.
The expression E1 union E2
selects all nodes that are in either
E1
or E2
or both. Both expressions must return sequences of
nodes. The results are returned in document order. For example, /book/(chapter |
appendix)/section
returns all section
elements within a
chapter
or appendix
of the selected book
element.