W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2007

[Bug 4521] K2-Axes-32

From: <bugzilla@wiggum.w3.org>
Date: Wed, 02 May 2007 13:25:33 +0000
CC:
To: public-qt-comments@w3.org
Message-Id: <E1HjEpp-00014O-RX@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4521

           Summary: K2-Axes-32
           Product: XML Query Test Suite
           Version: 1.0.2
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XML Query Test Suite
        AssignedTo: andrew.eisenberg@us.ibm.com
        ReportedBy: tim@cbcl.co.uk
         QAContact: public-qt-comments@w3.org


Having started to look at optimization of queries, I believe this query can be
reduced to "true" avoiding the expected error.

Since (/) introduces a "treat as document", the static type of the argument to
fn:root can be deduced as empty-sequence, because we know that the parent of a
document node is empty-sequence.  fn:root therefore returns empty-sequence,
then empty() returns true.

I believe this to be similar to the case pointed out by Mike Kay in bug report
4277 (in which static type analysis means that a cast which would fail need not
be evaluated).

(:*******************************************************:)
(: Test: K2-Axes-32                                      :)
(: Written by: Frans Englich                             :)
(: Date: 2007-01-22T21:16:10+01:00                       :)
(: Purpose: Apply axis '..' to the return value of fn:root(). :)
(:*******************************************************:)
declare variable $myVar := <e/>;
            empty(fn:root($myVar/(/)/..))
Received on Wednesday, 2 May 2007 13:25:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:18 UTC