org.apache.xalan.templates
Class ElemNumber.MyPrefixResolver

java.lang.Object
  extended byorg.apache.xalan.templates.ElemNumber.MyPrefixResolver
All Implemented Interfaces:
PrefixResolver
Enclosing class:
ElemNumber

private class ElemNumber.MyPrefixResolver
extends Object
implements PrefixResolver


Field Summary
(package private)  DTM dtm
           
(package private)  int handle
           
(package private)  boolean handleNullPrefix
           
 
Constructor Summary
ElemNumber.MyPrefixResolver(org.w3c.dom.Node xpathExpressionContext, DTM dtm, int handle, boolean handleNullPrefix)
          Constructor for MyPrefixResolver.
 
Method Summary
 String getBaseIdentifier()
          Return the base identifier.
 String getNamespaceForPrefix(String prefix)
          Given a namespace, get the corrisponding prefix.
 String getNamespaceForPrefix(String prefix, org.w3c.dom.Node context)
          Given a namespace, get the corresponding prefix, based on the context node.
 boolean handlesNullPrefixes()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dtm

DTM dtm

handle

int handle

handleNullPrefix

boolean handleNullPrefix
Constructor Detail

ElemNumber.MyPrefixResolver

public ElemNumber.MyPrefixResolver(org.w3c.dom.Node xpathExpressionContext,
                                   DTM dtm,
                                   int handle,
                                   boolean handleNullPrefix)
Constructor for MyPrefixResolver.

Parameters:
xpathExpressionContext -
Method Detail

getNamespaceForPrefix

public String getNamespaceForPrefix(String prefix)
Description copied from interface: PrefixResolver
Given a namespace, get the corrisponding prefix. This assumes that the PrefixResolver holds its own namespace context, or is a namespace context itself.

Specified by:
getNamespaceForPrefix in interface PrefixResolver
Parameters:
prefix - The prefix to look up, which may be an empty string ("") for the default Namespace.
Returns:
The associated Namespace URI, or null if the prefix is undeclared in this context.
See Also:
PrefixResolver.getNamespaceForPrefix(String, Node)

getNamespaceForPrefix

public String getNamespaceForPrefix(String prefix,
                                    org.w3c.dom.Node context)
Description copied from interface: PrefixResolver
Given a namespace, get the corresponding prefix, based on the context node.

Specified by:
getNamespaceForPrefix in interface PrefixResolver
Parameters:
prefix - The prefix to look up, which may be an empty string ("") for the default Namespace.
context - The node context from which to look up the URI.
Returns:
The associated Namespace URI as a string, or null if the prefix is undeclared in this context.
See Also:
this shouldn't get called.

getBaseIdentifier

public String getBaseIdentifier()
Description copied from interface: PrefixResolver
Return the base identifier.

Specified by:
getBaseIdentifier in interface PrefixResolver
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.

See Also:
PrefixResolver.getBaseIdentifier()

handlesNullPrefixes

public boolean handlesNullPrefixes()
Specified by:
handlesNullPrefixes in interface PrefixResolver
See Also:
PrefixResolver.handlesNullPrefixes()