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 29937 - [QT3TS] fn-load-xquery-module-060
Summary: [QT3TS] fn-load-xquery-module-060
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: 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: 2016-10-13 15:23 UTC by Tim Mills
Modified: 2016-10-19 12:51 UTC (History)
1 user (show)

See Also:


Attachments

Description Tim Mills 2016-10-13 15:23:27 UTC
I disagree with the expected result of the test, and don't think the description matches the test.

The loaded module has no context item declaration, therefore doesn't place any restrictions on the context item type.

When the module is compiled, the compiler introduces dynamic type checking for the assignment

declare variable $cim:context as node() := .;

which will trigger an XPTY0004 if $cim:context happens to be evaluated.
 
  <test-case name="fn-load-xquery-module-060">
    <description>Checks for an error when calling fn:load-xquery-module and providing the wrong type of value for the context item.</description>
    <created by="Debbie Lockett" on="2015-06-01"/>
    <module uri="http://www.w3.org/fots/fn/load-xquery-module/context-item/module" file="load-xquery-module/context-item2-module.xqm"/>
    <test>fn:load-xquery-module("http://www.w3.org/fots/fn/load-xquery-module/context-item/module", 
      map{"context-item" : "item"})</test>
    <result>
      <error code="FOQM0005"/>
    </result>
  </test-case>

xquery version "3.1";

module namespace cim = "http://www.w3.org/fots/fn/load-xquery-module/context-item/module";

declare variable $cim:context as node() := .;

declare function cim:get-context-child() as node()* {
    $cim:context/child::node()
};
Comment 1 Michael Kay 2016-10-13 15:39:58 UTC
I agree.

(We're passing this one because we redirect XPTY0004 to FOQM0005 rather indiscriminately, which is going to catch quite a few cases that shouldn't be caught).
Comment 2 Tim Mills 2016-10-19 12:51:29 UTC
Now fixed.