XPath 2.0 introduced many new features XQuery-cośtam:
- Added support for all XML simple types
- Many new functions (tripled instruction count)
- All expressions evaluate to sequence
- Introduces conditional expressions and for-loops
XPath 3.0
- Dynamic function calls (function may be called without being referenced by name (find
function in collection and call)
- Inline functions
- Namespace literals - Namespace may be embedded into function name
- Support for union types - collections containing elements of different types
- Mapping operator - '!' performs evaluation for each element in sequence and
concatenates results
- Introduced maps
XPath 3.1
- New operator for function chaining '=>'
- Introduced maps that store data in pair 'key:value' - 'map{ key : value, key : value
}'
- Introduced arrays - they differ from sequences in that they can be nested 'array{1, 5, 7,
(10 to 20)}'