> Hello all. I have a general question about the XPathEvaluator I have yet to find the answer to.
>
> Let's say I have a DOM like this:

...

> Now, let's say I use an XPathEvaluator. Now, I know if I use the DocumentElement of the tree as
> the ContextNode in a call to XPathEvalutor::selectNodeList(), and I want to look up the "2" under
> B, I would use an xpath _expression_ like: "B/3".
>
> Now, what if I use "B" as my Context node... do I have to take "B" into account when using an xpath
> _expression_, or do I just do "3" to get the node called "3" that is a child of "B"?

The "context node" is an XPath concept, so XPathEvaluator work with regard to the definition of the context node:

      "_expression_ evaluation occurs with respect to a context. XSLT and XPointer specify how the
      context is determined for XPath expressions used in XSLT and XPointer respectively. The
      context consists of:
        a node (the context node)
        a pair of non-zero positive integers (the context position and the context size)
        a set of variable bindings
        a function library
        the set of namespace declarations in scope for the _expression_"
    and, some paragraphs later:
      "One important kind of _expression_ is a location path. A location path selects a set of nodes
      relative to the context node. The result of evaluating an _expression_ that is a location path is
      the node-set containing the nodes selected by the location path. Location paths can
      recursively contain expressions that are used to filter sets of nodes. A location path matches
      the production LocationPath."

Dave

Reply via email to