public final class XmlSchemaNamespaceContext extends Object implements NamespacePrefixList
NamespaceContext.
Implemented as a series of scope-based stacks, one per prefix.
| Constructor and Description |
|---|
XmlSchemaNamespaceContext()
Constructs a new
XmlSchemaNamespaceContext with the
following initial mappings:
xml -> http://www.w3.org/1999/namespace
xmlns -> http://www.w3.org/2000/xmlns/
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNamespace(String prefix,
String namespaceUri)
Adds a new prefix mapping to the context.
|
void |
clear()
Clears the given namespace stack, restoring it to the original mappings
defined by the constructor.
|
String[] |
getDeclaredPrefixes() |
String |
getNamespaceURI(String prefix) |
String |
getPrefix(String namespaceUri) |
Iterator |
getPrefixes(String namespaceUri) |
void |
removeNamespace(String prefix)
Removes the most recent prefix-to-namespace mapping for the provided
prefix.
|
public XmlSchemaNamespaceContext()
XmlSchemaNamespaceContext with the
following initial mappings:
xml -> http://www.w3.org/1999/namespacexmlns -> http://www.w3.org/2000/xmlns/public String getNamespaceURI(String prefix)
getNamespaceURI in interface NamespaceContextNamespaceContext.getNamespaceURI(String)public String getPrefix(String namespaceUri)
getPrefix in interface NamespaceContextNamespaceContext.getPrefix(String)public Iterator getPrefixes(String namespaceUri)
getPrefixes in interface NamespaceContextNamespaceContext.getPrefixes(String)public String[] getDeclaredPrefixes()
getDeclaredPrefixes in interface NamespacePrefixListNamespacePrefixList.getDeclaredPrefixes()public void addNamespace(String prefix, String namespaceUri)
prefix - The prefix to represent the namespace URI.namespaceUri - the namespace URI represented by the prefix.IllegalArgumentException - if the prefix is null, or if the
namespace URI is null or empty.public void removeNamespace(String prefix)
prefix - The prefix to remove the current prefix-to-namespace
mapping of.IllegalStateException - If there is no current mapping for that
prefix.public void clear()
Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.