SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
XPath API for Java
Saxon on .NET
Extensibility
Saxon Extensions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
| Introduction
| Constants
| Variable References
| Function Calls
| Axis steps
| Parentheses and operator precedence
| Filter expressions
| Path expressions
| Cast as, Treat as
| Set difference and intersection
» | Union
| Arithmetic expressions
| Range expressions
| Comparisons
| Instance of and Castable as
| Conditional Expressions
| Quantified Expressions
| For Expressions
| Boolean expressions: AND and OR
| Sequence expressions
Function Library
Standards Conformance

# Union

The `|` operator was available in XPath 1.0; the keyword `union` has been 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)/sections` returns all `section` elements within a `chapter` or `appendix` of the selected `book` element.

Next