<?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>30069</bug_id>
          
          <creation_ts>2017-02-21 16:43:46 +0000</creation_ts>
          <short_desc>[FO31] Error codes for option parameters</short_desc>
          <delta_ts>2017-03-15 18:34:06 +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>Functions and Operators 3.1</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</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>editorial</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>andrew_coleman</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>128459</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2017-02-21 16:43:46 +0000</bug_when>
    <thetext>Rule 6 for the option parameter conventions (§1.5) states:

For each named option, the function specification defines a required type for the option value. The value that is actually supplied in the map is converted to this required type using the function conversion rules. A type error [err:XPTY0004] occurs if conversion of the supplied value to the required type is not possible, or if this conversion delivers a coerced function whose invocation fails with a type error. A dynamic error occurs if the supplied value after conversion is not one of the permitted values for the option in question: the error codes for this error are defined in the specification of each function.

Now suppose the supplied value is map{&quot;indent&quot;, xs:untypedAtomic(&apos;2&apos;)} (XSLT 3.0 test case xml-to-json-C104).

The second sentence of the rule above (&quot;The value that is actually supplied in the map is converted to this required type using the function conversion rules&quot;) implies an error FORG0001.

But the third sentence (&quot;A type error [err:XPTY0004] occurs if conversion of the supplied value to the required type is not possible&quot;) implies an error XPTY0004.

I think that the third sentence was intended as a gloss on the second, and the second sentence is normative. Suggested rewording:

For each named option, the function specification defines a required type for the option value. The value that is actually supplied in the map is converted to this required type using the function conversion rules. This may result in an error (typically [err:XPTY0004] or [err:FORG0001]) if conversion of the supplied value to the required type is not possible. A type error [err:XPTY0004] also occurs if the conversion delivers a coerced function whose invocation fails with a type error. A dynamic error occurs if the supplied value after conversion is not one of the permitted values for the option in question: the error codes for this error are defined in the specification of each function.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128471</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2017-03-07 16:21:35 +0000</bug_when>
    <thetext>Liam noted &quot;This may result&quot; -&gt; &quot;This will result&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128473</commentid>
    <comment_count>2</comment_count>
    <who name="Andrew Coleman">andrew_coleman</who>
    <bug_when>2017-03-07 16:37:49 +0000</bug_when>
    <thetext>The WG agreed that this is editorial</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128485</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2017-03-15 18:34:06 +0000</bug_when>
    <thetext>The changes have been applied.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>