org.apache.xpath
public class XPathContext extends DTMManager
This class extends DTMManager but does not directly implement it.
UNKNOWN: advanced
Nested Class Summary | |
---|---|
class | XPathContext.XPathExpressionContext |
Field Summary | |
---|---|
XMLReader | m_primaryReader The reader of the primary source tree. |
static int | RECURSIONLIMIT
The ammount to use for stacks that record information during the
recursive execution. |
Constructor Summary | |
---|---|
XPathContext()
Create an XPathContext instance. | |
XPathContext(boolean recursiveVarContext)
Create an XPathContext instance. | |
XPathContext(Object owner)
Create an XPathContext instance. | |
XPathContext(Object owner, boolean recursiveVarContext)
Create an XPathContext instance. |
Method Summary | |
---|---|
DTM | createDocumentFragment()
Creates an empty DocumentFragment object. |
DTMIterator | createDTMIterator(Object xpathCompiler, int pos)
Create a new DTMIterator based on an XPath
UnionExpr.
|
DTMIterator | createDTMIterator(String xpathString, PrefixResolver presolver)
Create a new DTMIterator based on an XPath
UnionExpr.
|
DTMIterator | createDTMIterator(int whatToShow, DTMFilter filter, boolean entityReferenceExpansion)
Create a new DTMIterator based only on a whatToShow and
a DTMFilter. |
DTMIterator | createDTMIterator(int node)
Create a new DTMIterator that holds exactly one node.
|
Stack | getAxesIteratorStackStacks() |
int | getContextNode()
Get the current context node. |
DTMIterator | getContextNodeList()
Get the current context node list.
|
Stack | getContextNodeListsStack() |
DTMIterator | getContextNodes()
Get the current context node list. |
int | getCurrentExpressionNode()
Get the current node that is the expression's context (i.e. for current() support).
|
IntStack | getCurrentExpressionNodeStack() |
int | getCurrentNode()
Get the current context node.
|
SubContextList | getCurrentNodeList()
Get the current node list
as defined by the XSLT spec.
|
IntStack | getCurrentNodeStack() |
DTM | getDTM(Source source, boolean unique, DTMWSFilter wsfilter, boolean incremental, boolean doIndexing)
Get an instance of a DTM, loaded with the content from the
specified source. |
DTM | getDTM(int nodeHandle)
Get an instance of a DTM that "owns" a node handle.
|
int | getDTMHandleFromNode(Node node)
Given a W3C DOM node, try and return a DTM handle.
|
int | getDTMIdentity(DTM dtm)
%TBD% Doc |
DTMManager | getDTMManager()
Return the DTMManager object. |
DTMXRTreeFrag | getDTMXRTreeFrag(int dtmIdentity)
Gets DTMXRTreeFrag object if one has already been created.
|
ErrorListener | getErrorListener()
Get the ErrorListener where errors and warnings are to be reported.
|
ExpressionContext | getExpressionContext()
The the expression context for extensions for this context.
|
DTM | getGlobalRTFDTM()
Get a DTM to be used as a container for a global Result Tree
Fragment. |
int | getIteratorRoot()
Get the current location path iterator root. |
PrefixResolver | getNamespaceContext()
Get the current namespace context for the xpath.
|
Object | getOwnerObject()
Get the "owner" context of this context, which should be,
in the case of XSLT, the Transformer object. |
int | getPredicatePos() |
int | getPredicateRoot()
Get the current predicate root. |
XMLReader | getPrimaryReader()
Get primary XMLReader associated with this execution context.
|
DTM | getRTFDTM()
Get a DTM to be used as a container for a dynamic Result Tree
Fragment. |
SourceLocator | getSAXLocator()
Get the current locater in the stylesheet.
|
SourceTreeManager | getSourceTreeManager()
Get the SourceTreeManager associated with this execution context.
|
SubContextList | getSubContextList()
Get the current axes iterator, or return null if none.
|
URIResolver | getURIResolver()
Get the URIResolver associated with this execution context.
|
VariableStack | getVarStack()
Get the variable stack, which is in charge of variables and
parameters.
|
boolean | isSecureProcessing()
Return the state of the secure processing feature |
void | popContextNodeList()
Pop the current context node list. |
void | popCurrentExpressionNode()
Pop the current node that is the expression's context
(i.e. for current() support). |
void | popCurrentNode()
Pop the current context node. |
void | popCurrentNodeAndExpression()
Set the current context node. |
void | popExpressionState()
Pop the current context node, expression node, and prefix resolver. |
void | popIteratorRoot()
Pop the current location path iterator root. |
void | popNamespaceContext()
Pop the current namespace context for the xpath. |
void | popPredicatePos() |
void | popPredicateRoot()
Pop the current predicate root. |
void | popRTFContext() Pop the RTFDTM's context mark. |
void | popSAXLocator()
Pop the current locater. |
void | popSubContextList()
Pop the last pushed axes iterator. |
void | pushContextNodeList(DTMIterator nl)
Set the current context node list.
|
void | pushCurrentExpressionNode(int n)
Set the current node that is the expression's context (i.e. for current() support).
|
void | pushCurrentNode(int n)
Set the current context node.
|
void | pushCurrentNodeAndExpression(int cn, int en)
Set the current context node and expression node.
|
void | pushExpressionState(int cn, int en, PrefixResolver nc)
Push the current context node, expression node, and prefix resolver.
|
void | pushIteratorRoot(int n)
Set the current location path iterator root. |
void | pushNamespaceContext(PrefixResolver pr)
Push a current namespace context for the xpath.
|
void | pushNamespaceContextNull()
Just increment the namespace contest stack, so that setNamespaceContext
can be used on the slot. |
void | pushPredicatePos(int n) |
void | pushPredicateRoot(int n)
Set the current predicate root. |
void | pushRTFContext() Push the RTFDTM's context mark, to allows discarding RTFs added after this
point. |
void | pushSAXLocator(SourceLocator location)
Set the current locater in the stylesheet.
|
void | pushSAXLocatorNull()
Push a slot on the locations stack so that setSAXLocator can be
repeatedly called.
|
void | pushSubContextList(SubContextList iter)
Push a TreeWalker on the stack.
|
boolean | release(DTM dtm, boolean shouldHardDelete)
Release a DTM either to a lru pool, or completely remove reference.
|
void | reset()
Reset for new run. |
void | setAxesIteratorStackStacks(Stack s) |
void | setContextNodeListsStack(Stack s) |
void | setCurrentExpressionNodeStack(IntStack nv) |
void | setCurrentNodeStack(IntStack nv) |
void | setErrorListener(ErrorListener listener)
Set the ErrorListener where errors and warnings are to be reported.
|
void | setNamespaceContext(PrefixResolver pr)
Get the current namespace context for the xpath.
|
void | setPrimaryReader(XMLReader reader)
Set primary XMLReader associated with this execution context.
|
void | setSAXLocator(SourceLocator location)
Set the current locater in the stylesheet.
|
void | setSecureProcessing(boolean flag)
Set the state of the secure processing feature |
void | setSourceTreeManager(SourceTreeManager mgr)
Set the SourceTreeManager associated with this execution context.
|
void | setURIResolver(URIResolver resolver)
Set the URIResolver associated with this execution context.
|
void | setVarStack(VariableStack varStack)
Get the variable stack, which is in charge of variables and
parameters.
|
true
.Parameters: recursiveVarContext A boolean
value indicating whether
the XPath context needs to support pushing of scopes for
variable resolution
true
.Parameters: owner Value that can be retrieved via the getOwnerObject() method.
See Also: XPathContext
Parameters: owner Value that can be retrieved via the getOwnerObject() method. recursiveVarContext A boolean
value indicating whether
the XPath context needs to support pushing of scopes for
variable resolution
See Also: XPathContext
DocumentFragment
object.Returns: A new DocumentFragment handle
.
DTMIterator
based on an XPath
UnionExpr.
Parameters: xpathCompiler ??? Somehow we need to pass in a subpart of the expression. I hate to do this with strings, since the larger expression has already been parsed. pos The position in the expression.
Returns: The newly created DTMIterator
.
DTMIterator
based on an XPath
UnionExpr.
Parameters: xpathString Must be a valid string expressing a UnionExpr. presolver An object that can resolve prefixes to namespace URLs.
Returns: The newly created DTMIterator
.
DTMIterator
based only on a whatToShow and
a DTMFilter. The traversal semantics are defined as the descendant
access.
Parameters: whatToShow This flag specifies which node types may appear in
the logical view of the tree presented by the iterator. See the
description of NodeFilter
for the set of possible
SHOW_
values.These flags can be combined using
OR
. filter The NodeFilter
to be used with this
TreeWalker
, or null
to indicate no filter. entityReferenceExpansion The value of this flag determines
whether entity reference nodes are expanded.
Returns: The newly created NodeIterator
.
DTMIterator
that holds exactly one node.
Parameters: node The node handle that the DTMIterator will iterate to.
Returns: The newly created DTMIterator
.
Returns: The current context node.
Returns: the current node list,
also refered to here as a
Returns: An iterator for the current context list, as defined in XSLT.
Returns: The current sub-expression node.
Returns: the current node.
Returns: the current node list.
UNKNOWN: internal
Parameters: source the specification of the source object, which may be null, in which case it is assumed that node construction will take by some other means. unique true if the returned DTM must be unique, probably because it is going to be mutated. wsfilter Enables filtering of whitespace nodes, and may be null. incremental true if the construction should try and be incremental. doIndexing true if the caller considers it worth it to use indexing schemes.
Returns: a non-null DTM reference.
Parameters: nodeHandle the nodeHandle.
Returns: a non-null DTM reference.
Parameters: node Non-null reference to a DOM node.
Returns: a valid DTM handle.
Parameters: dtmIdentity
Returns: DTMXRTreeFrag
Returns: A non-null ErrorListener reference.
Returns: An object that implements the ExpressionContext.
Returns: a non-null DTM reference.
Returns: the current prefix resolver for resolving prefixes to namespace URLs.
Returns: The owner object passed into the constructor, or null.
Returns: The reader of the primary source tree.
Returns: a non-null DTM reference.
Returns: The location within the stylesheet, or null if not known.
Returns: the SourceTreeManager associated with this execution context.
Returns: the sub-context node list.
UNKNOWN: internal
Returns: a URI resolver, which may be null.
Returns: the variable stack, which should not be null.
UNKNOWN: internal
UNKNOWN: internal
Parameters: nl the current node list,
also refered to here as a
UNKNOWN: internal
Parameters: n The sub-expression node to be current.
Parameters: n the current node.
Parameters: cn the current node. en the sub-expression context node.
Parameters: cn the current node. en the sub-expression context node. nc the namespace context (prefix resolver.
Parameters: pr the prefix resolver to be used for resolving prefixes to namespace URLs.
Parameters: location The location within the stylesheet.
Parameters: iter A sub-context AxesWalker.
UNKNOWN: internal
Parameters: dtm The DTM to be released. shouldHardDelete True if the DTM should be removed no matter what.
Returns: true if the DTM was removed, false if it was put back in a lru pool.
Parameters: listener A non-null ErrorListener reference.
Parameters: pr the prefix resolver to be used for resolving prefixes to namespace URLs.
Parameters: reader The reader of the primary source tree.
Parameters: location The location within the stylesheet.
Parameters: mgr the SourceTreeManager to be associated with this execution context.
Parameters: resolver the URIResolver to be associated with this execution context, may be null to clear an already set resolver.
Parameters: varStack non-null reference to the variable stack.