This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In FNO 3.1, 17.5.3 fn:json-to-xml: "The XDM tree returned by the function does not contain any unnecessary (albeit valid) nodes such as whitespace text nodes, comments, or processing instructions, or attributes (escaped and escaped-key) whose value is equal to the default value (false)." In XDM 3.1, 6.2.4 Construction from a PSVI: attributes "Default and fixed attributes provided by XML Schema processing are added to the [attributes]" Example 1: import schema namespace fn = "http://www.w3.org/2005/xpath-functions"; validate { json-to-xml('"foo"', map { 'validate' : false() }) } Result: <string escaped="false" xmlns="http://www.w3.org/2005/xpath-functions">foo</string> Example 2: json-to-xml('"foo"', map { 'validate' : true() }) Result 2: <string xmlns="http://www.w3.org/2005/xpath-functions">foo</string> And, the following expression will often return false: deep-equal( json-to-xml(json, map { 'validate' : true() }), validate { json-to-xml(json, map { 'validate' : false() }) } ) I think the WG should make the behavior of the 'validate' flag consistent with validation by either removing the default from the schema or by adding the defaults in the definition of json-to-xml.
The WG decided: if the result is typed, the defaulted attributes must be present; if the result is untyped, the defaulted attributes must be absent.
To implement the decision, I propose to change the paragraph The XDM tree returned by the function does not contain any unnecessary (albeit valid) nodes such as whitespace text nodes, comments, or processing instructions, or attributes (escaped and escaped-key) whose value is equal to the default value (false). It does not include any whitespace in the value of number or boolean element nodes. to read: The XDM tree returned by the function does not contain any unnecessary (albeit valid) nodes such as whitespace text nodes, comments, or processing instructions. It does not include any whitespace in the value of number or boolean element nodes, or in the values of the *escaped* and *escaped-key* attribute nodes. If the result is typed, every element named *string* will have an attribute named *escaped* whose value is either "true" or "false", and every element having an attribute named *key* will also have an attribute named *escaped-key* whose value is either "true" or "false". If the result is untyped, the attributes *escaped* and *escaped-key* will never be present with the value "false". (In cases where the value false would be appropriate, the attribute will be absent). The changes have been applied.
Sounds good to me. Thanks.