Class GroupStarting

  • All Implemented Interfaces:
    Callable, FunctionItem, GroundedValue, Item, Sequence

    public class GroupStarting
    extends SystemFunction
    This class supports the extension function saxon:group-starting. This takes two arguments: the first is a sequence of items, the second is a function used as a predicate. The function is applied to each item in the sequence: if the effective boolean value of the result is true, the item is called a matching item. The result of the function is a sequence of arrays, where the members of each array are single items, and the flattened sequence of arrays is the same as the input sequence.

    If the input sequence is empty, the result sequence is empty.

    In all other cases (a) the first item in the result is an array containing those items from the input that precede the first matching item; this array will be empty if the first item in the input is a matching item; (b) every other item in the result is an non-empty array containing a subsequence of the input in which the first member is a matching item and the remaining members are non-matching items.

    • Constructor Detail

      • GroupStarting

        public GroupStarting()
    • Method Detail

      • call

        public Sequence call​(XPathContext context,
                             Sequence[] arguments)
                      throws XPathException
        Evaluate this function call at run-time
        Parameters:
        context - The XPath dynamic evaluation context
        arguments - The values of the arguments to the function call.
        Returns:
        the results of the function, as a sequence of arrays
        Throws:
        XPathException - if a dynamic error occurs during evaluation of the function. The Saxon run-time code will add information about the error location.