net.sf.saxon.evpull
public class NamespaceMaintainer extends java.lang.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 and Description |
---|
NamespaceMaintainer(EventIterator base,
NamePool namePool)
Create a namespace context for a pull-events pipeline
|
Modifier and Type | Method and Description |
---|---|
protected short |
getURICode(short prefixCode)
Get the URI code corresponding to a given prefix code, by searching the
in-scope namespaces.
|
java.lang.String |
getURIForPrefix(java.lang.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
|
java.util.Iterator |
iteratePrefixes()
Get an iterator over all the prefixes declared in this namespace context.
|
PullEvent |
next()
Get the next event in the sequence
|
public NamespaceMaintainer(EventIterator base, NamePool namePool)
base
- the previous stage in the pipeline, from which events are readnamePool
- the NamePoolpublic boolean isFlatSequence()
isFlatSequence
in interface EventIterator
public PullEvent next() throws XPathException
next
in interface EventIterator
XPathException
- if a dynamic evaluation error occursprotected short getURICode(short prefixCode)
prefixCode
- the 16-bit prefix code requiredpublic java.lang.String getURIForPrefix(java.lang.String prefix, boolean useDefault)
getURIForPrefix
in interface NamespaceResolver
prefix
- the namespace prefixuseDefault
- true if the default namespace is to be used when the
prefix is ""public java.util.Iterator iteratePrefixes()
iteratePrefixes
in interface NamespaceResolver