<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>3972</bug_id>
          
          <creation_ts>2006-11-16 12:41:35 +0000</creation_ts>
          <short_desc>Running Schema Import Feature tests</short_desc>
          <delta_ts>2007-06-01 08:39:19 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Query Test Suite</product>
          <component>XML Query Test Suite</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Mills">tim</reporter>
          <assigned_to name="Andrew Eisenberg">andrew.eisenberg</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>12931</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2006-11-16 12:41:35 +0000</bug_when>
    <thetext>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 &quot;root&quot; 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 &quot;http://typedecl&quot;;

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

for $test as attribute( att,Enumeration ) in $input-context/root/UserDefinedSimpleTypeAttribute/@att
return data( $test )</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15259</commentid>
    <comment_count>1</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2007-05-31 17:44:25 +0000</bug_when>
    <thetext>Tim, my apologies for taking so long to respond to you.

Our Guidelines for Running the XML Query Test Suite says:

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

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

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

    $input-context/child
&quot;


Please close this bug if you agree with this resolution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15263</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2007-06-01 07:55:30 +0000</bug_when>
    <thetext>I&apos;d forgotten about this too!

Simply changing the type to document-node() doesn&apos;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 &quot;the-root-element&quot;.  

It&apos;s a little frustrating that we have to read the input documents to modify the query appropriately.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15264</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-06-01 08:29:18 +0000</bug_when>
    <thetext>&gt;It&apos;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&apos;s frustrating for you, think what it will be like for your users.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15265</commentid>
    <comment_count>4</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2007-06-01 08:39:19 +0000</bug_when>
    <thetext>Masochism, largely.  If no one implements it, no one will know if it works.  By implementing it, we&apos;ve found the odd error in the FS spec.  Whether or not it&apos;s a Good Thing, it should at least be the case that it is correct.

Please be assured that our implementation does have an &quot;off&quot; 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&apos;s worth).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>