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

May XPath section 3.2: / and //

From: David Carlisle <davidc@nag.co.uk>
Date: Tue, 6 May 2003 13:06:55 +0100
Message-Id: <200305061206.NAA22648@penguin.nag.co.uk>
To: public-qt-comments@w3.org

  A "/" at the beginning of a path expression is an abbreviation for the
  initial step fn:root(self::node()). The effect of this initial step is
  to begin the path at the root node of the tree that contains the context
  node. If the context item is not a node, a type error is raised. 

Given this, shouldn't a leading / be considered part of Abreviated
syntax and expanded in 3.2.4. It was a primitive in Xpath 1, but Xpath 1
didn't have fn:root().

Also it wasn't clear to me from this description whether a leading / was
supposed to be fn:root(self::node()) or fn:root(self::node())/
in particular whether [] predicates are allowed.
XPath 1 didn't allow /[.....] but it would be useful.

  A "//" at the beginning of a path expression is an abbreviation for
  the initial steps
  fn:root(self::node())/descendant-or-self::node(). The effect of these
  initial steps is to establish an initial node sequence that contains
  all nodes in the same tree as the context node. This node sequence is
  then filtered by subsequent steps in the path expression. If the
  context item is not a node, a dynamic error is raised.

This is wrong. It doesn't select all nodes in the document, attribute
and namespace nodes are not selected.
This appears to be a separate definition of a leading // which is
an unnecessery risk of introducing inconsistencies into the document.
It should surely be the case that a leading // can be defined by
expanding a // as given 3.2.4 and then further expanding the resulting
leading /.


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 Tuesday, 6 May 2003 08:07:20 UTC

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