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 3972 - Running Schema Import Feature tests
Summary: Running Schema Import Feature tests
Status: CLOSED INVALID
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-16 12:41 UTC by Tim Mills
Modified: 2007-06-01 08:39 UTC (History)
0 users

See Also:


Attachments

Description Tim Mills 2006-11-16 12:41:35 UTC
Could you please offer some guidance on how to run Schema Import Feature queries in conjunction with static typing.  To perform static type checking, the type of $input-context needs to be specified.  However, in SpecialTypes.xsd, the element "root" is defined using an anonymous type.



(: Name: ForExprType026 :)
(: Description: FLWOR expressions with type declaration (attribute type). Match
user defined simple type on attribute :)


(: insert-start :)
import schema default element namespace "http://typedecl";

declare variable $input-context external;
(: insert-end :)

for $test as attribute( att,Enumeration ) in $input-context/root/UserDefinedSimpleTypeAttribute/@att
return data( $test )
Comment 1 Andrew Eisenberg 2007-05-31 17:44:25 UTC
Tim, my apologies for taking so long to respond to you.

Our Guidelines for Running the XML Query Test Suite says:

"Users of static typing may choose to transform the variable declarations between insert-start and insert-end comments by adding an "as document-node()" clause as illustrated below:

    (: Name: Axes001 :)
    (: Description: Child Element :)

    (: insert-start :)
    declare variable $input-context as document-node() external;
    (: insert-end :)

    $input-context/child
"


Please close this bug if you agree with this resolution.
Comment 2 Tim Mills 2007-06-01 07:55:30 UTC
I'd forgotten about this too!

Simply changing the type to document-node() doesn't provide enough information for static type checking.  For the record, the type of the document needs to be modified to be:

document-node(schema-element( the-root-element ))

for a variable bound to an input document whose root element is "the-root-element".  

It's a little frustrating that we have to read the input documents to modify the query appropriately.
Comment 3 Michael Kay 2007-06-01 08:29:18 UTC
>It's a little frustrating

Sorry to be cynical, but every time I see comments like this I wonder why you are choosing to implement static typing. If it's frustrating for you, think what it will be like for your users.
Comment 4 Tim Mills 2007-06-01 08:39:19 UTC
Masochism, largely.  If no one implements it, no one will know if it works.  By implementing it, we've found the odd error in the FS spec.  Whether or not it's a Good Thing, it should at least be the case that it is correct.

Please be assured that our implementation does have an "off" switch for static typing!  But by implementing static type checking, we can be sure that we introduce a minimal number of dynamic type checks (for what it's worth).