net.sf.saxon.sxpath
Class XPathDynamicContext
java.lang.Object
net.sf.saxon.sxpath.XPathDynamicContext
public class XPathDynamicContext
extends java.lang.Object
This object represents the dynamic XPath execution context for use in the free-standing Saxon XPath API.
The dynamic context holds the context item and the values of external variables used by the XPath expression.
This object is always created via the method
XPathExpression.createDynamicContext(Item)
checkExternalVariables
protected void checkExternalVariables(SlotManager stackFrameMap,
int numberOfExternals)
throws XPathException
Check that all external variables have been given a value
stackFrameMap
- describes the stack framenumberOfExternals
- the number of variables that need to be supplied
getContextItem
public Item getContextItem()
Get the context item
- the context item if there is one, or null otherwise
getXPathContextObject
protected XPathContext getXPathContextObject()
For system use: get the wrapped XPathContext object
setContextItem
public void setContextItem(Item item)
throws XPathException
Set the context item for evaluation of the XPath Expression
XPathException
- if the node is in a document that was built under the wrong configuration
setContextNode
public void setContextNode(Source source)
throws XPathException
Set the context item to a node derived from a supplied Source object. This may be
any implementation of the Source interface recognized by Saxon. Note that the
Saxon
NodeInfo
interface, representing a node in a tree, is one such
implementation; others include
javax.xml.transform.stream.StreamSource
,
javax.xml.transform.sax.SAXSource
, and
javax.xml.transform.dom.DOMSource
source
- The source object representing the node that will be used as the context item
XPathException
- if a failure occurs reading or parsing a Source object to build an input tree,
or if the source is a document that was built under the wrong configuration