W3C home > Mailing lists > Public > www-xml-query-comments@w3.org > February 2002

Re: ISSUE: Misalignment between types and paths

From: TAN Kuan Hui <kuanhui@mobileworkspace.com>
Date: Tue, 5 Feb 2002 12:14:00 +0800
Message-ID: <001001c1adfb$8bf154d0$200000c0@pinecone>
To: <www-xml-query-comments@w3.org>, <svincent@exalt.com>
Hi Shawn,

> From: Shawn Vincent <svincent@exalt.com>
> To: XQuery Comments <www-xml-query-comments@w3.org>, Shawn Vincent
> <svincent@exalt.com>
> Subject: ISSUE: Misalignment between types and paths
>

>
>     for $x in $organization//.[. instance of element of type Person]
return
>       process-person ($x)

IMHO, a better and more generic solution is to allow variable
declaration, vis-a-vis,

Variable ::= Datatype? "$" QName

then your example becomes,

for element of type Person $x in $organization//Person return
      process-person ($x)

Yes, its still verbose but I think more readable.
More importantly, the query engine can perform a "type filter"
on the returning sequence as the expected return type is known.
Indeed, with this approach, optimization is more generic
and is applicable throughout the whole grammar on
any returning sequences.

Thanks.
Kuan Hui
Received on Monday, 4 February 2002 23:14:14 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:21:15 UTC