Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6948474

XSD: fractionDigits cannot be other than 0 for byte, short and etc.(i.e. a whole number)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7
    • Fix Version/s: 9
    • Component/s: xml
    • Labels:

      Description

      The tests listed below all should fail for the same reason. This example is from /xml_schema/msData/datatypes/Facets/Schemas/short_fractionDigits007_773_short_fractionDigits007_773

      The schema is trying to set fractionDigits="5" for an xs:short.
      <xsd:restriction base="xsd:short">
                 <xsd:fractionDigits value="5"/>
                 <xsd:totalDigits value="5"/>
      </xsd:restriction>

      However, a short is an integer (i.e. a whole number). It cannot specify a value for fractionDigits other than 0.

      Definition of xs:integer from the Schema for Schemas:

        <xs:simpleType name="integer" id="integer">
          <xs:annotation>
            <xs:documentation source="http://www.w3.org/TR/xmlschema-2/#integer"/>
          </xs:annotation>
          <xs:restriction base="xs:decimal">
            <xs:fractionDigits fixed="true" value="0" id="integer.fractionDigits"/>
            <xs:pattern value="[\-+]?[0-9]+"/>
          </xs:restriction>
        </xs:simpleType>

      Not all of the tests involve shorts, but all look to be some sort of integer.
      Test affected(26):
      ./xml_schema/msData/datatypes/Facets/Schemas/unsignedByte_fractionDigits004_982_unsignedByte_fractionDigits004_982.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/short_fractionDigits007_773_short_fractionDigits007_773.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/integer_fractionDigits007_570_integer_fractionDigits007_570.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/short_fractionDigits004_770_short_fractionDigits004_770.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/negativeInteger_fractionDigits004_631_negativeInteger_fractionDigits004_631.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/unsignedLong_fractionDigits007_877_unsignedLong_fractionDigits007_877.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/long_fractionDigits004_667_long_fractionDigits004_667.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/unsignedLong_fractionDigits004_874_unsignedLong_fractionDigits004_874.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/int_fractionDigits004_734_int_fractionDigits004_734.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/integer_fractionDigits004_567_integer_fractionDigits004_567.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/nonPositiveInteger_fractionDigits007_602_nonPositiveInteger_fractionDigits007_602.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/nonNegativeInteger_fractionDigits007_841_nonNegativeInteger_fractionDigits007_841.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/long_fractionDigits007_670_long_fractionDigits007_670.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/byte_fractionDigits007_809_byte_fractionDigits007_809.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/nonPositiveInteger_fractionDigits004_599_nonPositiveInteger_fractionDigits004_599.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/unsignedInt_fractionDigits007_913_unsignedInt_fractionDigits007_913.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/positiveInteger_fractionDigits007_1017_positiveInteger_fractionDigits007_1017.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/unsignedShort_fractionDigits004_946_unsignedShort_fractionDigits004_946.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/nonNegativeInteger_fractionDigits004_838_nonNegativeInteger_fractionDigits004_838.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/negativeInteger_fractionDigits007_634_negativeInteger_fractionDigits007_634.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/unsignedByte_fractionDigits007_985_unsignedByte_fractionDigits007_985.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/unsignedInt_fractionDigits004_910_unsignedInt_fractionDigits004_910.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/unsignedShort_fractionDigits007_949_unsignedShort_fractionDigits007_949.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/int_fractionDigits007_737_int_fractionDigits007_737.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/byte_fractionDigits004_806_byte_fractionDigits004_806.jtr
      ./xml_schema/msData/datatypes/Facets/Schemas/positiveInteger_fractionDigits004_1014_positiveInteger_fractionDigits004_1014.jtr

      All these test should fail but xjc ignores the schema error

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                joehw Joe Wang
                Reporter:
                lkuskov Leonid Kuskov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: