XML query is a separate language designed to act on XML documents to perform basic operations on the data such as filtering, mapping and reducing.
XML query is a functional programming language with immutable data structures, similar to languages such as Elixir, but with a much smaller applicable scope.
XML can be embedded within XML query as values, similar to JSX
Common built in functions
Function | Purpose |
---|---|
doc(path) | Loads a document at a specified file path |
string-join(list, string) | Joins a list of strings |
concat(a, b, ...) | Concatenates two or more strings |
contains(string, substring) | Checks if a string contains another |
substring(string, start, end) | Extracts a 1-indexed sub-string from a string |
sum(list) | Sums a list |
count(list) | Returns the number of elements in a list |
name(node) | Gets the name of a node |
data(node) | Returns the value held in a node’s tags |
Expressions
Useful expression types are: