Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-58245

[XML] fractionDigits counts also the trailing 0s

    XMLWordPrintable

    Details

    • Commits:
      82c5cc6532ac5d0323ecda94b6767e1fdaef2639

      Description

      Using this schema:

      <?xml version="1.0" encoding="UTF-8"?>
      <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/FractionDigitsTest" xmlns:tns="http://www.example.org/FractionDigitsTest" elementFormDefault="qualified">
              <element name="number" type="tns:NumberType" />
              <complexType name="NumberType">
      		<sequence>
                              <element name="value">
      				<simpleType>
      					<restriction base="decimal">
                                                      <fractionDigits value="2"/>
      					</restriction>
      				</simpleType>
                              </element>
      		</sequence>
              </complexType>
      </schema>
      

      with this XML:

      <?xml version="1.0" encoding="UTF-8"?>
      <tns:number xmlns:tns="http://www.example.org/FractionDigitsTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/FractionDigitsTest FractionDigitsTest.xsd">
        <tns:value>1234.560000</tns:value>
      </tns:number>
      

      QXmlSchemaValidator returns invalid, despite of specs saying, that trailing 0s shouldn't be counted. https://www.w3.org/TR/xmlschema-2/#rf-fractionDigits

        Attachments

        For Gerrit Dashboard: QTBUG-58245
        # Subject Branch Project Status CR V

          Activity

            People

            • Assignee:
              karimpinter Karim Pinter
              Reporter:
              karimpinter Karim Pinter
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes