org.apache.xerces.xinclude
Class MultipleScopeNamespaceSupport
- org.apache.xerces.xni.NamespaceContext
public class MultipleScopeNamespaceSupport
This implementation of NamespaceContext has the ability to maintain multiple
scopes of namespace/prefix bindings. This is useful in situations when it is
not always appropriate for elements to inherit the namespace bindings of their
ancestors (such as included elements in XInclude).
When searching for a URI to match a prefix, or a prefix to match a URI, it is
searched for in the current context, then the ancestors of the current context,
up to the beginning of the current scope. Other scopes are not searched.
$Id: MultipleScopeNamespaceSupport.java 320226 2005-02-17 06:08:16Z mrglavas $
fCurrentScope
protected int fCurrentScope
fScope
protected int[] fScope
MultipleScopeNamespaceSupport
public MultipleScopeNamespaceSupport()
MultipleScopeNamespaceSupport
public MultipleScopeNamespaceSupport(org.apache.xerces.xni.NamespaceContext context)
getPrefix
public String getPrefix(String uri,
int context)
getPrefix
public String getPrefix(String uri,
int start,
int end)
getScopeForContext
public int getScopeForContext(int context)
getURI
public String getURI(String prefix,
int context)
getURI
public String getURI(String prefix,
int start,
int end)
popScope
public void popScope()
Pops the current scope. The namespace bindings from the new current scope
are then used for searching for namespaces and prefixes.
pushScope
public void pushScope()
Begins a new scope. None of the previous namespace bindings will be used,
until the new scope is popped with popScope()
reset
public void reset()
Only resets the current scope -- all namespaces defined in lower scopes
remain valid after a call to reset.
- reset in interface org.apache.xerces.xni.NamespaceContext
- reset in interface NamespaceSupport
Copyright B) 1999-2006 The Apache Software Foundation. All Rights Reserved.