com.novell.xml.util
Class NamespaceStack

java.lang.Object
  extended bycom.novell.xml.util.NamespaceStack

public class NamespaceStack
extends Object

Class for keeping track of namespace declarations in scope for result handlers, serializers etc.


Constructor Summary
NamespaceStack()
          Construct an empty namespace stack object.
 
Method Summary
 boolean add(String prefix, NamespaceName namespace_name)
          Conditionally add a namespace declaration.
 NamespaceName getNamespaceName(String prefix)
          Get the URI for the passed prefix, if it exists
 void pop()
          Pop the namespace declarations added since the last push()
 void push()
          Push currently in-scope namespace declarations at the start of an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespaceStack

public NamespaceStack()
Construct an empty namespace stack object. Note that the namespace corresponding to the "xml" prefix is always defined per the XML Namespaces REC

Method Detail

push

public void push()
Push currently in-scope namespace declarations at the start of an element.


pop

public void pop()
Pop the namespace declarations added since the last push()


add

public boolean add(String prefix,
                   NamespaceName namespace_name)
Conditionally add a namespace declaration. The declaration is not added if it is already in scope.

Parameters:
prefix - The prefix of the declaration
namespace_name - The namespace name of the declaration
Returns:
True if namespace was not already in scope and was added, false if namespace was already in scope.

getNamespaceName

public NamespaceName getNamespaceName(String prefix)
Get the URI for the passed prefix, if it exists

Parameters:
prefix - The prefix to check.