APIdia Launch Partner
Top Description Methods
com.sun.org.apache.xml.internal.utils

public Interface PrefixResolver

Known Direct Implementers
com.sun.org.apache.xml.internal.utils.PrefixResolverDefault, com.sun.org.apache.xpath.internal.jaxp.JAXPPrefixResolver

The class that implements this interface can resolve prefixes to namespaces. Examples would include resolving the meaning of a prefix at a particular point in a document, or mapping the prefixes used in an XPath expression.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The base identifier from where relative URIs should be absolutized, or null if the base ID is unknown.

Caveat

Note that the base URI in an XML document may vary with where you are in the document, if part of the doc's contents were brought in via an external entity reference or if mechanisms such as xml:base have been used. Unless this PrefixResolver is bound to a specific portion of the document, or has been kept up to date via some other mechanism, it may not accurately reflect that context information.

getBaseIdentifier
()

Return the base identifier.

public String

Returns:

The associated Namespace URI, or null if the prefix is undeclared in this context.
getNamespaceForPrefix
(String
The prefix to look up, which may be an empty string ("") for the default Namespace.
prefix
)

Given a namespace, get the corrisponding prefix.

public String

Returns:

The associated Namespace URI as a string, or null if the prefix is undeclared in this context.
getNamespaceForPrefix
(String
The prefix to look up, which may be an empty string ("") for the default Namespace.
prefix
,
Node
The node context from which to look up the URI.
context
)

Given a namespace, get the corresponding prefix, based on the context node.

public boolean

Method Detail

getBaseIdentifierback to summary
public String getBaseIdentifier()

Return the base identifier.

Returns:String

The base identifier from where relative URIs should be absolutized, or null if the base ID is unknown.

Caveat

Note that the base URI in an XML document may vary with where you are in the document, if part of the doc's contents were brought in via an external entity reference or if mechanisms such as xml:base have been used. Unless this PrefixResolver is bound to a specific portion of the document, or has been kept up to date via some other mechanism, it may not accurately reflect that context information.

getNamespaceForPrefixback to summary
public String getNamespaceForPrefix(String prefix)

Given a namespace, get the corrisponding prefix. This assumes that the PrefixResolver holds its own namespace context, or is a namespace context itself.

Parameters
prefix:String

The prefix to look up, which may be an empty string ("") for the default Namespace.

Returns:String

The associated Namespace URI, or null if the prefix is undeclared in this context.

getNamespaceForPrefixback to summary
public String getNamespaceForPrefix(String prefix, Node context)

Given a namespace, get the corresponding prefix, based on the context node.

Parameters
prefix:String

The prefix to look up, which may be an empty string ("") for the default Namespace.

context:Node

The node context from which to look up the URI.

Returns:String

The associated Namespace URI as a string, or null if the prefix is undeclared in this context.

handlesNullPrefixesback to summary
public boolean handlesNullPrefixes()