Package net.sf.saxon.s9api.streams
Class Steps
java.lang.Object
net.sf.saxon.s9api.streams.Steps
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 -
Method Summary
Modifier and TypeMethodDescriptionancestor()
Obtain aStep
to navigate from a node to its ancestors, in reverse document order (that is, nearest ancestor first, root node last)Obtain aStep
that navigates from a node to its ancestor elements having a specified local name, irrespective of the namespace.Return aStep
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)Obtain aStep
that filters the nodes found on the ancestor axis using a suppliedPredicate
.Obtain aStep
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)ancestorOrSelf
(String localName) Obtain aStep
that navigates from a node to its ancestor elements having a specified local name, irrespective of the namespace.ancestorOrSelf
(String uri, String localName) Obtain aStep
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)ancestorOrSelf
(Predicate<? super XdmNode> filter) Obtain aStep
that filters the nodes found on the ancestor-or-self axis using a suppliedPredicate
.static Step
<XdmAtomicValue> atomize()
Obtain aStep
that atomizes an item to produce a stream of atomic values.Obtain aStep
to navigate from a node to its attributesObtain aStep
that navigates from a node to its attributes having a specified local name, irrespective of the namespaceReturn aStep
that navigates from a node to its attribute having a specified namespace URI and local nameObtain aStep
that filters the nodes found on the attribute axis using a suppliedPredicate
.static Step
<XdmAtomicValue> 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 typechild()
Obtain aStep
to navigate from a node to its childrenObtain aStep
that navigates from a node to the element children having a specified local name, irrespective of the namespaceObtain aStep
that navigates from a node to the element children having a specified namespace URI and local nameObtain aStep
that filters the nodes found on the child axis using a suppliedPredicate
.Obtain aStep
to navigate from a node to its descendants, which are returned in document orderdescendant
(String localName) Obtain aStep
that navigates from a node to the descendant elements having a specified local name, irrespective of the namespace.descendant
(String uri, String localName) Obtain aStep
that navigates from a node to the element descendants having a specified namespace URI and local name.descendant
(Predicate<? super XdmNode> filter) Obtain a Step that filters the nodes found on the descendant axis using a suppliedPredicate
.Obtain aStep
to navigate from a node to its descendants, which are returned in document order, preceded by the origin node itselfdescendantOrSelf
(String localName) Obtain aStep
that navigates from a node to the descendant-or-self elements having a specified local name, irrespective of the namespace.descendantOrSelf
(String uri, String localName) Obtain aStep
that navigates from a node to the descendant-or-self elements having a specified namespace URI and local name.descendantOrSelf
(Predicate<? super XdmNode> filter) Obtain a Step that filters the nodes found on the descendant-or-self axis using a suppliedPredicate
.Obtain aStep
to navigate from a node to its following nodes (excluding descendants), which are returned in document orderObtain aStep
that navigates from a node to the following elements having a specified local name, irrespective of the namespace.Obtain aStep
that navigates from a node to the following elements having a specified namespace URI and local name.Obtain a Step that filters the nodes found on the following axis using a suppliedPredicate
.Obtain aStep
to navigate from a node to its following siblings, which are returned in document orderfollowingSibling
(String localName) Obtain aStep
that navigates from a node to the following sibling elements having a specified local name, irrespective of the namespace.followingSibling
(String uri, String localName) Obtain aStep
that navigates from a node to the following sibling elements having a specified namespace URI and local name.followingSibling
(Predicate<? super XdmNode> filter) Obtain a Step that filters the nodes found on the following sibling axis using a suppliedPredicate
.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.Obtain aStep
to navigate from a node to its namespace nodesObtain aStep
that navigates from a node to its namespaces having a specified local name.Obtain aStep
that filters the nodes found on the namespace axis using a suppliedPredicate
.nothing()
Obtain a Step that always returns an empty sequence, whatever the inputparent()
Obtain aStep
to navigate from a node to its parentObtain aStep
that navigates from a node to the parent element provided it has a specified local name, irrespective of the namespaceObtain aStep
that navigates from a node to the parent element provided it has a specified namespace URI and local nameObtain aStep
that filters the node found on the parent axis using a suppliedPredicate
.Construct a simple path consisting solely of simple child, attribute, descendant, root, and parent steps.Construct a path as a compositeStep
from a sequence of steps composed togetherObtain aStep
to navigate from a node to its preceding nodes (excluding ancestors), which are returned in reverse document orderObtain aStep
that navigates from a node to the preceding elements having a specified local name.Obtain aStep
that navigates from a node to the preceding elements having a specified namespace URI and local name.Obtain a Step that filters the nodes found on the preceding axis using a suppliedPredicate
.Obtain aStep
to navigate from a node to its preceding siblings, which are returned in reverse document orderprecedingSibling
(String localName) Obtain aStep
that navigates from a node to the preceding sibling elements having a specified local name, irrespective of the namespace.precedingSibling
(String uri, String localName) Obtain aStep
that navigates from a node to the preceding sibling elements having a specified namespace URI and local name.precedingSibling
(Predicate<? super XdmNode> filter) Obtain a Step that filters the nodes found on the preceding sibling axis using a suppliedPredicate
.root()
Obtain aStep
that selects the root node of the containing document (which may or may not be a document node)self()
Obtain aStep
to navigate from a node to itself (useful only if applying a predicate)Obtain aStep
that navigates from a node to itself provided it is an element with a specified local name, irrespective of the namespaceObtain aStep
that navigates from a node to itself provided it has a specified namespace URI and local nameObtain aStep
that filters the node found on the self axis using a suppliedPredicate
.text()
Obtain aStep
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 asXdmAtomicValue
instances.
-
Constructor Details
-
Steps
public Steps()
-
-
Method Details
-
root
Obtain aStep
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
Obtain aStep
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
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
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
Obtain aStep
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
Obtain aStep
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 theStep
, 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
Return aStep
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 theStep
localName
- the local name of the ancestors to be selected by theStep
: 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
Obtain aStep
that filters the nodes found on the ancestor axis using a suppliedPredicate
. Nodes are returned in reverse document order (that is, nearest ancestor first, root node last)The function call
ancestor(predicate)
is equivalent toANCESTOR.where(predicate)
.- Parameters:
filter
- the predicate to be applied- Returns:
- a
Step
that filters the nodes found on the ancestor axis using a suppliedPredicate
.
-
ancestorOrSelf
Obtain aStep
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
Obtain aStep
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 theStep
, 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
Obtain aStep
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 theStep
: supply a zero-length string to indicate the null namespacelocalName
- the local name of the ancestors to be selected by theStep
- Returns:
- a
Step
, which selects the ancestors-or-self of a supplied node that have the required local name and namespace URI.
-
ancestorOrSelf
Obtain aStep
that filters the nodes found on the ancestor-or-self axis using a suppliedPredicate
. Nodes are returned in reverse document order (that is, origin node first, root node last)The function call
ancestorOrSelf(predicate)
is equivalent toANCESTOR_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 suppliedPredicate
.
-
attribute
Obtain aStep
to navigate from a node to its attributes- Returns:
- a Step that selects all nodes on the ancestor axis
-
attribute
Obtain aStep
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 theStep
, or "*" to select all attributes- Returns:
- a
Step
, which selects the attributes of a supplied node that have the required local name.
-
attribute
Return aStep
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 theStep
: supply a zero-length string to indicate the null namespacelocalName
- the local name of the attributes to be selected by theStep
- Returns:
- a
Step
, which selects the attributes (at most one) of a supplied node that have the required local name and namespace URI.
-
attribute
Obtain aStep
that filters the nodes found on the attribute axis using a suppliedPredicate
. The function callattribute(predicate)
is equivalent toATTRIBUTE.where(predicate)
.- Parameters:
filter
- the predicate to be applied- Returns:
- a
Step
that filters the nodes found on the attribute axis using a suppliedPredicate
.
-
child
Obtain aStep
to navigate from a node to its children- Returns:
- a Step that selects all nodes on the child axis
-
child
Obtain aStep
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
Obtain aStep
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 theStep
: supply a zero-length string to indicate the null namespacelocalName
- the local name of the child elements to be selected by theStep
- Returns:
- a
Step
, which selects the element children of a supplied node that have the required local name and namespace URI.
-
child
Obtain aStep
that filters the nodes found on the child axis using a suppliedPredicate
. The function callchild(predicate)
is equivalent toCHILD.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
Obtain aStep
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
Obtain aStep
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 theStep
, 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
Obtain aStep
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 theStep
: supply a zero-length string to indicate the null namespacelocalName
- the local name of the descendant elements to be selected by theStep
- Returns:
- a
Step
, which selects the element descendants of a supplied node that have the required local name and namespace URI.
-
descendantOrSelf
Obtain aStep
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
Obtain a Step that filters the nodes found on the descendant axis using a suppliedPredicate
. The function calldescendant(predicate)
is equivalent toDESCENDANT.where(predicate)
. For example,descendant(isElement())
returns a Step that selects the element node descendants of a given node, whiledescendant(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
Obtain aStep
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 theStep
, 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
Obtain aStep
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 theStep
: supply a zero-length string to indicate the null namespacelocalName
- the local name of the descendant-or-self elements to be selected by theStep
- Returns:
- a
Step
, which selects the element descendants-or-self of a supplied node that have a given local name and namespace URI.
-
descendantOrSelf
Obtain a Step that filters the nodes found on the descendant-or-self axis using a suppliedPredicate
. The function calldescendant(predicate)
is equivalent toDESCENDANT.where(predicate)
. For example,descendant(isElement())
returns a Step that selects the element node descendants of a given node, whiledescendant(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
Obtain aStep
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
Obtain aStep
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 theStep
, 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
Obtain aStep
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 theStep
: supply a zero-length string to indicate the null namespacelocalName
- the local name of the following elements to be selected by theStep
- Returns:
- a
Step
, which selects the following elements of a supplied node that have the required local name and namespace URI.
-
following
Obtain a Step that filters the nodes found on the following axis using a suppliedPredicate
. The function callfollowingSibling(predicate)
is equivalent toFOLLOWING_SIBLING.where(predicate)
. For example,followingSibling(isElement())
returns aStep
that selects the following sibling elements of a given node, whilefollowingSibling(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 suppliedPredicate
.
-
followingSibling
Obtain aStep
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
Obtain aStep
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 theStep
, 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
Obtain aStep
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 theStep
: supply a zero-length string to indicate the null namespacelocalName
- the local name of the following sibling elements to be selected by theStep
- Returns:
- a
Step
, which selects the following sibling elements of a supplied node that have the required local name and namespace URI.
-
followingSibling
Obtain a Step that filters the nodes found on the following sibling axis using a suppliedPredicate
. The function callfollowingSibling(predicate)
is equivalent toFOLLOWING_SIBLING.where(predicate)
. For example,followingSibling(isElement())
returns aStep
that selects the following sibling elements of a given node, whilefollowingSibling(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 suppliedPredicate
.
-
namespace
Obtain aStep
to navigate from a node to its namespace nodes- Returns:
- a Step that selects all nodes on the namespace axis
-
namespace
Obtain aStep
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 theStep
, or "*" to select all namespaces- Returns:
- a
Step
, which selects the namespaces of a supplied node that have a given local name (prefix).
-
namespace
Obtain aStep
that filters the nodes found on the namespace axis using a suppliedPredicate
. The function callnamespace(predicate)
is equivalent tonamespace().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 suppliedPredicate
.
-
parent
Obtain aStep
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
Obtain aStep
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
Obtain aStep
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 theStep
: supply a zero-length string to indicate the null namespacelocalName
- the local name of the parent element to be selected by theStep
- 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
Obtain aStep
that filters the node found on the parent axis using a suppliedPredicate
. The function callparent(predicate)
is equivalent toparent().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
Obtain aStep
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
Obtain aStep
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 theStep
, 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
Obtain aStep
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 theStep
: supply a zero-length string to indicate the null namespacelocalName
- the local name of the preceding sibling elements to be selected by theStep
- Returns:
- a
Step
, which selects the preceding sibling elements of a supplied node that have the required local name and namespace URI.
-
precedingSibling
Obtain a Step that filters the nodes found on the preceding sibling axis using a suppliedPredicate
. The function callprecedingSibling(predicate)
is equivalent toprecedingSibling().where(predicate)
. For example,precedingSibling(isElement())
returns aStep
that selects the preceding sibling elements of a given node, whileprecedingSibling(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 suppliedPredicate
.
-
preceding
Obtain aStep
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
Obtain aStep
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 theStep
, 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
Obtain aStep
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 theStep
: supply a zero-length string to indicate the null namespacelocalName
- the local name of the preceding sibling elements to be selected by theStep
- Returns:
- a
Step
, which selects the preceding sibling elements of a supplied node that have the required local name and namespace URI.
-
preceding
Obtain a Step that filters the nodes found on the preceding axis using a suppliedPredicate
. The function callpreceding(predicate)
is equivalent toPRECEDING.where(predicate)
. For example,preceding(isElement())
returns aStep
that selects the preceding elements of a given node, whilepreceding(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 suppliedPredicate
.
-
self
Obtain aStep
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
Obtain aStep
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
Obtain aStep
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 theStep
: supply a zero-length string to indicate the null namespacelocalName
- the local name of the element to be selected by theStep
- Returns:
- a
Step
, which selects the supplied node provided it is an element with a given local name and namespace URI.
-
self
Obtain aStep
that filters the node found on the self axis using a suppliedPredicate
. The function callself(predicate)
is equivalent toSELF.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
Obtain aStep
that returns text nodes found on the child axis. The function calltext()
is equivalent tochild().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
Construct a path as a compositeStep
from a sequence of steps composed together- Parameters:
steps
- the constituent steps in the path- Returns:
- a composite step
-
path
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 expressionchild::*: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
Obtain a Step whose effect is to tokenize the supplied item on whitespace boundaries, returning a sequence of strings asXdmAtomicValue
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
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
-