Skip to main content

subsequence

Function subsequence 

Source
pub fn subsequence<N: DomNavigator>(
    _context: &mut DynamicContext<'_, N>,
    args: Vec<XPathValue<N>>,
) -> Result<XPathValue<N>, XPathError>
Expand description

Implements fn:subsequence - returns a contiguous subsequence.

Returns items from $sourceSeq starting at position $startingLoc and continuing for $length items (or to the end if $length is omitted).

Uses XPath 2.0 rounding rules:

  • Positions are doubles, rounded to integers
  • NaN startingLoc or length -> empty
  • +Infinity startingLoc -> empty
  • -Infinity length -> empty