net.sf.saxon.om
Class NamespaceIterator
java.lang.Object
net.sf.saxon.om.NamespaceIterator
- AxisIterator, SequenceIterator, UnfailingIterator
public class NamespaceIterator
extends java.lang.Object
This class provides an implementation of the namespace axis over any implementation
of the data model. It relies on element nodes to implement the method
NodeInfo.getDeclaredNamespaces(int[])
advance
public void advance()
Get the next item in the sequence.
getInScopeNamespaceCodes
public static int[] getInScopeNamespaceCodes(NodeInfo element)
Get a list of in-scope namespace codes. If an array of namespace codes is needed, without
actually constructing the namespace nodes, a caller may create the NamespaceIterator and then
call this method. The result is an array of integers, each containing a prefix code in the top
half and a uri code in the bottom half. Note that calling this method is destructive: the
iterator is consumed and cannot be used again.
element
- the element whose nodes are required
- the list of in scope namespaces
getProperties
public int getProperties()
Get properties of this iterator, as a bit-significant integer.
- getProperties in interface SequenceIterator
getStringValue
public CharSequence getStringValue()
Return the string value of the current node.
- getStringValue in interface AxisIterator
- the string value, as an instance of CharSequence.
iterateAxis
public AxisIterator iterateAxis(byte axis,
NodeTest test)
Return an iterator over an axis, starting at the current node.
- iterateAxis in interface AxisIterator
axis
- the axis to iterate over, using a constant such as
Axis.CHILD
test
- a predicate to apply to the nodes before returning them.
makeIterator
public static AxisIterator makeIterator(NodeInfo element,
NodeTest test)
Factory method to create an iterator over the in-scope namespace nodes
element
- the node whose namespaces are requiredtest
- used to filter the returned nodes
- an iterator over the namespace nodes that satisfy the test
moveNext
public boolean moveNext()
Move to the next node, without returning it. Returns true if there is
a next node, false if the end of the sequence has been reached. After
calling this method, the current node may be retrieved using the
current() function.
- moveNext in interface AxisIterator