Package net.sf.saxon.om
Class NamespaceCodeIterator
- java.lang.Object
-
- net.sf.saxon.om.NamespaceCodeIterator
-
- All Implemented Interfaces:
IntIterator
public class NamespaceCodeIterator extends java.lang.Object implements IntIterator
This class provides an iterator over the namespace codes representing the in-scope namespaces of any node. It relies on nodes to implement the methodNodeInfo.getDeclaredNamespaces(int[])
.The result does not include the XML namespace.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Test whether there are any more integers in the sequencestatic IntIterator
iterateNamespaces(NodeInfo element)
Factory method: create an iterator over the in-scope namespace codes for an elementint
next()
Return the next integer in the sequence.static void
sendNamespaces(NodeInfo element, Receiver receiver)
Send all the in-scope namespaces for a node to a specified receiver
-
-
-
Method Detail
-
iterateNamespaces
public static IntIterator iterateNamespaces(NodeInfo element)
Factory method: create an iterator over the in-scope namespace codes for an element- Parameters:
element
- the element (or other node) whose in-scope namespaces are required. If this is not an element, the result will be an empty iterator- Returns:
- an iterator over the namespace codes. A namespace code is an integer that represents a prefix-uri binding; the prefix and URI can be obtained by reference to the name pool. This iterator will represent all the in-scope namespaces, without duplicates, and respecting namespace undeclarations. It does not include the XML namespace.
-
sendNamespaces
public static void sendNamespaces(NodeInfo element, Receiver receiver) throws XPathException
Send all the in-scope namespaces for a node to a specified receiver- Parameters:
element
- the element in question (the method does nothing if this is not an element)receiver
- the receiver to which the namespaces are notified- Throws:
XPathException
-
hasNext
public boolean hasNext()
Description copied from interface:IntIterator
Test whether there are any more integers in the sequence- Specified by:
hasNext
in interfaceIntIterator
- Returns:
- true if there are more integers to come
-
next
public int next()
Description copied from interface:IntIterator
Return the next integer in the sequence. The result is undefined unless hasNext() has been called and has returned true.- Specified by:
next
in interfaceIntIterator
- Returns:
- the next integer in the sequence
-
-