Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-350

xs:integer with decimals not marked invalid by validator tool

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • Version 2.3
    • Version 2.5.1
    • Validator
    • None
    • Windows XP

    Description

      The following sample xml:
      <?xml version="1.0" encoding="utf-8"?>
      <foo xmlns="test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="test file:///D:/temp/test.xsd">
      <bar>123.00</bar>
      </foo>
      is validated against:
      <?xml version = "1.0" encoding = "utf-8"?>
      <xs:schema xmlns="test" targetNamespace="test" xmlns:xs="http://www.w3.org/2001/XMLSchema"
      elementFormDefault="qualified" attributeFormDefault="unqualified">
      <xs:element name="foo">
      <xs:complexType>
      <xs:sequence>
      <xs:element name="bar" type="barType" minOccurs="1" maxOccurs="1"/>
      </xs:sequence>
      </xs:complexType>
      </xs:element>
      <xs:simpleType name="barType">
      <xs:restriction base="xs:integer">
      <xs:totalDigits value="3"/>
      </xs:restriction>
      </xs:simpleType>
      </xs:schema>

      which IMHO should result in 'invalid'. The xmlbeans 2.2.0 and 2.3.0 validator tool return 'valid' however. This is not according to W3c specs:
      "integer is derived from decimal by fixing the value of - fractionDigits- to be 0 and disallowing the trailing decimal point. "

      Attachments

        1. test.xsd
          0.6 kB
          Mark Nauta
        2. test-s.xml
          0.2 kB
          Mark Nauta

        Activity

          People

            cezar Cezar Cristian Andrei
            marknauta Mark Nauta
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: