W3C home > Mailing lists > Public > public-qt-comments@w3.org > November 2003

[XPath] reverse axis steps

From: David Carlisle <davidc@nag.co.uk>
Date: Mon, 24 Nov 2003 11:31:42 GMT
Message-Id: <200311241131.LAA10210@penguin.nag.co.uk>
To: public-qt-comments@w3.org

I commented on an earlier draft see Mike kay's response here
that the spec was unclear on the order returned by single step path

The document does now say (in 3.2.1)

  <p>The result of an <b>axis step</b> is always a sequence of zero or more
  nodes, and these nodes are always returned in document order.

which clarifies the result order, however the phrase

  <p>In a sequence of nodes selected by an axis step, each node is assigned a
  context position that corresponds to its position in the sequence. If the
  axis is a forward axis, context positions are assigned to the nodes in
  document order, starting with 1. If the axis is a reverse axis, context
  positions are assigned to the nodes in reverse document order, starting with
  1. This makes it possible to select a node from the sequence by specifying
  its position.</p>

which appears a little later ought to have a clarifying note.
In Xpath 1 this was clear enough as it was specifying the current node
list which was the only ordered construct and was always a transient
thing not a first class object, however in Xpath2 where the result of
the expression is itself ordered I think that most readers will
miss the distinction between
"The result of an <b>axis step</b>" in the first quote (document order)
"In a sequence of nodes selected by an axis step" in the second (reverse order)

In particular there should be an explicit example somewhere close to
this point that points out that
ancestor-or-self::*[1] is the root of the current document and
(ancestor-or-self::*)[1] is the current node.


This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
Received on Monday, 24 November 2003 12:19:03 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:15 UTC