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

Validation of decimal in exponential representation fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Version 2
    • Version 2.4
    • Validator
    • None

    Description

      Having an attribute of type xsd:decimal. Validating a document having set the attribute to "4.2E1" fails with error message "unexpected char '69'" (char '69' is the E). Value "42" works fine.

      Other XML parsers validate "4.2E1" successfully.

      Parsing fails in org.apache.xmlbeans.impl.values.JavaDecimalHolder#validateLexical(String, ValidationContext).

      BTW: according to my XML documentation, type xsd:decimal is "same as java.math.BigDecimal".
      If this info is correct: IMHO it would be better to rely the BigDecimal-parsing capability ... ?

      Attachments

        1. TestExponent.jar
          5.94 MB
          Johannes Stamminger
        2. XMLBeansExponentTest.java
          1 kB
          Johannes Stamminger
        3. TestExponent.xsd
          0.6 kB
          Johannes Stamminger

        Activity

          People

            radup Radu Preotiuc
            jstammi Johannes Stamminger
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: