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 3844 - Static typing of external context item tests
Summary: Static typing of external context item tests
Status: RESOLVED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 1.0.1
Hardware: PC Windows XP
: 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:
: 3944 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-17 14:11 UTC by Nick Jones
Modified: 2007-09-20 09:55 UTC (History)
1 user (show)

See Also:


Attachments

Description Nick Jones 2006-10-17 14:11:03 UTC
The following tests all fail static type checking as they contain expressions which expect something with type quantified ZeroOrOne, but are passed in a child:: expression which can return more than elements.

For example, from externalcontextitem-5

for $var in $input-context1/works/employee[1]
return $var/xs:float(hours)


The other tests are similar. Could they be changed to exactly-one(hours).

Relavent tests are:

externalcontextitem-2
externalcontextitem-3
externalcontextitem-4
externalcontextitem-5
externalcontextitem-6
externalcontextitem-7
externalcontextitem-8
externalcontextitem-10
externalcontextitem-11
externalcontextitem-12
externalcontextitem-13
externalcontextitem-14
externalcontextitem-15
externalcontextitem-16
externalcontextitem-17
externalcontextitem-18
externalcontextitem-21
Comment 1 Michael Kay 2006-10-17 19:50:27 UTC
It occurs to me that my making all these changes to accommodate static typing, the test suite is becoming less effective at testing dynamic typing. A dynamic typing implementation will typically work out for itself that it needs to add an exactly-one() test to the expression tree, and if it's already been added "by hand" then there's a path in my product that is no longer being tested.

So I don't think it's a good idea to change all the tests as is being requested. I'd like some of them to stay as is, and to be marked in the catalog as failing under static typing.
Comment 2 Michael Rys 2006-10-17 20:16:34 UTC
Note: The testing suite is not meant to check implementation code paths but functionality interop. 

But I agree that it may be useful to duplicate such tests with and without the exactly-one().
Comment 3 Frans Englich 2006-10-17 20:22:28 UTC
The task force has discussed this and I've myself mentioned the problem that testing dynamic implementations becomes less effective with the fixes usually applied for incorrectly typed tests(lame pun intended).

Currently two approaches have been suggested: either an alternate query or additional baselines on a per-test basis for static typing implementations.
Comment 4 Nick Jones 2006-10-18 10:12:05 UTC
nametest-8
nametest-10
nametest-11

have similar problems
Comment 5 Nick Jones 2006-10-18 10:22:15 UTC
As have

copynamespace-3.xq
copynamespace-4.xq
copynamespace-5.xq
copynamespace-6.xq
copynamespace-7.xq
copynamespace-8.xq
copynamespace-9.xq
copynamespace-10.xq
copynamespace-11.xq
copynamespace-12.xq
copynamespace-13.xq
copynamespace-14.xq
copynamespace-15.xq
copynamespace-16.xq
copynamespace-17.xq
copynamespace-18.xq
copynamespace-19.xq
copynamespace-20.xq
copynamespace-21.xq
copynamespace-22.xq
Comment 6 Nick Jones 2006-11-03 11:16:33 UTC
*** Bug 3944 has been marked as a duplicate of this bug. ***
Comment 7 Frans Englich 2007-09-14 09:34:51 UTC
A fix has been attempted in CVS, XQTS_current.zip is updated.

If the resolution is satisfactory, feel free to change status to CLOSED. Otherwise, reopen this report. If no feedback is returned within two weeks, status will be changed to CLOSED. Thanks for reporting!
Comment 8 Nick Jones 2007-09-14 11:19:53 UTC
Thanks. I think they are all work with static typing, except nametest-8 which has a parsing error (extra right parenthesis on the last line)
Comment 9 Nick Jones 2007-09-20 09:55:21 UTC
All the externalcontextitem and nametest tests now appear to static type correctly, but am still getting problems for the copynamespace queries where things like:

in-scope-prefixes($new//child::*)

fail to type check as $new//child::* type as quantifier *, but in-scope-prefixes expectes a single element.