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

RE: MS-FO-LC1-089: fn:root() should only be defined when a document node exists

From: Ashok Malhotra <ashokma@microsoft.com>
Date: Mon, 29 Sep 2003 14:57:25 -0700
Message-ID: <E5B814702B65CB4DA51644580E4853FB0AE775B4@red-msg-12.redmond.corp.microsoft.com>
To: "Michael Rys" <mrys@microsoft.com>, <public-qt-comments@w3.org>

Michael:
Thank you for your comment.  The WGs discussed this on 9/18/2003 and
decided to make no change to the fn:root function.  Instead, they
decided that the  formal semantics should change and define / as
"fn:root() treat as document()".

All the best, Ashok

> -----Original Message-----
> From: public-qt-comments-request@w3.org [mailto:public-qt-comments-
> request@w3.org] On Behalf Of Michael Rys
> Sent: Tuesday, July 01, 2003 1:06 AM
> To: public-qt-comments@w3.org
> Subject: MS-FO-LC1-089: fn:root() should only be defined when a
document
> node exists
> 
> 
> Class: Technical
> 
> Section 14.1.9 fn:root: fn:root() should error if root node is not a
> document node. Otherwise the following expression is surprising:
> (<a><b/><c/></a>)[/a/c]/b
> 
> The above expression does not return the b element, since the / would
> return the a element node which does not contain an a and thus the
> predicate evaluates to false.
> 
> If we return an error, we avoid this issue. Users can use a let
> expression to bind the constructed element. And we can decide in a
later
> version to give it a different semantics.
> 
> Also note that in XPath 1.0, fn:root() always gave a document node.
> 
> NOTE: This would give at least a return type document (see LC1-088).
> 
Received on Monday, 29 September 2003 17:57:28 UTC

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