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?
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?
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)
.
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 "||".