Re: Error in XPath Recommendation?

From the definition of "document order" [1], a node's ancestor nodes
are before it, and a node's descendent nodes are after it. Therefore
it wouldn't make sense to talk of the "following axis excluding a
node's ancestors" but it does make sense to exclude a node's
descendent in the following axis.

Take the following example: <a><b/><c><d/></c><e/></a>

     a
   / | \
  b  c  e
     |
     d


if c is the context node,

following:: axis contains all nodes after c in document order (d and
e), excluding descendents (d): e

preceding:: axis contains all nodes before c in document order (a and
b), excluding ancestors (a): b

descendents:: are d

ancestors:: are a

self:: is c

All axes indeed partition the document.

[1] http://www.w3.org/TR/xpath.html#dt-document-order

Max.


You wrote:

> The bullets for "following axis", "preceding axis" and the "Note" under
> "ancestor-or-self axis" are in conflict. I believe the mistake is in the
> "following axis" bullet. Shouldn't the statement "excluding any
> descendants" be replace with "excluding any ancestors"?  Otherwise, the
> "Note" under "ancestor-or-self axis" that states "The ancestor,
> descendant, following, preceding and self axes ... together they contain
> all the nodes in the document." can not be true unless both the
> following axis and previous axis include their decedents.

Received on Saturday, 20 October 2001 11:01:28 UTC