Skip to main content

Module sequence_ops

Module sequence_ops 

Source
Expand description

Sequence operations for XPath evaluation.

This module implements XPath 2.0 sequence operations:

  • Union (|) - node-only, returns nodes in document order
  • Intersect - node-only, returns nodes in document order
  • Except - node-only, returns nodes in document order

Note: Union, intersect, and except are NODE-ONLY operations in XPath 2.0. Applying them to atomic values results in XPTY0004.

Functionsยง

contains_value
Check if a sequence contains a specific value (by value equality).
count
Get the count of items in a sequence.
deep_equal
Deep equality check between two atomic value sequences.
distinct_values
Get distinct values from a sequence (removes duplicates by value equality).
except_atomic_values
Compute the difference of two atomic value sequences.
except_nodes
Compute the difference of two node sequences (left except right).
except_valuesDeprecated
Deprecated: Use except_atomic_values for atomic sequences or except_nodes for nodes.
head
Get the first item from a sequence, if any.
index_of
Find the index of a value in a sequence (1-based, XPath style).
insert_before
Insert an item at a specific position.
intersect_atomic_values
Compute the intersection of two atomic value sequences.
intersect_nodes
Compute the intersection of two node sequences.
intersect_valuesDeprecated
Deprecated: Use intersect_atomic_values for atomic sequences or intersect_nodes for nodes.
is_empty
Check if a sequence is empty.
is_singleton
Check if a sequence contains exactly one item.
remove_at
Remove an item at a specific position.
reverse
Reverse a sequence.
subsequence
Subsequence (slice) of a sequence.
tail
Get all items except the first from a sequence.
union_atomic_values
Compute the union of two atomic value sequences (deduplicates by value equality).
union_nodes
Compute the union of two node sequences.
union_valuesDeprecated
Deprecated: Use union_atomic_values for atomic sequences or union_nodes for nodes.