# Re: Are these two xpath expression equal?

From: Maurice van Keulen <keulen@cs.utwente.nl>
Date: Tue, 31 Aug 2004 14:12:17 +0200
Message-ID: <41346B21.1010709@cs.utwente.nl>
To: "'Fianny Jiang'" <mfjiang@cse.cuhk.edu.hk>

```
There is a nice paper on equivalence of XPath queries:

Dan Olteanu, Holger Meuss, Tim Furche, and Fran cois Bry. XPath: Looking
Forward. In Akmal B. Chaudhri, Rainer Unland, Chabane Djeraba, and
Wolfgang Lindner, editors, EDBT Workshops, volume 2490 of Lecture Notes
in Computer Science, pages 109-127. Springer, 2002.

Kind regards,
Maurice van Keulen.

Michael Kay wrote:

> They are different. Consider the document
>
> <A>
>   <B>
>     <C/>
>   </B>
>   <B>
>     <D/>
>   </B>
> </A>
>
> The first expression will select the <D/> element, the second will not.
>
> The first expression selects a D using the path A/B/D provided that
> the A owns a B which owns a C.
>
> The second expression selects a D using the path A/B/D provided that
> the B owns a C.
>
> Michael Kay
>
>     ------------------------------------------------------------------------
>     *From:* www-ql-request@w3.org [mailto:www-ql-request@w3.org] *On
>     Behalf Of *Fianny Jiang
>     *Sent:* 03 September 2004 12:09
>     *To:* www-ql@w3.org
>     *Subject:* Are these two xpath expression equal?
>
>     Hi,
>
>        I am puzzled whether the following two XPaht expressions will
>     return the same result.
>       (1)  A[B/C]/B/D
>       (2)  A/B[C]/D
>
>       Or in other words, will (1) require that the matched pattern
>     should have two different B's?  That is C and D should have
>     different B as their parent.
>       Thanks alot.
>
>     Regards,
>     Fianny
>
>

--
----------------------------------------------------------------------
Dr.Ir. M. van Keulen - Assistant Professor, Data Management Technology
Univ. of Twente, Dept of EEMCS, POBox 217, 7500 AE Enschede, Netherlands
Email: m.vankeulen@utwente.nl, Phone: +31 53 4893688, Room: INF3039
WWW: http://www.cs.utwente.nl/~keulen
```
Received on Tuesday, 31 August 2004 12:12:30 GMT

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