Class Steps

java.lang.Object
net.sf.saxon.s9api.streams.Steps

public class Steps extends Object
This non-instantiable class provides a number of useful implementations of the Step interface, used to navigate XDM trees, typically as an argument to XdmValue.select(net.sf.saxon.s9api.streams.Step<T>).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Step<XdmNode>
    Obtain a Step to navigate from a node to its ancestors, in reverse document order (that is, nearest ancestor first, root node last)
    static Step<XdmNode>
    ancestor(String localName)
    Obtain a Step that navigates from a node to its ancestor elements having a specified local name, irrespective of the namespace.
    static Step<XdmNode>
    ancestor(String uri, String localName)
    Return a Step that navigates from a node to its ancestors having a specified namespace URI and local name, in reverse document order (that is, nearest ancestor first, root node last)
    static Step<XdmNode>
    ancestor(Predicate<? super XdmNode> filter)
    Obtain a Step that filters the nodes found on the ancestor axis using a supplied Predicate.
    static Step<XdmNode>
    Obtain a Step to navigate from a node to its ancestors, in reverse document order, with the node itself returned at the start of the sequence (that is, origin node first, root node last)
    static Step<XdmNode>
    Obtain a Step that navigates from a node to its ancestor elements having a specified local name, irrespective of the namespace.
    static Step<XdmNode>
    ancestorOrSelf(String uri, String localName)
    Obtain a Step that navigates from a node to its ancestors-or-self having a specified namespace URI and local name, in reverse document order (that is, nearest ancestor first, root node last)
    static Step<XdmNode>
    ancestorOrSelf(Predicate<? super XdmNode> filter)
    Obtain a Step that filters the nodes found on the ancestor-or-self axis using a supplied Predicate.
    Obtain a Step that atomizes an item to produce a stream of atomic values.
    static Step<XdmNode>
    Obtain a Step to navigate from a node to its attributes
    static Step<XdmNode>
    attribute(String localName)
    Obtain a Step that navigates from a node to its attributes having a specified local name, irrespective of the namespace
    static Step<XdmNode>
    attribute(String uri, String localName)
    Return a Step that navigates from a node to its attribute having a specified namespace URI and local name
    static Step<XdmNode>
    attribute(Predicate<? super XdmNode> filter)
    Obtain a Step that filters the nodes found on the attribute axis using a supplied Predicate.
    A step equivalent to the XPath "cast as" operator: the supplied item is atomized if necessary, and the resulting atomic values are cast to the required type
    static Step<XdmNode>
    Obtain a Step to navigate from a node to its children
    static Step<XdmNode>
    child(String localName)
    Obtain a Step that navigates from a node to the element children having a specified local name, irrespective of the namespace
    static Step<XdmNode>
    child(String uri, String localName)
    Obtain a Step that navigates from a node to the element children having a specified namespace URI and local name
    static Step<XdmNode>
    child(Predicate<? super XdmNode> filter)
    Obtain a Step that filters the nodes found on the child axis using a supplied Predicate.
    static Step<XdmNode>
    Obtain a Step to navigate from a node to its descendants, which are returned in document order
    static Step<XdmNode>
    descendant(String localName)
    Obtain a Step that navigates from a node to the descendant elements having a specified local name, irrespective of the namespace.
    static Step<XdmNode>
    descendant(String uri, String localName)
    Obtain a Step that navigates from a node to the element descendants having a specified namespace URI and local name.
    static Step<XdmNode>
    descendant(Predicate<? super XdmNode> filter)
    Obtain a Step that filters the nodes found on the descendant axis using a supplied Predicate.
    static Step<XdmNode>
    Obtain a Step to navigate from a node to its descendants, which are returned in document order, preceded by the origin node itself
    static Step<XdmNode>
    Obtain a Step that navigates from a node to the descendant-or-self elements having a specified local name, irrespective of the namespace.
    static Step<XdmNode>
    descendantOrSelf(String uri, String localName)
    Obtain a Step that navigates from a node to the descendant-or-self elements having a specified namespace URI and local name.
    static Step<XdmNode>
    Obtain a Step that filters the nodes found on the descendant-or-self axis using a supplied Predicate.
    static Step<XdmNode>
    Obtain a Step to navigate from a node to its following nodes (excluding descendants), which are returned in document order
    static Step<XdmNode>
    following(String localName)
    Obtain a Step that navigates from a node to the following elements having a specified local name, irrespective of the namespace.
    static Step<XdmNode>
    following(String uri, String localName)
    Obtain a Step that navigates from a node to the following elements having a specified namespace URI and local name.
    static Step<XdmNode>
    following(Predicate<? super XdmNode> filter)
    Obtain a Step that filters the nodes found on the following axis using a supplied Predicate.
    static Step<XdmNode>
    Obtain a Step to navigate from a node to its following siblings, which are returned in document order
    static Step<XdmNode>
    Obtain a Step that navigates from a node to the following sibling elements having a specified local name, irrespective of the namespace.
    static Step<XdmNode>
    followingSibling(String uri, String localName)
    Obtain a Step that navigates from a node to the following sibling elements having a specified namespace URI and local name.
    static Step<XdmNode>
    Obtain a Step that filters the nodes found on the following sibling axis using a supplied Predicate.
    static Step<XdmNode>
    id(XdmNode doc)
    Obtain a Step whose effect is to interpret the supplied item as an xs:ID value and return the nodes (in a given document) that have that string as their ID.
    static Step<XdmNode>
    Obtain a Step to navigate from a node to its namespace nodes
    static Step<XdmNode>
    namespace(String localName)
    Obtain a Step that navigates from a node to its namespaces having a specified local name.
    static Step<XdmNode>
    namespace(Predicate<? super XdmNode> filter)
    Obtain a Step that filters the nodes found on the namespace axis using a supplied Predicate.
    static <U extends XdmItem>
    Step<U>
    Obtain a Step that always returns an empty sequence, whatever the input
    static Step<XdmNode>
    Obtain a Step to navigate from a node to its parent
    static Step<XdmNode>
    parent(String localName)
    Obtain a Step that navigates from a node to the parent element provided it has a specified local name, irrespective of the namespace
    static Step<XdmNode>
    parent(String uri, String localName)
    Obtain a Step that navigates from a node to the parent element provided it has a specified namespace URI and local name
    static Step<XdmNode>
    parent(Predicate<? super XdmNode> filter)
    Obtain a Step that filters the node found on the parent axis using a supplied Predicate.
    static Step<? extends XdmNode>
    path(String... steps)
    Construct a simple path consisting solely of simple child, attribute, descendant, root, and parent steps.
    static Step<? extends XdmNode>
    path(Step<? extends XdmNode>... steps)
    Construct a path as a composite Step from a sequence of steps composed together
    static Step<XdmNode>
    Obtain a Step to navigate from a node to its preceding nodes (excluding ancestors), which are returned in reverse document order
    static Step<XdmNode>
    preceding(String localName)
    Obtain a Step that navigates from a node to the preceding elements having a specified local name.
    static Step<XdmNode>
    preceding(String uri, String localName)
    Obtain a Step that navigates from a node to the preceding elements having a specified namespace URI and local name.
    static Step<XdmNode>
    preceding(Predicate<? super XdmNode> filter)
    Obtain a Step that filters the nodes found on the preceding axis using a supplied Predicate.
    static Step<XdmNode>
    Obtain a Step to navigate from a node to its preceding siblings, which are returned in reverse document order
    static Step<XdmNode>
    Obtain a Step that navigates from a node to the preceding sibling elements having a specified local name, irrespective of the namespace.
    static Step<XdmNode>
    precedingSibling(String uri, String localName)
    Obtain a Step that navigates from a node to the preceding sibling elements having a specified namespace URI and local name.
    static Step<XdmNode>
    Obtain a Step that filters the nodes found on the preceding sibling axis using a supplied Predicate.
    static Step<XdmNode>
    Obtain a Step that selects the root node of the containing document (which may or may not be a document node)
    static Step<XdmNode>
    Obtain a Step to navigate from a node to itself (useful only if applying a predicate)
    static Step<XdmNode>
    self(String localName)
    Obtain a Step that navigates from a node to itself provided it is an element with a specified local name, irrespective of the namespace
    static Step<XdmNode>
    self(String uri, String localName)
    Obtain a Step that navigates from a node to itself provided it has a specified namespace URI and local name
    static Step<XdmNode>
    self(Predicate<? super XdmNode> filter)
    Obtain a Step that filters the node found on the self axis using a supplied Predicate.
    static Step<XdmNode>
    Obtain a Step that returns text nodes found on the child axis.
    Obtain a Step whose effect is to tokenize the supplied item on whitespace boundaries, returning a sequence of strings as XdmAtomicValue instances.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Steps

      public Steps()
  • Method Details

    • root

      public static Step<XdmNode> root()
      Obtain a Step that selects the root node of the containing document (which may or may not be a document node)
      Returns:
      a step that delivers the root node of the tree containing the step's origin.
    • atomize

      public static Step<XdmAtomicValue> atomize()
      Obtain a Step that atomizes an item to produce a stream of atomic values. (Atomizing a node will usually produce a single atomic value, but in the case of schema-typed nodes using a list type, there may be more than one atomic value. Atomizing an array also returns multiple atomic values)
      Returns:
      a step that performs atomization
    • castAs

      public static Step<XdmAtomicValue> castAs(ItemType type)
      A step equivalent to the XPath "cast as" operator: the supplied item is atomized if necessary, and the resulting atomic values are cast to the required type
      Parameters:
      type - the target type of the cast
      Returns:
      a step that returns the result of the cast
    • nothing

      public static <U extends XdmItem> Step<U> nothing()
      Obtain a Step that always returns an empty sequence, whatever the input
      Type Parameters:
      U - the static item type of the result of the step
      Returns:
      a Step that always returns an empty sequence
    • ancestor

      public static Step<XdmNode> ancestor()
      Obtain a Step to navigate from a node to its ancestors, in reverse document order (that is, nearest ancestor first, root node last)
      Returns:
      a Step that selects all nodes on the ancestor axis
    • ancestor

      public static Step<XdmNode> ancestor(String localName)
      Obtain a Step that navigates from a node to its ancestor elements having a specified local name, irrespective of the namespace. The nodes are returned in reverse document order (that is, nearest ancestor first, root node last)
      Parameters:
      localName - the local name of the ancestors to be selected by the Step, or "*" to select all ancestors that are element nodes
      Returns:
      a Step, which selects the ancestors of a supplied node that have the required local name.
    • ancestor

      public static Step<XdmNode> ancestor(String uri, String localName)
      Return a Step that navigates from a node to its ancestors having a specified namespace URI and local name, in reverse document order (that is, nearest ancestor first, root node last)
      Parameters:
      uri - the namespace URI of the ancestors to be selected by the Step
      localName - the local name of the ancestors to be selected by the Step: supply a zero-length string to indicate the null namespace
      Returns:
      a Step, which selects the ancestors (at most one) of a supplied node that have the required local name and namespace URI.
    • ancestor

      public static Step<XdmNode> ancestor(Predicate<? super XdmNode> filter)
      Obtain a Step that filters the nodes found on the ancestor axis using a supplied Predicate. Nodes are returned in reverse document order (that is, nearest ancestor first, root node last)

      The function call ancestor(predicate) is equivalent to ANCESTOR.where(predicate).

      Parameters:
      filter - the predicate to be applied
      Returns:
      a Step that filters the nodes found on the ancestor axis using a supplied Predicate.
    • ancestorOrSelf

      public static Step<XdmNode> ancestorOrSelf()
      Obtain a Step to navigate from a node to its ancestors, in reverse document order, with the node itself returned at the start of the sequence (that is, origin node first, root node last)
      Returns:
      a Step that selects all nodes on the ancestor-or-self axis
    • ancestorOrSelf

      public static Step<XdmNode> ancestorOrSelf(String localName)
      Obtain a Step that navigates from a node to its ancestor elements having a specified local name, irrespective of the namespace. The nodes are returned in reverse document order (that is, nearest ancestor first, root node last), and include the node itself
      Parameters:
      localName - the local name of the ancestors to be selected by the Step, or "*" to select all ancestor-or-self nodes that are element nodes
      Returns:
      a Step, which selects the ancestors-or-self of a supplied node that have the required local name.
    • ancestorOrSelf

      public static Step<XdmNode> ancestorOrSelf(String uri, String localName)
      Obtain a Step that navigates from a node to its ancestors-or-self having a specified namespace URI and local name, in reverse document order (that is, nearest ancestor first, root node last)
      Parameters:
      uri - the namespace URI of the ancestors to be selected by the Step: supply a zero-length string to indicate the null namespace
      localName - the local name of the ancestors to be selected by the Step
      Returns:
      a Step, which selects the ancestors-or-self of a supplied node that have the required local name and namespace URI.
    • ancestorOrSelf

      public static Step<XdmNode> ancestorOrSelf(Predicate<? super XdmNode> filter)
      Obtain a Step that filters the nodes found on the ancestor-or-self axis using a supplied Predicate. Nodes are returned in reverse document order (that is, origin node first, root node last)

      The function call ancestorOrSelf(predicate) is equivalent to ANCESTOR_OR_SELF.where(predicate).

      Parameters:
      filter - the predicate to be applied
      Returns:
      a Step that filters the nodes found on the ancestor-or-self axis using a supplied Predicate.
    • attribute

      public static Step<XdmNode> attribute()
      Obtain a Step to navigate from a node to its attributes
      Returns:
      a Step that selects all nodes on the ancestor axis
    • attribute

      public static Step<XdmNode> attribute(String localName)
      Obtain a Step that navigates from a node to its attributes having a specified local name, irrespective of the namespace
      Parameters:
      localName - the local name of the attributes to be selected by the Step, or "*" to select all attributes
      Returns:
      a Step, which selects the attributes of a supplied node that have the required local name.
    • attribute

      public static Step<XdmNode> attribute(String uri, String localName)
      Return a Step that navigates from a node to its attribute having a specified namespace URI and local name
      Parameters:
      uri - the namespace URI of the attributes to be selected by the Step: supply a zero-length string to indicate the null namespace
      localName - the local name of the attributes to be selected by the Step
      Returns:
      a Step, which selects the attributes (at most one) of a supplied node that have the required local name and namespace URI.
    • attribute

      public static Step<XdmNode> attribute(Predicate<? super XdmNode> filter)
      Obtain a Step that filters the nodes found on the attribute axis using a supplied Predicate. The function call attribute(predicate) is equivalent to ATTRIBUTE.where(predicate).
      Parameters:
      filter - the predicate to be applied
      Returns:
      a Step that filters the nodes found on the attribute axis using a supplied Predicate.
    • child

      public static Step<XdmNode> child()
      Obtain a Step to navigate from a node to its children
      Returns:
      a Step that selects all nodes on the child axis
    • child

      public static Step<XdmNode> child(String localName)
      Obtain a Step that navigates from a node to the element children having a specified local name, irrespective of the namespace
      Parameters:
      localName - the local name of the child elements to be selected by the Step, or "*" to select all children that are element nodes
      Returns:
      a Step, which selects the element children of a supplied node that have the required local name.
    • child

      public static Step<XdmNode> child(String uri, String localName)
      Obtain a Step that navigates from a node to the element children having a specified namespace URI and local name
      Parameters:
      uri - the namespace URI of the child elements to be selected by the Step: supply a zero-length string to indicate the null namespace
      localName - the local name of the child elements to be selected by the Step
      Returns:
      a Step, which selects the element children of a supplied node that have the required local name and namespace URI.
    • child

      public static Step<XdmNode> child(Predicate<? super XdmNode> filter)
      Obtain a Step that filters the nodes found on the child axis using a supplied Predicate. The function call child(predicate) is equivalent to CHILD.where(predicate). For example, child(isElement()) returns a Step that selects the element node children of a given node.
      Parameters:
      filter - the predicate to be applied
      Returns:
      a Step that filters the nodes found on the child axis using a supplied Predicate.
    • descendant

      public static Step<XdmNode> descendant()
      Obtain a Step to navigate from a node to its descendants, which are returned in document order
      Returns:
      a Step that selects all nodes on the descendant axis
    • descendant

      public static Step<XdmNode> descendant(String localName)
      Obtain a Step that navigates from a node to the descendant elements having a specified local name, irrespective of the namespace. These are returned in document order.
      Parameters:
      localName - the local name of the descendant elements to be selected by the Step, or "*" to select all descendants that are element nodes
      Returns:
      a Step, which selects the element descendants of a supplied node that have the required local name.
    • descendant

      public static Step<XdmNode> descendant(String uri, String localName)
      Obtain a Step that navigates from a node to the element descendants having a specified namespace URI and local name. These are returned in document order.
      Parameters:
      uri - the namespace URI of the descendant elements to be selected by the Step: supply a zero-length string to indicate the null namespace
      localName - the local name of the descendant elements to be selected by the Step
      Returns:
      a Step, which selects the element descendants of a supplied node that have the required local name and namespace URI.
    • descendantOrSelf

      public static Step<XdmNode> descendantOrSelf()
      Obtain a Step to navigate from a node to its descendants, which are returned in document order, preceded by the origin node itself
      Returns:
      a Step that selects all nodes on the descendant-or-self axis
    • descendant

      public static Step<XdmNode> descendant(Predicate<? super XdmNode> filter)
      Obtain a Step that filters the nodes found on the descendant axis using a supplied Predicate. The function call descendant(predicate) is equivalent to DESCENDANT.where(predicate). For example, descendant(isElement()) returns a Step that selects the element node descendants of a given node, while descendant(exists(attribute("id"))) selects those that have an attribute named "id". These are returned in document order.
      Parameters:
      filter - the predicate to be applied
      Returns:
      a Step that filters the nodes found on the descendant axis using a supplied Predicate.
    • descendantOrSelf

      public static Step<XdmNode> descendantOrSelf(String localName)
      Obtain a Step that navigates from a node to the descendant-or-self elements having a specified local name, irrespective of the namespace. These are returned in document order, preceded by the origin node itself if it matches the conditions.
      Parameters:
      localName - the local name of the descendant-or-self elements to be selected by the Step, or "*" to select all descendant-or-self nodes that are element nodes
      Returns:
      a Step, which selects the element children of a supplied node that have the required local name.
    • descendantOrSelf

      public static Step<XdmNode> descendantOrSelf(String uri, String localName)
      Obtain a Step that navigates from a node to the descendant-or-self elements having a specified namespace URI and local name. These are returned in document order, preceded by the origin node itself if it matches the conditions.
      Parameters:
      uri - the namespace URI of the descendant-or-self elements to be selected by the Step: supply a zero-length string to indicate the null namespace
      localName - the local name of the descendant-or-self elements to be selected by the Step
      Returns:
      a Step, which selects the element descendants-or-self of a supplied node that have a given local name and namespace URI.
    • descendantOrSelf

      public static Step<XdmNode> descendantOrSelf(Predicate<? super XdmNode> filter)
      Obtain a Step that filters the nodes found on the descendant-or-self axis using a supplied Predicate. The function call descendant(predicate) is equivalent to DESCENDANT.where(predicate). For example, descendant(isElement()) returns a Step that selects the element node descendants of a given node, while descendant(exists(attribute("id"))) selects those that have an attribute named "id". These are returned in document order.
      Parameters:
      filter - the predicate to be applied
      Returns:
      a Step that filters the nodes found on the descendant-or-self axis using a supplied Predicate.
    • following

      public static Step<XdmNode> following()
      Obtain a Step to navigate from a node to its following nodes (excluding descendants), which are returned in document order
      Returns:
      a Step that selects all nodes on the following axis
    • following

      public static Step<XdmNode> following(String localName)
      Obtain a Step that navigates from a node to the following elements having a specified local name, irrespective of the namespace. These are returned in document order.
      Parameters:
      localName - the local name of the following elements to be selected by the Step, or "*" to select all following nodes that are elements
      Returns:
      a Step, which selects the following elements of a supplied node that have the required local name.
    • following

      public static Step<XdmNode> following(String uri, String localName)
      Obtain a Step that navigates from a node to the following elements having a specified namespace URI and local name. These are returned in document order.
      Parameters:
      uri - the namespace URI of the following elements to be selected by the Step: supply a zero-length string to indicate the null namespace
      localName - the local name of the following elements to be selected by the Step
      Returns:
      a Step, which selects the following elements of a supplied node that have the required local name and namespace URI.
    • following

      public static Step<XdmNode> following(Predicate<? super XdmNode> filter)
      Obtain a Step that filters the nodes found on the following axis using a supplied Predicate. The function call followingSibling(predicate) is equivalent to FOLLOWING_SIBLING.where(predicate). For example, followingSibling(isElement()) returns a Step that selects the following sibling elements of a given node, while followingSibling(exists(attribute("id"))) selects those that have an attribute named "id". These are returned in document order.
      Parameters:
      filter - the predicate to be applied
      Returns:
      a Step that filters the nodes found on the following axis using a supplied Predicate.
    • followingSibling

      public static Step<XdmNode> followingSibling()
      Obtain a Step to navigate from a node to its following siblings, which are returned in document order
      Returns:
      a Step that selects all nodes on the following-sibling axis
    • followingSibling

      public static Step<XdmNode> followingSibling(String localName)
      Obtain a Step that navigates from a node to the following sibling elements having a specified local name, irrespective of the namespace. These are returned in document order.
      Parameters:
      localName - the local name of the following sibling elements to be selected by the Step, or "*" to select all following siblings that are element nodes
      Returns:
      a Step, which selects the following sibling elements of a supplied node that have the required local name.
    • followingSibling

      public static Step<XdmNode> followingSibling(String uri, String localName)
      Obtain a Step that navigates from a node to the following sibling elements having a specified namespace URI and local name. These are returned in document order.
      Parameters:
      uri - the namespace URI of the following sibling elements to be selected by the Step: supply a zero-length string to indicate the null namespace
      localName - the local name of the following sibling elements to be selected by the Step
      Returns:
      a Step, which selects the following sibling elements of a supplied node that have the required local name and namespace URI.
    • followingSibling

      public static Step<XdmNode> followingSibling(Predicate<? super XdmNode> filter)
      Obtain a Step that filters the nodes found on the following sibling axis using a supplied Predicate. The function call followingSibling(predicate) is equivalent to FOLLOWING_SIBLING.where(predicate). For example, followingSibling(isElement()) returns a Step that selects the following sibling elements of a given node, while followingSibling(exists(attribute("id"))) selects those that have an attribute named "id". These are returned in document order.
      Parameters:
      filter - the predicate to be applied
      Returns:
      a Step that filters the nodes found on the following sibling axis using a supplied Predicate.
    • namespace

      public static Step<XdmNode> namespace()
      Obtain a Step to navigate from a node to its namespace nodes
      Returns:
      a Step that selects all nodes on the namespace axis
    • namespace

      public static Step<XdmNode> namespace(String localName)
      Obtain a Step that navigates from a node to its namespaces having a specified local name. The local name of a namespace node corresponds to the prefix used in the namespace binding.
      Parameters:
      localName - the local name (representing the namespace prefix) of the namespace nodes to be selected by the Step, or "*" to select all namespaces
      Returns:
      a Step, which selects the namespaces of a supplied node that have a given local name (prefix).
    • namespace

      public static Step<XdmNode> namespace(Predicate<? super XdmNode> filter)
      Obtain a Step that filters the nodes found on the namespace axis using a supplied Predicate. The function call namespace(predicate) is equivalent to namespace().where(predicate). For example, namespace(eq("http://www.w3.org/1999/XSL/Transform") selects a namespace node that binds a prefix to the XSLT namespace.
      Parameters:
      filter - the predicate to be applied
      Returns:
      a Step that filters the nodes found on the namespace axis using a supplied Predicate.
    • parent

      public static Step<XdmNode> parent()
      Obtain a Step to navigate from a node to its parent
      Returns:
      a Step that selects all nodes on the parent axis (of which there is at most one)
    • parent

      public static Step<XdmNode> parent(String localName)
      Obtain a Step that navigates from a node to the parent element provided it has a specified local name, irrespective of the namespace
      Parameters:
      localName - the local name of the parent element to be selected by the Step, or "*" to select the parent node provided it is an element
      Returns:
      a Step, which selects the parent of a supplied node provided it is an element with the required local name.
    • parent

      public static Step<XdmNode> parent(String uri, String localName)
      Obtain a Step that navigates from a node to the parent element provided it has a specified namespace URI and local name
      Parameters:
      uri - the namespace URI of the parent element to be selected by the Step: supply a zero-length string to indicate the null namespace
      localName - the local name of the parent element to be selected by the Step
      Returns:
      a Step, which selects the parent element of a supplied node provided it is an element with the required local name and namespace URI.
    • parent

      public static Step<XdmNode> parent(Predicate<? super XdmNode> filter)
      Obtain a Step that filters the node found on the parent axis using a supplied Predicate. The function call parent(predicate) is equivalent to parent().where(predicate). For example, parent(isElement()) returns a Step that selects the parent node provided it is an element
      Parameters:
      filter - the predicate to be applied
      Returns:
      a Step that filters the nodes found on the parent axis using a supplied Predicate.
    • precedingSibling

      public static Step<XdmNode> precedingSibling()
      Obtain a Step to navigate from a node to its preceding siblings, which are returned in reverse document order
      Returns:
      a Step that selects all nodes on the preceding-sibling axis
    • precedingSibling

      public static Step<XdmNode> precedingSibling(String localName)
      Obtain a Step that navigates from a node to the preceding sibling elements having a specified local name, irrespective of the namespace. These are returned in reverse document order.
      Parameters:
      localName - the local name of the preceding sibling elements to be selected by the Step, or "*" to select all descendants that are element nodes
      Returns:
      a Step, which selects the preceding sibling elements of a supplied node that have the required local name.
    • precedingSibling

      public static Step<XdmNode> precedingSibling(String uri, String localName)
      Obtain a Step that navigates from a node to the preceding sibling elements having a specified namespace URI and local name. These are returned in reverse document order.
      Parameters:
      uri - the namespace URI of the preceding sibling elements to be selected by the Step: supply a zero-length string to indicate the null namespace
      localName - the local name of the preceding sibling elements to be selected by the Step
      Returns:
      a Step, which selects the preceding sibling elements of a supplied node that have the required local name and namespace URI.
    • precedingSibling

      public static Step<XdmNode> precedingSibling(Predicate<? super XdmNode> filter)
      Obtain a Step that filters the nodes found on the preceding sibling axis using a supplied Predicate. The function call precedingSibling(predicate) is equivalent to precedingSibling().where(predicate). For example, precedingSibling(isElement()) returns a Step that selects the preceding sibling elements of a given node, while precedingSibling(exists(attribute("id"))) selects those that have an attribute named "id". These are returned in reverse document order.
      Parameters:
      filter - the predicate to be applied
      Returns:
      a Step that filters the nodes found on the following sibling axis using a supplied Predicate.
    • preceding

      public static Step<XdmNode> preceding()
      Obtain a Step to navigate from a node to its preceding nodes (excluding ancestors), which are returned in reverse document order
      Returns:
      a Step that selects all nodes on the preceding axis
    • preceding

      public static Step<XdmNode> preceding(String localName)
      Obtain a Step that navigates from a node to the preceding elements having a specified local name. These are returned in reverse document order.
      Parameters:
      localName - the local name of the preceding elements to be selected by the Step, or "*" to select all descendants that are element nodes
      Returns:
      a Step, which selects the preceding elements of a supplied node that have the required local name.
    • preceding

      public static Step<XdmNode> preceding(String uri, String localName)
      Obtain a Step that navigates from a node to the preceding elements having a specified namespace URI and local name. These are returned in reverse document order.
      Parameters:
      uri - the namespace URI of the preceding elements to be selected by the Step: supply a zero-length string to indicate the null namespace
      localName - the local name of the preceding sibling elements to be selected by the Step
      Returns:
      a Step, which selects the preceding sibling elements of a supplied node that have the required local name and namespace URI.
    • preceding

      public static Step<XdmNode> preceding(Predicate<? super XdmNode> filter)
      Obtain a Step that filters the nodes found on the preceding axis using a supplied Predicate. The function call preceding(predicate) is equivalent to PRECEDING.where(predicate). For example, preceding(isElement()) returns a Step that selects the preceding elements of a given node, while preceding(exists(attribute("id"))) selects those that have an attribute named "id". These are returned in reverse document order.
      Parameters:
      filter - the predicate to be applied
      Returns:
      a Step that filters the nodes found on the following sibling axis using a supplied Predicate.
    • self

      public static Step<XdmNode> self()
      Obtain a Step to navigate from a node to itself (useful only if applying a predicate)
      Returns:
      a Step that selects all nodes on the self axis (that is, the node itself)
    • self

      public static Step<XdmNode> self(String localName)
      Obtain a Step that navigates from a node to itself provided it is an element with a specified local name, irrespective of the namespace
      Parameters:
      localName - the local name of the element to be selected by the Step, or "*" to select the node provided that it is an element node
      Returns:
      a Step, which selects the supplied node provided it has a given local name.
    • self

      public static Step<XdmNode> self(String uri, String localName)
      Obtain a Step that navigates from a node to itself provided it has a specified namespace URI and local name
      Parameters:
      uri - the namespace URI of the element to be selected by the Step: supply a zero-length string to indicate the null namespace
      localName - the local name of the element to be selected by the Step
      Returns:
      a Step, which selects the supplied node provided it is an element with a given local name and namespace URI.
    • self

      public static Step<XdmNode> self(Predicate<? super XdmNode> filter)
      Obtain a Step that filters the node found on the self axis using a supplied Predicate. The function call self(predicate) is equivalent to SELF.where(predicate). For example, self(isElement()) returns a Step that selects the supplied node provided it is an element
      Parameters:
      filter - the predicate to be applied
      Returns:
      a Step that filters the nodes found on the parent axis using a supplied Predicate.
    • text

      public static Step<XdmNode> text()
      Obtain a Step that returns text nodes found on the child axis. The function call text() is equivalent to child().where(isText()). For example, self(isElement()) returns a Step that selects the supplied node provided it is an element
      Returns:
      a Step that returns the text nodes found on the child axis.
    • path

      @SafeVarargs public static Step<? extends XdmNode> path(Step<? extends XdmNode>... steps)
      Construct a path as a composite Step from a sequence of steps composed together
      Parameters:
      steps - the constituent steps in the path
      Returns:
      a composite step
    • path

      public static Step<? extends XdmNode> path(String... steps)
      Construct a simple path consisting solely of simple child, attribute, descendant, root, and parent steps. For example, path("div3", "head", "@style") selects the same nodes as the XPath 2.0 expression child::*:div3/child::*:head/attribute::*:style.
      Parameters:
      steps - a sequence of strings. Each string must be one of the following:
      • A plain NCName (for example "item") selects child nodes by matching local-name (the namespace is ignored)
      • An NCName preceded by "@" (for example, "@code"), selects attribute nodes by matching local-name (again, ignoring any namespace)
      • The string "*" selects all child elements, regardless of name
      • The string "/" selects the root node of the tree, provided it is a document node
      • The string ".." selects the parent node
      • The string "//" selects all descendant-or-self nodes (note, this does not involve finding the root of the tree: it corresponds to a binary '//' operator in XPath, not to an initial '//')
      .

      For more complex paths, see path(Step...)

      Returns:
      a composite Step representing this sequence of steps
      Throws:
      IllegalArgumentException - if any of the strings is invalid according to these rules.
    • tokenize

      public static Step<XdmAtomicValue> tokenize()
      Obtain a Step whose effect is to tokenize the supplied item on whitespace boundaries, returning a sequence of strings as XdmAtomicValue instances.

      Note: the tokenize step, when applied to a string with leading and trailing whitespace, has the effect of removing this whitespace. In addition to its primary role, the function can therefore be useful for trimming the content of a single string.

      Usage example: child().where(some(attribute("id").then(tokenize())).eq("a123")) selects child elements that have an attribute named "id" whose value contains the token "a123".

      Returns:
      a Step whose effect is to take a supplied item and split its string value into a sequence of xs:string instances
    • id

      public static Step<XdmNode> id(XdmNode doc)
      Obtain a Step whose effect is to interpret the supplied item as an xs:ID value and return the nodes (in a given document) that have that string as their ID.
      Parameters:
      doc - the root node (document node) of the document within which the ID value should be sought
      Returns:
      a Step whose effect is to take a supplied item and split its string value into a sequence of xs:string instances