New features in XPath 4.0
Some of the new features in XPath 4.0 are as follows. For full details, see the W3C specifications (in particular XML Path Language (XPath) 4.0 and XQuery and XPath Data Model 4.0).
-
New operators: otherwise, pipeline operator, mapping arrow operator
-
New item types: choice types, enumeration types, record types, named item types
-
New syntax relating to functions:
-
Keyword arguments used in function calls
-
New syntax for inline functions (
fnabbreviation, and focus functions) -
Optional parameters with default values in function declarations
-
-
New axes:
preceding-or-self,preceding-sibling-or-self,following-or-self, andfollowing-sibling-or-self -
From 4.0, XPath expressions can be include namespace declarations, allowing namespace prefixes to be bound within the XPath expression, rather than relying entirely on the host language to declare namespace prefixes.
Many new functions are available, for details see the Functions library.