net.sf.saxon.evpull
public class NamespaceMaintainer extends Object implements EventIterator, NamespaceResolver
Note that this class merely provides the service of keeping track of which namespaces are currently in scope. It does not attempt to remove duplicate namespace declarations, and it does not perform namespace fixup.
Constructor Summary | |
---|---|
NamespaceMaintainer(EventIterator base, NamePool namePool)
Create a namespace context for a pull-events pipeline |
Method Summary | |
---|---|
protected short | getURICode(short prefixCode)
Get the URI code corresponding to a given prefix code, by searching the
in-scope namespaces. |
String | getURIForPrefix(String prefix, boolean useDefault)
Get the namespace URI corresponding to a given prefix. |
boolean | isFlatSequence()
Determine whether the EventIterator returns a flat sequence of events, or whether it can return
nested event iterators
|
Iterator | iteratePrefixes()
Get an iterator over all the prefixes declared in this namespace context. |
PullEvent | next()
Get the next event in the sequence
|
Parameters: base the previous stage in the pipeline, from which events are read namePool the NamePool
Parameters: prefixCode the 16-bit prefix code required
Returns: the 16-bit URI code, or -1 if the prefix is not found
Parameters: prefix the namespace prefix useDefault true if the default namespace is to be used when the prefix is ""
Returns: the uri for the namespace, or null if the prefix is not in scope
Returns: true if the next() method is guaranteed never to return an EventIterator
Returns: the next event, or null when the sequence is exhausted. Note that since an EventIterator is itself a PullEvent, this method may return a nested iterator.
Throws: net.sf.saxon.trans.XPathException if a dynamic evaluation error occurs