[Bug 29007] New: json-to-xml definition is inconsistent with construction from PSVI

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29007

            Bug ID: 29007
           Summary: json-to-xml definition is inconsistent with
                    construction from PSVI
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators 3.1
          Assignee: mike@saxonica.com
          Reporter: josh.spiegel@oracle.com
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---
             Group: XSLXQuery_WG

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.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 30 July 2015 16:31:36 UTC