<?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>22317</bug_id>
          
          <creation_ts>2013-06-10 14:28:28 +0000</creation_ts>
          <short_desc>modules-19 through modules-24 might raise an unexpected type error</short_desc>
          <delta_ts>2015-08-07 18:54:45 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XQuery 3 &amp; XPath 3 Test Suite</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="O&apos;Neil Delpratt">oneil</reporter>
          <assigned_to name="O&apos;Neil Delpratt">oneil</assigned_to>
          <cc>josh.spiegel</cc>
    
    <cc>spungi</cc>
    
    <cc>tim</cc>
          
          <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>88994</commentid>
    <comment_count>0</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2013-06-10 14:28:28 +0000</bug_when>
    <thetext>This bug was initially created by Josh Spiegel against XQTS (See: #11432), but needs addressing against FOTS. 

Bug details:

The following tests:
   modules-19
   modules-20
   modules-21
   modules-22
   modules-23
   modules-24

Might raise an unexpected type error due to a seemingly unintended problem in TestSources/module3-lib.xq.  This module declares the variable $mod3:var2 as follows:

declare variable $mod3:var2 as schema-element(simple:integer) := &lt;simple:integer&gt;1&lt;/simple:integer&gt;;

I think an implementation may raise a type error in this case.  The solution may be to add a validate expression around the initializer.  e.g.

declare variable $mod3:var2 as schema-element(simple:integer) := validate { &lt;simple:integer&gt;1&lt;/simple:integer&gt; };</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88995</commentid>
    <comment_count>1</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2013-06-10 14:39:05 +0000</bug_when>
    <thetext>Bug fixed. I have removed the type declaration. So now we have the following in TestSources/module3-lib.xq:

&quot;declare variable $mod3:var2 := &lt;simple:integer&gt;1&lt;/simple:integer&gt;;&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89054</commentid>
    <comment_count>2</comment_count>
    <who name="Sorin Nasoi">spungi</who>
    <bug_when>2013-06-11 09:26:39 +0000</bug_when>
    <thetext>The changes in TestSources/module3-lib.xq broke test-case &quot;modules-22&quot; from &quot;prod-ModuleImport&quot;.

The mentioned test-case expects &lt;error code=&quot;XQST0036&quot;/&gt;

but with the changes in TestSources/module3-lib.xq the test-case returns:
&lt;simple:integer xmlns:simple=&quot;http://www.w3.org/XQueryTest/simple&quot;&gt;1&lt;/simple:integer&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89057</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-06-11 09:49:56 +0000</bug_when>
    <thetext>I concur with Comment #2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89066</commentid>
    <comment_count>4</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2013-06-11 11:03:59 +0000</bug_when>
    <thetext>As suggested in comment #0 the declaration of var2 is now as follows:

declare variable $mod3:var2 as schema-element(simple:integer) := validate { &lt;simple:integer&gt;1&lt;/simple:integer&gt; };</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122514</commentid>
    <comment_count>5</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2015-08-07 18:54:45 +0000</bug_when>
    <thetext>In the same module, this function needs the same fix:

declare function mod3:function3() as schema-element(simple:integer)
{
  &lt;simple:integer&gt;2&lt;/simple:integer&gt;
};

This should be:

declare function mod3:function3() as schema-element(simple:integer)
{
  validate { &lt;simple:integer&gt;2&lt;/simple:integer&gt; }
};

For the same reasons mentioned in comment 0.  I will update CVS.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>