public class Steps
extends java.lang.Object
Step
interface, used to navigate XDM trees, typically as an argument to XdmValue.select(net.sf.saxon.s9api.streams.Step<T>)
.Constructor and Description |
---|
Steps() |
Modifier and Type | Method and Description |
---|---|
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) |
static Step<XdmNode> |
ancestor(java.util.function.Predicate<? super XdmNode> filter)
Obtain a
Step that filters the nodes found on the ancestor axis using a supplied Predicate . |
static Step<XdmNode> |
ancestor(java.lang.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(java.lang.String uri,
java.lang.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> |
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) |
static Step<XdmNode> |
ancestorOrSelf(java.util.function.Predicate<? super XdmNode> filter)
Obtain a
Step that filters the nodes found on the ancestor-or-self axis using a supplied Predicate . |
static Step<XdmNode> |
ancestorOrSelf(java.lang.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> |
ancestorOrSelf(java.lang.String uri,
java.lang.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<XdmAtomicValue> |
atomize()
Obtain a
Step that atomizes an item to produce a stream of atomic values. |
static Step<XdmNode> |
attribute()
Obtain a
Step to navigate from a node to its attributes |
static Step<XdmNode> |
attribute(java.util.function.Predicate<? super XdmNode> filter)
Obtain a
Step that filters the nodes found on the attribute axis using a supplied Predicate . |
static Step<XdmNode> |
attribute(java.lang.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(java.lang.String uri,
java.lang.String localName)
Return a
Step that navigates from a node to its attribute having a specified
namespace URI and local name |
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
|
static Step<XdmNode> |
child()
Obtain a
Step to navigate from a node to its children |
static Step<XdmNode> |
child(java.util.function.Predicate<? super XdmNode> filter)
Obtain a
Step that filters the nodes found on the child axis using a supplied Predicate . |
static Step<XdmNode> |
child(java.lang.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(java.lang.String uri,
java.lang.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> |
descendant()
Obtain a
Step to navigate from a node to its descendants, which are returned in document order |
static Step<XdmNode> |
descendant(java.util.function.Predicate<? super XdmNode> filter)
Obtain a Step that filters the nodes found on the descendant axis using a supplied
Predicate . |
static Step<XdmNode> |
descendant(java.lang.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(java.lang.String uri,
java.lang.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> |
descendantOrSelf()
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> |
descendantOrSelf(java.util.function.Predicate<? super XdmNode> filter)
Obtain a Step that filters the nodes found on the descendant-or-self axis using a supplied
Predicate . |
static Step<XdmNode> |
descendantOrSelf(java.lang.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. |
static Step<XdmNode> |
descendantOrSelf(java.lang.String uri,
java.lang.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> |
following()
Obtain a
Step to navigate from a node to its following nodes
(excluding descendants), which are returned in document order |
static Step<XdmNode> |
following(java.util.function.Predicate<? super XdmNode> filter)
Obtain a Step that filters the nodes found on the following axis using a supplied
Predicate . |
static Step<XdmNode> |
following(java.lang.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(java.lang.String uri,
java.lang.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> |
followingSibling()
Obtain a
Step to navigate from a node to its following siblings, which are returned
in document order |
static Step<XdmNode> |
followingSibling(java.util.function.Predicate<? super XdmNode> filter)
Obtain a Step that filters the nodes found on the following sibling axis using a supplied
Predicate . |
static Step<XdmNode> |
followingSibling(java.lang.String localName)
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(java.lang.String uri,
java.lang.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> |
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> |
namespace()
Obtain a
Step to navigate from a node to its namespace nodes |
static Step<XdmNode> |
namespace(java.util.function.Predicate<? super XdmNode> filter)
Obtain a
Step that filters the nodes found on the namespace axis using a supplied Predicate . |
static Step<XdmNode> |
namespace(java.lang.String localName)
Obtain a
Step that navigates from a node to its namespaces having a specified
local name. |
static <U extends XdmItem> |
nothing()
Obtain a Step that always returns an empty sequence, whatever the input
|
static Step<XdmNode> |
parent()
Obtain a
Step to navigate from a node to its parent |
static Step<XdmNode> |
parent(java.util.function.Predicate<? super XdmNode> filter)
Obtain a
Step that filters the node found on the parent axis using a supplied Predicate . |
static Step<XdmNode> |
parent(java.lang.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(java.lang.String uri,
java.lang.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<? extends XdmNode> |
path(Step<? extends XdmNode>... steps)
Construct a path as a composite
Step from a sequence of steps composed together |
static Step<? extends XdmNode> |
path(java.lang.String... steps)
Construct a simple path consisting solely of simple child, attribute, descendant, root,
and parent steps.
|
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 |
static Step<XdmNode> |
preceding(java.util.function.Predicate<? super XdmNode> filter)
Obtain a Step that filters the nodes found on the preceding axis using a supplied
Predicate . |
static Step<XdmNode> |
preceding(java.lang.String localName)
Obtain a
Step that navigates from a node to the preceding elements having a specified
local name. |
static Step<XdmNode> |
preceding(java.lang.String uri,
java.lang.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> |
precedingSibling()
Obtain a
Step to navigate from a node to its preceding siblings, which are returned
in reverse document order |
static Step<XdmNode> |
precedingSibling(java.util.function.Predicate<? super XdmNode> filter)
Obtain a Step that filters the nodes found on the preceding sibling axis using a supplied
Predicate . |
static Step<XdmNode> |
precedingSibling(java.lang.String localName)
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(java.lang.String uri,
java.lang.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> |
root()
Obtain a
Step that selects the root node of the containing document (which may or may not
be a document node) |
static Step<XdmNode> |
self()
Obtain a
Step to navigate from a node to itself (useful only if applying a predicate) |
static Step<XdmNode> |
self(java.util.function.Predicate<? super XdmNode> filter)
Obtain a
Step that filters the node found on the self axis using a supplied Predicate . |
static Step<XdmNode> |
self(java.lang.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(java.lang.String uri,
java.lang.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> |
text()
Obtain a
Step that returns text nodes found on the child axis. |
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. |
public static Step<XdmNode> root()
Step
that selects the root node of the containing document (which may or may not
be a document node)public static Step<XdmAtomicValue> atomize()
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)public static Step<XdmAtomicValue> castAs(ItemType type)
public static <U extends XdmItem> Step<U> nothing()
public static Step<XdmNode> ancestor()
Step
to navigate from a node to its ancestors, in reverse document
order (that is, nearest ancestor first, root node last)public static Step<XdmNode> ancestor(java.lang.String localName)
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)localName
- the local name of the ancestors to be selected by the Step
,
or "*" to select all ancestors that are element nodesStep
, which selects the ancestors of a supplied node that have the
required local name.public static Step<XdmNode> ancestor(java.lang.String uri, java.lang.String localName)
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)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 namespaceStep
, which selects the ancestors (at most one) of a supplied node that have the
required local name and namespace URI.public static Step<XdmNode> ancestor(java.util.function.Predicate<? super XdmNode> filter)
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)
.
filter
- the predicate to be appliedStep
that filters the nodes found on the ancestor axis using a supplied Predicate
.public static Step<XdmNode> ancestorOrSelf()
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)public static Step<XdmNode> ancestorOrSelf(java.lang.String localName)
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 itselflocalName
- the local name of the ancestors to be selected by the Step
,
or "*" to select all ancestor-or-self nodes that are element nodesStep
, which selects the ancestors-or-self of a supplied node that have the
required local name.public static Step<XdmNode> ancestorOrSelf(java.lang.String uri, java.lang.String localName)
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)uri
- the namespace URI of the ancestors to be selected by the Step
:
supply a zero-length string to indicate the null namespacelocalName
- the local name of the ancestors to be selected by the Step
Step
, which selects the ancestors-or-self of a supplied node that have the
required local name and namespace URI.public static Step<XdmNode> ancestorOrSelf(java.util.function.Predicate<? super XdmNode> filter)
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)
.
filter
- the predicate to be appliedStep
that filters the nodes found on the ancestor-or-self axis using a supplied Predicate
.public static Step<XdmNode> attribute()
Step
to navigate from a node to its attributespublic static Step<XdmNode> attribute(java.lang.String localName)
Step
that navigates from a node to its attributes having a specified
local name, irrespective of the namespacelocalName
- the local name of the attributes to be selected by the Step
, or
"*" to select all attributesStep
, which selects the attributes of a supplied node that have the
required local name.public static Step<XdmNode> attribute(java.lang.String uri, java.lang.String localName)
Step
that navigates from a node to its attribute having a specified
namespace URI and local nameuri
- the namespace URI of the attributes to be selected by the Step
:
supply a zero-length string to indicate the null namespacelocalName
- the local name of the attributes to be selected by the Step
Step
, which selects the attributes (at most one) of a supplied node that have the
required local name and namespace URI.public static Step<XdmNode> attribute(java.util.function.Predicate<? super XdmNode> filter)
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)
.filter
- the predicate to be appliedStep
that filters the nodes found on the attribute axis using a supplied Predicate
.public static Step<XdmNode> child()
Step
to navigate from a node to its childrenpublic static Step<XdmNode> child(java.lang.String localName)
Step
that navigates from a node to the element children having a specified
local name, irrespective of the namespacelocalName
- the local name of the child elements to be selected by the Step,
or "*" to select all children that are element nodesStep
, which selects the element children of a supplied node that have the
required local name.public static Step<XdmNode> child(java.lang.String uri, java.lang.String localName)
Step
that navigates from a node to the element children having a specified
namespace URI and local nameuri
- the namespace URI of the child elements to be selected by the Step
:
supply a zero-length string to indicate the null namespacelocalName
- the local name of the child elements to be selected by the Step
Step
, which selects the element children of a supplied node that have the
required local name and namespace URI.public static Step<XdmNode> child(java.util.function.Predicate<? super XdmNode> filter)
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.filter
- the predicate to be appliedPredicate
.public static Step<XdmNode> descendant()
Step
to navigate from a node to its descendants, which are returned in document orderpublic static Step<XdmNode> descendant(java.lang.String localName)
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.localName
- the local name of the descendant elements to be selected by the Step
,
or "*" to select all descendants that are element nodesStep
, which selects the element descendants of a supplied node that have the
required local name.public static Step<XdmNode> descendant(java.lang.String uri, java.lang.String localName)
Step
that navigates from a node to the element descendants having a specified
namespace URI and local name. These are returned in document order.uri
- the namespace URI of the descendant elements to be selected by the Step
:
supply a zero-length string to indicate the null namespacelocalName
- the local name of the descendant elements to be selected by the Step
Step
, which selects the element descendants of a supplied node that have the
required local name and namespace URI.public static Step<XdmNode> descendantOrSelf()
Step
to navigate from a node to its descendants, which are returned in document order,
preceded by the origin node itselfpublic static Step<XdmNode> descendant(java.util.function.Predicate<? super XdmNode> filter)
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.filter
- the predicate to be appliedpublic static Step<XdmNode> descendantOrSelf(java.lang.String localName)
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.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 nodesStep
, which selects the element children of a supplied node that have the
required local name.public static Step<XdmNode> descendantOrSelf(java.lang.String uri, java.lang.String localName)
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.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 namespacelocalName
- the local name of the descendant-or-self elements to be selected by the Step
Step
, which selects the element descendants-or-self of a supplied node that have a
given local name and namespace URI.public static Step<XdmNode> descendantOrSelf(java.util.function.Predicate<? super XdmNode> filter)
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.filter
- the predicate to be appliedpublic static Step<XdmNode> following()
Step
to navigate from a node to its following nodes
(excluding descendants), which are returned in document orderpublic static Step<XdmNode> following(java.lang.String localName)
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.localName
- the local name of the following elements to be selected by the Step
,
or "*" to select all following nodes that are elementsStep
, which selects the following elements of a supplied node that have the
required local name.public static Step<XdmNode> following(java.lang.String uri, java.lang.String localName)
Step
that navigates from a node to the following elements having a specified
namespace URI and local name. These are returned in document order.uri
- the namespace URI of the following elements to be selected by the Step
:
supply a zero-length string to indicate the null namespacelocalName
- the local name of the following elements to be selected by the Step
Step
, which selects the following elements of a supplied node that have the
required local name and namespace URI.public static Step<XdmNode> following(java.util.function.Predicate<? super XdmNode> filter)
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.filter
- the predicate to be appliedStep
that filters the nodes found on the following axis using a supplied Predicate
.public static Step<XdmNode> followingSibling()
Step
to navigate from a node to its following siblings, which are returned
in document orderpublic static Step<XdmNode> followingSibling(java.lang.String localName)
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.localName
- the local name of the following sibling elements to be selected by the Step
,
or "*" to select all following siblings that are element nodesStep
, which selects the following sibling elements of a supplied node that have the
required local name.public static Step<XdmNode> followingSibling(java.lang.String uri, java.lang.String localName)
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.uri
- the namespace URI of the following sibling elements to be selected by the Step
:
supply a zero-length string to indicate the null namespacelocalName
- the local name of the following sibling elements to be selected by the Step
Step
, which selects the following sibling elements of a supplied node that have the
required local name and namespace URI.public static Step<XdmNode> followingSibling(java.util.function.Predicate<? super XdmNode> filter)
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.filter
- the predicate to be appliedStep
that filters the nodes found on the following sibling axis using a supplied Predicate
.public static Step<XdmNode> namespace()
Step
to navigate from a node to its namespace nodespublic static Step<XdmNode> namespace(java.lang.String localName)
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.localName
- the local name (representing the namespace prefix) of the namespace nodes
to be selected by the Step
, or "*" to select all namespacesStep
, which selects the namespaces of a supplied node that have a
given local name (prefix).public static Step<XdmNode> namespace(java.util.function.Predicate<? super XdmNode> filter)
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.filter
- the predicate to be appliedStep
that filters the nodes found on the namespace axis using a supplied
Predicate
.public static Step<XdmNode> parent()
Step
to navigate from a node to its parentpublic static Step<XdmNode> parent(java.lang.String localName)
Step
that navigates from a node to the parent element provided it has a specified
local name, irrespective of the namespacelocalName
- the local name of the parent element to be selected by the Step,
or "*" to select the parent node provided it is an elementStep
, which selects the parent of a supplied node provided it is an element with the
required local name.public static Step<XdmNode> parent(java.lang.String uri, java.lang.String localName)
Step
that navigates from a node to the parent element provided it has a specified
namespace URI and local nameuri
- the namespace URI of the parent element to be selected by the Step
:
supply a zero-length string to indicate the null namespacelocalName
- the local name of the parent element to be selected by the Step
Step
, which selects the parent element of a supplied node provided it is an
element with the required local name and namespace URI.public static Step<XdmNode> parent(java.util.function.Predicate<? super XdmNode> filter)
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 elementfilter
- the predicate to be appliedPredicate
.public static Step<XdmNode> precedingSibling()
Step
to navigate from a node to its preceding siblings, which are returned
in reverse document orderpublic static Step<XdmNode> precedingSibling(java.lang.String localName)
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.localName
- the local name of the preceding sibling elements to be selected by the Step
,
or "*" to select all descendants that are element nodesStep
, which selects the preceding sibling elements of a supplied node that have the
required local name.public static Step<XdmNode> precedingSibling(java.lang.String uri, java.lang.String localName)
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.uri
- the namespace URI of the preceding sibling elements to be selected by the Step
:
supply a zero-length string to indicate the null namespacelocalName
- the local name of the preceding sibling elements to be selected by the Step
Step
, which selects the preceding sibling elements of a supplied node that have the
required local name and namespace URI.public static Step<XdmNode> precedingSibling(java.util.function.Predicate<? super XdmNode> filter)
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.filter
- the predicate to be appliedStep
that filters the nodes found on the following sibling axis using a supplied Predicate
.public static Step<XdmNode> preceding()
Step
to navigate from a node to its preceding nodes (excluding ancestors),
which are returned in reverse document orderpublic static Step<XdmNode> preceding(java.lang.String localName)
Step
that navigates from a node to the preceding elements having a specified
local name. These are returned in reverse document order.localName
- the local name of the preceding elements to be selected by the Step
,
or "*" to select all descendants that are element nodesStep
, which selects the preceding elements of a supplied node that have the
required local name.public static Step<XdmNode> preceding(java.lang.String uri, java.lang.String localName)
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.uri
- the namespace URI of the preceding elements to be selected by the Step
:
supply a zero-length string to indicate the null namespacelocalName
- the local name of the preceding sibling elements to be selected by the Step
Step
, which selects the preceding sibling elements of a supplied node that have the
required local name and namespace URI.public static Step<XdmNode> preceding(java.util.function.Predicate<? super XdmNode> filter)
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.filter
- the predicate to be appliedStep
that filters the nodes found on the following sibling axis using a supplied Predicate
.public static Step<XdmNode> self()
Step
to navigate from a node to itself (useful only if applying a predicate)public static Step<XdmNode> self(java.lang.String localName)
Step
that navigates from a node to itself provided it is an element with a specified
local name, irrespective of the namespacelocalName
- the local name of the element to be selected by the Step,
or "*" to select the node provided that it is an element nodeStep
, which selects the supplied node provided it has a
given local name.public static Step<XdmNode> self(java.lang.String uri, java.lang.String localName)
Step
that navigates from a node to itself provided it has a specified
namespace URI and local nameuri
- the namespace URI of the element to be selected by the Step
:
supply a zero-length string to indicate the null namespacelocalName
- the local name of the element to be selected by the Step
Step
, which selects the supplied node provided it is an element with a
given local name and namespace URI.public static Step<XdmNode> self(java.util.function.Predicate<? super XdmNode> filter)
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 elementfilter
- the predicate to be appliedPredicate
.public static Step<XdmNode> text()
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@SafeVarargs public static Step<? extends XdmNode> path(Step<? extends XdmNode>... steps)
Step
from a sequence of steps composed togethersteps
- the constituent steps in the pathpublic static Step<? extends XdmNode> path(java.lang.String... steps)
path("div3", "head", "@style")
selects
the same nodes as the XPath 2.0 expression child::*:div3/child::*:head/attribute::*:style
.steps
- a sequence of strings. Each string must be one of the following:
For more complex paths, see path(Step...)
java.lang.IllegalArgumentException
- if any of the strings is invalid according
to these rules.public static Step<XdmAtomicValue> tokenize()
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".
public static Step<XdmNode> id(XdmNode doc)
doc
- the root node (document node) of the document within which the ID
value should be soughtCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.