W3C home > Mailing lists > Public > www-ql@w3.org > January to March 2004

RE: Query on the XML graph

From: Kay, Michael <Michael.Kay@softwareag.com>
Date: Mon, 9 Feb 2004 17:58:32 +0100
Message-ID: <37B64F4BA60E9E4FB9F60929E0598024287837@DAEMSG03.eur.ad.sag>
To: "Murali Mani" <mani@CS.UCLA.EDU>, "Michael Brundage" <xquery@comcast.net>
Cc: "Jim Tivy" <jimt@bluestream.com>, "Jiang Ming Fei" <mfjiang@cse.cuhk.edu.hk>, <www-ql@w3.org>

> I will tentatively suggest this:
> 
> I think there should be step/(s) to navigate id/idref. Reasons are:
> 
> 1. Now how do you traverse 2 idref edges in one path 
> expression; it is not very easy..
> 
> rough example: manager of managers:
> Id(Id(//Employee/@ReportsTo)/@ReportsTo)

You can write this as

//Employee/id(@ReportsTo)/id(@ReportsTo)
> 
> 2. We can think of extending recursive operators to idref 
> traversal, and
> say:
> 
> rough example: (This query can be written w/o recursion; but 
> we can think of transitive closure as something like this..??)
> //Employee/(@ReportsTo->Employee)*

This seems to be inventing recursive operators rather than extending
them. There is no such operator currently. If you want recursion, you
write a recursive function in XSLT or XQuery, which is just as easy to
do using id() as using a special operator.

Michael Kay
Received on Monday, 9 February 2004 12:00:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 22 July 2006 00:10:19 GMT