public class NamespaceContextImpl extends Object implements NamespaceContext
NamespaceContext that provides
an addNamespace method.| Constructor and Description |
|---|
NamespaceContextImpl() |
NamespaceContextImpl(Map<String,String> prefix2ns)
Constructor that takes a Map of prefix to namespaces.
|
NamespaceContextImpl(String prefix,
String namespaceURI) |
| Modifier and Type | Method and Description |
|---|---|
void |
addNamespace(String prefix,
String namespaceURI)
Add a prefix to namespace mapping.
|
String |
getNamespaceURI(String prefix) |
String |
getPrefix(String namespaceURI) |
Iterator<String> |
getPrefixes(String namespaceURI) |
public NamespaceContextImpl()
public NamespaceContextImpl(Map<String,String> prefix2ns)
prefix2ns - a mapping of prefixes to namespaces.IllegalArgumentException - if prefix2ns contains "http://www.w3.org/XML/1998/namespace" or
"http://www.w3.org/2000/xmlns/"public String getNamespaceURI(String prefix)
getNamespaceURI in interface NamespaceContextpublic String getPrefix(String namespaceURI)
getPrefix in interface NamespaceContextpublic Iterator<String> getPrefixes(String namespaceURI)
getPrefixes in interface NamespaceContextpublic void addNamespace(String prefix, String namespaceURI)
prefix - namespaceURI - IllegalArgumentException - if namespaceURI is one of "http://www.w3.org/XML/1998/namespace" or
"http://www.w3.org/2000/xmlns/"Copyright © 2010-2013 MediaShelf. All Rights Reserved.