What does ! mean in XPath 3.0?

1.6k Views Asked by At

XPath 3.0 defines a new operator called the 'mapping operator'. It is denoted by the exclamation mark --!.

What does A!B mean? How do we use the ! operator? Could someone give me an example?

2

There are 2 best solutions below

4
On BEST ANSWER

Simple map operator (!) works rather like /, except there is no restriction that the left hand operand must be a node-set, and there is no sorting of results into document order.

For example, (1 to 7)!(.*.) returns the sequence (1, 4, 9, 16, 25, 36, 49).

0
On

Here's another example:

let $s := "The Taming of the Shrew"
return tokenize($s, ' ')!(string-length(.)||upper-case(.))

returns ("3THE", "6TAMING", "2OF", "3THE", "5SHREW")

This also uses the new string concatenation operator "||".