Title: Message
Um, forgive me, but I'm a little dense when it comes to interpreting specification language like that, so I still can't quite tell the answer to my question...
 
Based on what you've said, and my example,   if "B" is the context node, and I want to select a child called "3", do I use "B/3" in the xpath _expression_, or just "3"?
 
 

Rich Stephens
Software Developer
Optio Software, Inc.
Windward Fairways II
3015 Windward Plaza
Alpharetta, GA 30005
(770) 576-3561
[EMAIL PROTECTED]

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 10, 2004 2:28 PM
To: [email protected]
Subject: RE: Xalan Xpath Caching

> 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