Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion about fn-function-lookup-761 in relation to fn-function-lookup-759 #58

Open
nkutsche opened this issue Dec 11, 2023 · 0 comments

Comments

@nkutsche
Copy link

Hi, I'm a bit confused about the combination of the test cases fn-function-lookup-759 and fn-function-lookup-761.

The fn-function-lookup-759 says that in any case you should be able to lookup for the function load-xquery-module:

  <test-case name="fn-function-lookup-759" 
             covers="fn-load-xquery-module">
    <description>Attempts to look up function fn:load-xquery-module#1.</description>
    <created by="Tim Mills" on="2016-08-19"/>
    <dependency type="spec" value="XP31+ XQ31+"/>
    <test>exists(function-lookup(fn:QName('http://www.w3.org/2005/xpath-functions', 'load-xquery-module'), 1))</test>
    <result>
      <assert-true/>
    </result>
  </test-case>

Reminder:
The function signature of load-xquery-module#1 is fn:load-xquery-module($module-uri as xs:string) as map(*).

The test case fn-function-lookup-761 says now if you do not support the feature fn-load-xquery-module and make the same lookup as in fn-function-lookup-759 but now call the function with a wrong typed argument, this function must throw an error code FOQM0006:

  <test-case name="fn-function-lookup-761" 
             covers="fn-load-xquery-module"
             covers-30="dynamic-function-call">
    <description>Attempts to invoke function fn:load-xquery-module#1.</description>
    <created by="Tim Mills" on="2016-08-19"/>
    <dependency type="spec" value="XP31+ XQ31+"/>
    <dependency type="feature" value="fn-load-xquery-module" satisfied="false"/>  
    <test>function-lookup(fn:QName('http://www.w3.org/2005/xpath-functions', 'load-xquery-module'), 1)( 0 )</test>
    <result>
      <error code="FOQM0006" />
    </result>
  </test-case>

On my point of view, the error code XPTY0004 for the failed type conversion should be also acceptable, shouldn't it? Otherwise the function returned by function-lookup(fn:QName('http://www.w3.org/2005/xpath-functions', 'load-xquery-module'), 1) must have a signiture which is more lax as the specification requires.

nkutsche added a commit to nkutsche/xpath-model that referenced this issue Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant