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 29684 - [FO31] options arguments
Summary: [FO31] options arguments
Status: CLOSED WONTFIX
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-03 14:22 UTC by Tim Mills
Modified: 2016-06-14 15:22 UTC (History)
0 users

See Also:


Attachments

Description Tim Mills 2016-06-03 14:22:34 UTC
I suggest the options arguments in the following be changed to accept map(*)?, such that the unary version of each function is the same as a call to the binary version with empty sequence as the options argument.  This would follow the behaviour of fn:serialize.

fn:parse-json($json-text as xs:string?, $options as map(*)) as item()?

fn:json-doc($href as xs:string?, $options as map(*)) as item()?

fn:json-to-xml(	$json-text	 as xs:string?,
$options	 as map(*)) as document-node()?

fn:xml-to-json($input as node()?, $options as map(*)) as xs:string?

fn:load-xquery-module($module-uri as xs:string, $options as map(*)) as map(*)
Comment 1 Tim Mills 2016-06-08 10:09:04 UTC
As requested, I made a list of functions in which an "optional" argument could be made to accept the empty sequence.  This list was huge.

Additionally, there is also an often-followed convention that foo() is equivalent to foo(.), e.g. fn;node.  Furthermore, there are some cases such as adjust-*-to-timezone which already accept empty-sequence in the "optional" argument, but ascribe a particular meaning to it which is different from the single argument version.

However, the original request is still sensible and in keeping with fn:serialize.
Comment 2 Tim Mills 2016-06-14 15:22:27 UTC
The WG decided not to make the change in the interests of stability of the specification.