[Bug 29009] New: fn:xml-to-json should not be restricted to xs:untyped

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

            Bug ID: 29009
           Summary: fn:xml-to-json should not be restricted to xs:untyped
           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 section "17.5.4 fn:xml-to-json" it says:

"An element node whose name matches the name of a global element declaration in
the schema given in C.2 Schema for the result of fn:json-to-xml, whose type
annotation is xs:untyped..."

This requirement is a problem for implementations that have a default
construction mode of "preserve".  

Consider this query from XQTS (xml-to-json-021):

    xml-to-json(<null xmlns="http://www.w3.org/2005/xpath-functions"/>)

The expected result is "null", however this implicitly assumes the default
construction mode is strip.  Many implementations use a default construction
mode of "preserve" in which case this query would raise FOJS0006 since the type
annotation of the element would be xs:anyType instead of xs:untyped. 

I am aware of three implementations that use "preserve" as the default
construction mode.  I think the definition of xml-to-json should be modified to
allow xs:anyType.

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

Received on Thursday, 30 July 2015 22:59:13 UTC