The current RuleProcessor environment.
associateNamespace
public void associateNamespace(String nsPrefix,
String nsURI)
Associates a namespace with the given prefix,
nsPrefix
- the namespace prefixnsURI
- the namespace URI to associate
generateId
public String generateId(XPathNode node)
Creates a unique identifier for the given node
- the String that is a unique identifier for the
given node
getAttributeValueTemplate
public AttributeValueTemplate getAttributeValueTemplate(String avtString)
throws XPathException
Returns the value of the given String as an AttributeValueTemplate
getCurrentNode
public XPathNode getCurrentNode()
Returns the "current" node
The current node, is different than the context node, as
the context node may change during the evaluation of an
xpath expression, the current node does not. Basically
it's the first context node during the beginning of
an xpath evalation.
- the "current" node
popCurrentNode
, pushCurrentNode
getDocumentOrder
public int[] getDocumentOrder(XPathNode node)
Returns the document order of the given node.
- getDocumentOrder in interface XPathContext
- The document order of the given node
getElementById
public XPathNode getElementById(XPathNode root,
String id)
Returns the element associated with the given identifier.
Locates the element underneath the specified root node.
- getElementById in interface XPathContext
root
- The root nodeid
- The element's identifier
- The first element in document order with the given
identifier, or null if no such element was found
getErrorObserver
public ErrorObserver getErrorObserver()
Returns the ErrorObserver to report errors to
- the ErrorObserver to report errors to
getFunction
public XPathFunction getFunction(String name)
Returns the XPathFunction with the given name and belonging
to the given namespace.
name
- the name of the function
- the XPathFunction with the given name
getFunction
public XPathFunction getFunction(String namespace,
String name)
Returns the XPathFunction with the given name and belonging
to the given namespace.
- getFunction in interface XPathContext
namespace
- the namespace of the functionname
- the name of the function
- the XPathFunction with the given name
getNamespaceURI
public String getNamespaceURI(String prefix)
Returns the namespace associated with the given prefix.
A namespace can be associated with a given prefix via
the XSLT document being processed, or using #associateNamespace
method
- getNamespaceURI in interface XPathContext
prefix
- the prefix of the namespace to return
- the namespace prefix or null if none found.
getNode
public XPathNode getNode()
Returns the context node of this XPathContext
- getNode in interface XPathContext
- the context node
getNodeSet
public NodeSet getNodeSet()
Returns the current context node-set.
- getNodeSet in interface XPathContext
- The current context node-set
getParameter
public String getParameter(String name)
Returns the parameter value associated with the given name.
name
- the name of the parameter to retrieve the value of
- the parameter value associated with the given name.
getPosition
public int getPosition()
Returns the position of the context node. The position is
a value between zero and the context size minus one.
One must be added in order to obtain a value XPath position.
- getPosition in interface XPathContext
- The position of the context node
getSize()
getProperty
public String getProperty(String name)
Returns the Property value associated with the given name.
All property names without a namespace are defaulted to the
System evironment scope.
name
- the name of the property to get the value of
- the Property value associated with the given name.
getSize
public int getSize()
Returns the size of the context.
- getSize in interface XPathContext
- The size of the context
getStylesheetLocation
public URILocation getStylesheetLocation()
getURIResolver
public URIResolver getURIResolver()
Returns the URIResolver for resolving all URIs.
- the URIResolver for resolving all URIs.
getVariable
public XPathResult getVariable(String name)
Returns the XPath result bound to the given variable name.
Returns null if the variable was not set.
- getVariable in interface XPathContext
name
- The variable name
- The variable's value
getXMLSpaceModes
public QuickStack getXMLSpaceModes()
Returns the stack of XML space modes
isFunctionAvailable
public boolean isFunctionAvailable(String name,
String namespace)
Returns true if a function with the given name exists
within the given namespace.
- true if a function with the given name exists
isXSLTNamespace
public boolean isXSLTNamespace(String prefixOrURI)
Determines if the given prefix or URI maps to the XSLT namespace
prefixOrURI
- the prefix or URI to compare with the
XSLT namespace
- true if the given prefix or URI maps to the XSLT namespace
popCurrentNode
public XPathNode popCurrentNode()
Removes the current node from the top of the stack
The current node, is different than the context node, as
the context node may change during the evaluation of an
xpath expression, the current node does not. Basically
it's the first context node during the beginning of
an xpath evalation.
- the current node.
pushCurrentNode
, getCurrentNode
popHandler
public ResultHandler popHandler()
Removes and returns the ResultHandler from the top of the
ResultHandler stack.
- the ResultHandler that was at the top of the stack.
popNodeSet
public NodeSet popNodeSet()
Removes and returns the current NodeSet from the context stack
- the current NodeSet from the context stack
pushCurrentNode
public void pushCurrentNode(XPathNode node)
Adds the given node to the top of the "current" node Stack.
The current node, is different than the context node, as
the context node may change during the evaluation of an
xpath expression, the current node does not. Basically
it's the first context node during the beginning of
an xpath evalation.
node
- the new current node
popCurrentNode
, getCurrentNode
pushHandler
public void pushHandler(ResultHandler handler)
Pushes a new ResultHandler to the top of the ResultHandler stack.
handler
- the ResultHandler to push to the top of the stack.
pushNodeSet
public void pushNodeSet(NodeSet nodeSet)
Pushes the given nodeSet onto the context stack
nodeSet
- the nodeSet ot push onto the stack
setNodeSet
public void setNodeSet(NodeSet nodeSet,
int position)
Sets the given node-set as the context node-set for
this XPathContext
- setNodeSet in interface XPathContext
nodeSet
- the node-set to use as the context node-set.position
- the position of the context node
setPosition
public void setPosition(int position)
Sets the position of the context node within the context
node-set
- setPosition in interface XPathContext