W3C home > Mailing lists > Public > public-qt-comments@w3.org > February 2004

RE: ORA-XQ-281-B: please permit // on element nodes

From: Michael Kay <mhk@mhk.me.uk>
Date: Mon, 16 Feb 2004 23:02:57 -0000
To: "'Stephen Buxton'" <Stephen.Buxton@oracle.com>, <public-qt-comments@w3.org>
Message-ID: <000d01c3f4e1$04efcff0$6401a8c0@pcukmka>

> SECTION 3.2: Path expressions
> It says that "//" at the beginning of a path expression is an 
> abbreviation for fn:root(self::node()) treat as 
> document-node()/ descendent-or-self::node().  As noted, this 
> will cause an exception if the root is not a document node.  
> This seems arbitrary.  Why not permit // when the root of a 
> node is just an element node, 
> for example?
The reason we made this decision is that users expect //A to select all
the A elements in a tree; but if the root of the tree is an A element,
then /descendant-or-self::node()/A would not select that A element.
Similarly, it would not be selected by the expression /A (which means
/child::A). Since we couldn't come up with a semantics for /A and //A
for trees rooted an element node that would be both intuitive and
logical, we decided not to allow it. You haven't said what you think the
semantics should be.

Michael Kay
Received on Monday, 16 February 2004 18:02:16 UTC

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