public class NamespaceContextImpl extends Object implements NamespaceContext
| Modifier and Type | Field and Description |
|---|---|
protected Element |
element |
protected Map<String,Set<String>> |
nsUriToPrefixesMap |
protected Map<String,String> |
prefixToNsUriMap |
| Constructor and Description |
|---|
NamespaceContextImpl()
Create an empty namespace context.
|
NamespaceContextImpl(Element element)
Create a namespace context that will lookup namespace
information in the given element.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNamespace(String prefix,
String namespaceURI)
Add a custom mapping from prefix to a namespace.
|
String |
getNamespaceURI(String prefix) |
String |
getPrefix(String namespaceURI) |
Iterator |
getPrefixes(String namespaceURI) |
protected Element element
public NamespaceContextImpl()
public NamespaceContextImpl(Element element)
element - Element in which to look up namespace information.public void addNamespace(String prefix, String namespaceURI)
prefix - the namespace's prefix. Use an empty string for the
default prefix.namespaceURI - the namespace URI to map.public String getNamespaceURI(String prefix)
getNamespaceURI in interface NamespaceContextpublic String getPrefix(String namespaceURI)
getPrefix in interface NamespaceContextpublic Iterator getPrefixes(String namespaceURI)
getPrefixes in interface NamespaceContextCopyright © 2014. All Rights Reserved.