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 22317 - modules-19 through modules-24 might raise an unexpected type error
Summary: modules-19 through modules-24 might raise an unexpected type error
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Candidate Recommendation
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: O'Neil Delpratt
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-10 14:28 UTC by O'Neil Delpratt
Modified: 2015-08-07 18:54 UTC (History)
3 users (show)

See Also:


Attachments

Description O'Neil Delpratt 2013-06-10 14:28:28 UTC
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) := <simple:integer>1</simple:integer>;

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 { <simple:integer>1</simple:integer> };
Comment 1 O'Neil Delpratt 2013-06-10 14:39:05 UTC
Bug fixed. I have removed the type declaration. So now we have the following in TestSources/module3-lib.xq:

"declare variable $mod3:var2 := <simple:integer>1</simple:integer>;"
Comment 2 Sorin Nasoi 2013-06-11 09:26:39 UTC
The changes in TestSources/module3-lib.xq broke test-case "modules-22" from "prod-ModuleImport".

The mentioned test-case expects <error code="XQST0036"/>

but with the changes in TestSources/module3-lib.xq the test-case returns:
<simple:integer xmlns:simple="http://www.w3.org/XQueryTest/simple">1</simple:integer>
Comment 3 Tim Mills 2013-06-11 09:49:56 UTC
I concur with Comment #2.
Comment 4 O'Neil Delpratt 2013-06-11 11:03:59 UTC
As suggested in comment #0 the declaration of var2 is now as follows:

declare variable $mod3:var2 as schema-element(simple:integer) := validate { <simple:integer>1</simple:integer> };
Comment 5 Josh Spiegel 2015-08-07 18:54:45 UTC
In the same module, this function needs the same fix:

declare function mod3:function3() as schema-element(simple:integer)
{
  <simple:integer>2</simple:integer>
};

This should be:

declare function mod3:function3() as schema-element(simple:integer)
{
  validate { <simple:integer>2</simple:integer> }
};

For the same reasons mentioned in comment 0.  I will update CVS.