public final class SavedNamespaceContext extends Object implements NamespaceResolver
Constructor and Description |
---|
SavedNamespaceContext(Iterable<NamespaceBinding> nsBindings)
Create a NamespaceContext object
|
SavedNamespaceContext(Iterator<NamespaceBinding> nsBindings)
Create a NamespaceContext object
|
SavedNamespaceContext(NamespaceResolver resolver)
Create a SavedNamespaceContext that captures all the information in a given NamespaceResolver
|
Modifier and Type | Method and Description |
---|---|
String |
getURIForPrefix(String prefix,
boolean useDefault)
Get the namespace URI corresponding to a given prefix.
|
Iterator<String> |
iteratePrefixes()
Get an iterator over all the prefixes declared in this namespace context.
|
public SavedNamespaceContext(Iterable<NamespaceBinding> nsBindings)
nsBindings
- an array of namespace bindings. Each namespace code is an integer
in which the first 16 bits represent the prefix (zero if it's the default namespace)
and the next 16 bits represent the uri. These are codes held in the NamePool. The
list will be searched from the "high" end.public SavedNamespaceContext(Iterator<NamespaceBinding> nsBindings)
nsBindings
- an array of namespace bindings. Each namespace code is an integer
in which the first 16 bits represent the prefix (zero if it's the default namespace)
and the next 16 bits represent the uri. These are codes held in the NamePool. The
list will be searched from the "high" end.public SavedNamespaceContext(NamespaceResolver resolver)
resolver
- the NamespaceResolverpublic String getURIForPrefix(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 Iterator<String> iteratePrefixes()
iteratePrefixes
in interface NamespaceResolver
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.