org.apache.xpath.jaxp

Class JAXPPrefixResolver

Implemented Interfaces:
PrefixResolver

public class JAXPPrefixResolver
extends java.lang.Object
implements PrefixResolver

This class implements a Default PrefixResolver which can be used to perform prefix-to-namespace lookup for the XPath object. This class delegates the resolution to the passed NamespaceContext

Field Summary

static String
S_XMLNAMESPACEURI
The URI for the XML namespace.

Constructor Summary

JAXPPrefixResolver(NamespaceContext nsContext)

Method Summary

String
getBaseIdentifier()
Return the base identifier.
String
getNamespaceForPrefix(String prefix)
String
getNamespaceForPrefix(String prefix, org.w3c.dom.Node namespaceContext)
Given a prefix and a Context Node, get the corresponding namespace.
boolean
handlesNullPrefixes()

Field Details

S_XMLNAMESPACEURI

public static final String S_XMLNAMESPACEURI
The URI for the XML namespace. (Duplicate of that found in org.apache.xpath.XPathContext).

Constructor Details

JAXPPrefixResolver

public JAXPPrefixResolver(NamespaceContext nsContext)

Method Details

getBaseIdentifier

public String getBaseIdentifier()
Return the base identifier.
Specified by:
getBaseIdentifier in interface PrefixResolver
Returns:
null

getNamespaceForPrefix

public String getNamespaceForPrefix(String prefix)
Specified by:
getNamespaceForPrefix in interface PrefixResolver

getNamespaceForPrefix

public String getNamespaceForPrefix(String prefix,
                                    org.w3c.dom.Node namespaceContext)
Given a prefix and a Context Node, get the corresponding namespace. Warning: This will not work correctly if namespaceContext is an attribute node.
Specified by:
getNamespaceForPrefix in interface PrefixResolver
Parameters:
prefix - Prefix to resolve.
namespaceContext - Node from which to start searching for a xmlns attribute that binds a prefix to a namespace.
Returns:
Namespace that prefix resolves to, or null if prefix is not bound.

handlesNullPrefixes

public boolean handlesNullPrefixes()
Specified by:
handlesNullPrefixes in interface PrefixResolver

Copyright B) 2005 Apache XML Project. All Rights Reserved.