org.apache.xpath

Class XPathContext.XPathExpressionContext

Enclosing Class:
XPathContext
Implemented Interfaces:
ExpressionContext

public class XPathContext.XPathExpressionContext
extends java.lang.Object
implements ExpressionContext

Nested Class Summary

Method Summary

Node
getContextNode()
Get the current context node.
NodeIterator
getContextNodes()
Get the current context node list.
DTMManager
getDTMManager()
Return the DTMManager object.
ErrorListener
getErrorListener()
Get the error listener.
XObject
getVariableOrParam(QName qname)
Get a variable based on it's qualified name.
XPathContext
getXPathContext()
Return the XPathContext associated with this XPathExpressionContext.
double
toNumber(Node n)
Get the value of a node as a number.
String
toString(Node n)
Get the value of a node as a string.

Method Details

getContextNode

public Node getContextNode()
Get the current context node.
Specified by:
getContextNode in interface ExpressionContext

Returns:
The current context node.


getContextNodes

public NodeIterator getContextNodes()
Get the current context node list.
Specified by:
getContextNodes in interface ExpressionContext

Returns:
An iterator for the current context list, as defined in XSLT.


getDTMManager

public DTMManager getDTMManager()
Return the DTMManager object. Though XPathContext context extends the DTMManager, it really is a proxy for the real DTMManager. If a caller needs to make a lot of calls to the DTMManager, it is faster if it gets the real one from this function.


getErrorListener

public ErrorListener getErrorListener()
Get the error listener.
Specified by:
getErrorListener in interface ExpressionContext

Returns:
The registered error listener.


getVariableOrParam

public final XObject getVariableOrParam(QName qname)
            throws TransformerException
Get a variable based on it's qualified name.
Specified by:
getVariableOrParam in interface ExpressionContext

Parameters:
qname - The qualified name of the variable.

Returns:
The evaluated value of the variable.

Throws:
TransformerException -


getXPathContext

public XPathContext getXPathContext()
Return the XPathContext associated with this XPathExpressionContext. Extensions should use this judiciously and only when special processing requirements cannot be met another way. Consider requesting an enhancement to the ExpressionContext interface to avoid having to call this method.
Specified by:
getXPathContext in interface ExpressionContext

Returns:
the XPathContext associated with this XPathExpressionContext.


toNumber

public double toNumber(Node n)
Get the value of a node as a number.
Specified by:
toNumber in interface ExpressionContext

Parameters:
n - Node to be converted to a number. May be null.

Returns:
value of n as a number.


toString

public String toString(Node n)
Get the value of a node as a string.
Specified by:
toString in interface ExpressionContext

Parameters:
n - Node to be converted to a string. May be null.

Returns:
value of n as a string, or an empty string if n is null.


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