Keep structured values between queries
The separate XPath library builds maps and arrays, passes them between named functions, and explicitly selects their contents. These native values stay opaque to CEM-QL; an array remains one item until an XPath lookup selects its members.
A map can contain an entry whose value is the empty sequence.
map:contains distinguishes it from an absent entry even
though map:get returns nothing for either one.
map:keys supplies the keys; their order is not portable.
Duplicate keys in a map constructor are errors, and numeric 1 is a
different key from string "1".
Array positions start at 1. Square constructors preserve each member
sequence, including empty members; array { … } creates
one member per item. Nested arrays keep their structure.
These examples use scalar inputs and CEM trees imported from XML and JSON.
The JSON-to-XML mapping creates ordinary tree nodes; XPath explicitly
puts selected nodes into an array. JSON null mapping preserves a null
element, distinct from an absent member or an empty string.
Native HTTP inputs remain deferred. Shared XPath item, text and work
limits apply; imports are limited to 32 KiB, 64 levels and 4096
source events or values.
See also
XPath regex and prefix-rule validation
XPath sequences and columns · XPath numeric aggregates · Data tables and IP-filter aspects