protected static class XmlNodePrinter.NamespaceContext
extends Object
Tracks namespace declarations already emitted while printing a subtree.
| Constructor and description |
|---|
NamespaceContext()Creates an empty namespace context. |
NamespaceContext(NamespaceContext context)Creates a namespace context initialized from an existing context. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public String |
getNamespace(String prefix)Returns the namespace URI currently registered for the supplied prefix. |
|
public boolean |
isPrefixRegistered(String prefix, String uri)Checks whether a prefix is already registered for the supplied namespace URI. |
|
public void |
registerNamespacePrefix(String prefix, String uri)Records a namespace prefix mapping if it has not already been registered. |
Creates an empty namespace context.
Creates a namespace context initialized from an existing context.
context - the context to copyReturns the namespace URI currently registered for the supplied prefix.
prefix - the namespace prefix to resolvenull if none is registeredChecks whether a prefix is already registered for the supplied namespace URI.
prefix - the namespace prefix to look upuri - the namespace URI to compare againsttrue if the prefix is already registered for that URICopyright © 2003-2026 The Apache Software Foundation. All rights reserved.