com.jclark.xsl.om

Interface NamespacePrefixMap

public interface NamespacePrefixMap

Associates namespaces with prefixes. Every Node in a document is associated with a NameSpacePrefixMap which represents all the in-scope namespace bindings for that Node
Method Summary
NamespacePrefixMapbind(String prefix, String namespace)
record the association of a prefix to a namespace
NamespacePrefixMapbindDefault(String namespace)
identify the given namespace as the default namespace
NameexpandAttributeName(String qName, Node node)
returns the two-part Name for the given Attribute's qName non-colonized names are returned as belonging to no namespace
NameexpandElementTypeName(String qName, Node node)
returns the two-part Name for the given qName non-colonized names are identified in the default namespace, if there is one, else no namespace
StringgetDefaultNamespace()
StringgetNamespace(int i)
StringgetNamespace(String prefix)
NameTablegetNameTable()
A NamespacePrefixMap is associated with a single NameTable
StringgetPrefix(int i)
StringgetPrefix(String namespace)
intgetSize()
The number of bound prefixes
NamespacePrefixMapunbind(String prefix)
removes the association of a prefix with a namespace
NamespacePrefixMapunbindDefault()
remove the default namespace

Method Detail

bind

public NamespacePrefixMap bind(String prefix, String namespace)
record the association of a prefix to a namespace

bindDefault

public NamespacePrefixMap bindDefault(String namespace)
identify the given namespace as the default namespace

expandAttributeName

public Name expandAttributeName(String qName, Node node)
returns the two-part Name for the given Attribute's qName non-colonized names are returned as belonging to no namespace

Parameters: node -- provided for particularizing any Exception with Location

Throws: XSLException -- if there's no binding for the prefix

expandElementTypeName

public Name expandElementTypeName(String qName, Node node)
returns the two-part Name for the given qName non-colonized names are identified in the default namespace, if there is one, else no namespace

Parameters: node -- provided for particularizing any Exception with Location

Throws: XSLException -- if there's no binding for the prefix

getDefaultNamespace

public String getDefaultNamespace()

Returns: the default namespace (which needs no prefix)

getNamespace

public String getNamespace(int i)

Returns: the i'th namespace

getNamespace

public String getNamespace(String prefix)

Returns: the namespace bound to the given prefix (or null)

getNameTable

public NameTable getNameTable()
A NamespacePrefixMap is associated with a single NameTable

getPrefix

public String getPrefix(int i)

Returns: the i'th prefix

getPrefix

public String getPrefix(String namespace)

Returns: the (first??) prefix bound to the given namespace (or null)

getSize

public int getSize()
The number of bound prefixes

Returns: the number of bindings in this map

unbind

public NamespacePrefixMap unbind(String prefix)
removes the association of a prefix with a namespace

unbindDefault

public NamespacePrefixMap unbindDefault()
remove the default namespace