W3C home > Mailing lists > Public > public-qt-comments@w3.org > March 2015

[Bug 28196] New: [F+O3.1] Do the function conversion rules apply to parameters in option maps?

From: <bugzilla@jessica.w3.org>
Date: Thu, 12 Mar 2015 00:38:59 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-28196-523@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=28196

            Bug ID: 28196
           Summary: [F+O3.1] Do the function conversion rules apply to
                    parameters in option maps?
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators 3.1
          Assignee: mike@saxonica.com
          Reporter: mike@saxonica.com
        QA Contact: public-qt-comments@w3.org

A number of functions (e.g. parse-json, load-xquery-module, transform, ... are
defined to take a map as an argument to define options on how the function
behaves. Generally the map is a set of key/value pairs, the keys are strings,
and for each defined key name there is a required type for the corresponding
value, for example boolean or string.

We need to decide whether the supplied value in such an option is converted to
the required type using the function conversion rules, or whether the supplied
value must actually be an instance of the required type.

Currently the way the specs are written, there is no conversion.

The only time I've encountered a problem with this is where the required type
is a function: for example the fallback function in the options of parse-json
and json-to-xml must be of type function(xs:string) as xs:string. Because
function coercion is not applied, this makes it invalid, for example, to supply
a function whose signature is function(xs:string?) as xs:string? -- because
this does not conform to the required type. Supplying functions for these
parameters therefore requires much more careful attention to detail, and
understanding of the subtyping rules, than is the case when function are
supplied directly as arguments of a higher-order function.

(Note also, in XQuery -- unlike XSLT -- the function conversion rules are not
applied when binding a value to a variable, so a similar problem applies here.)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Thursday, 12 March 2015 00:39:06 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:53 UTC