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 29736 - [FO31] C.2 Schema for the result of fn:json-to-xml
Summary: [FO31] C.2 Schema for the result of fn:json-to-xml
Status: CLOSED FIXED
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-07-18 10:45 UTC by Tim Mills
Modified: 2016-12-16 19:55 UTC (History)
0 users

See Also:


Attachments

Description Tim Mills 2016-07-18 10:45:11 UTC
Shouldn't key be use="required" in the following?

    <xs:attributeGroup name="key-group">
        <xs:attribute name="key" type="xs:string"/>
        <xs:attribute name="escaped-key" type="xs:boolean" use="optional" default="false"/>
    </xs:attributeGroup>
Comment 1 Tim Mills 2016-07-18 11:46:22 UTC
Also, we read

  <xs:simpleType name="finiteNumberType">
        <xs:restriction base="xs:double">
            <!-- exclude positive and negative infinity, and NaN -->
            <xs:minExclusive value="-INF"/>
            <xs:maxExclusive value="INF"/>
        </xs:restriction>

But NaN is not excluded.
Comment 2 Michael Kay 2016-07-18 12:05:50 UTC
Yes, I think it should (I always forget that attributes are optional by default, XSD is so inconsistent...)
Comment 3 Michael Kay 2016-07-20 10:43:07 UTC
I have added use="required" as suggested in comment #0 (the WG agreed this change).

I had overlooked comment #1, and this didn't come up in discussion. I believe the schema is correct here. Any minInclusive or maxInclusive constraint for xs:double has the effect of excluding NaN. For example, minExclusive says:

A value in an ·ordered· ·value space· is facet-valid with respect to ·minExclusive· if and only if the value is greater than {value}, according to the datatype's order relation.

NaN is not greater than negative infinity, therefore specifying a minExclusive of -INF also excludes NaN.

This is elaborated in XSD 1.1 part 2 section 3.3.4.1

Note: Any value ·incomparable· with the value used for the four bounding facets (·minInclusive·, ·maxInclusive·, ·minExclusive·, and ·maxExclusive·) will be excluded from the resulting restricted ·value space·.  In particular, when NaN is used as a facet value for a bounding facet, since no float values are ·comparable· with it, the result is a ·value space· that is empty.  If any other value is used for a bounding facet, NaN will be excluded from the resulting restricted ·value space·; to add NaN back in requires union with the NaN-only space (which may be derived using the pattern 'NaN'). 

I'm marking this RESOLVED, but please re-open if you think this is still a problem.