Package net.sf.saxon.tree.util
Class NamespaceIterator
- java.lang.Object
-
- net.sf.saxon.tree.util.NamespaceIterator
-
- All Implemented Interfaces:
java.util.Iterator<NamespaceBinding>
public class NamespaceIterator extends java.lang.Object implements java.util.Iterator<NamespaceBinding>
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(net.sf.saxon.om.NamespaceBinding[])
.The result does not include the XML namespace.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.HashSet<java.lang.String>
undeclaredPrefixes
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
static java.util.Iterator<NamespaceBinding>
iterateNamespaces(NodeInfo element)
Factory method: create an iterator over the in-scope namespace codes for an elementNamespaceBinding
next()
void
remove()
static void
sendNamespaces(NodeInfo element, Receiver receiver)
Send all the in-scope namespaces for a node (except the XML namespace) to a specified receiver
-
-
-
Method Detail
-
iterateNamespaces
public static java.util.Iterator<NamespaceBinding> 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 (except the XML namespace) 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()
- Specified by:
hasNext
in interfacejava.util.Iterator<NamespaceBinding>
-
next
public NamespaceBinding next()
- Specified by:
next
in interfacejava.util.Iterator<NamespaceBinding>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<NamespaceBinding>
-
-