This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4521 - K2-Axes-32
Summary: K2-Axes-32
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 1.0.2
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Frans Englich
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-02 13:25 UTC by Tim Mills
Modified: 2007-06-13 09:38 UTC (History)
0 users

See Also:


Attachments

Description Tim Mills 2007-05-02 13:25:29 UTC
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/(/)/..))
Comment 1 Andrew Eisenberg 2007-06-12 19:48:33 UTC
You've raised an interesting issue, Tim. The WGs discussed this at our June 5 meeting and we agreed that if static analysis can be used to determine the result of a query, then dynamic evaluation need not occur.
Comment 2 Frans Englich 2007-06-13 08:53:03 UTC
And XQTS_current.zip has been updated in CVS to reflect that, hopefully. K2-Axes-32 now has the baselines XPST0005, XPDY0002, and "true".
Comment 3 Tim Mills 2007-06-13 09:38:29 UTC
Thanks.