Search code examples
xmlxpathxpath-3.0

What does ! mean in XPath 3.0?


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?


Solution

  • 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).