You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Johannes Stamminger (JIRA)" <xm...@xml.apache.org> on 2005/07/11 13:11:13 UTC

[jira] Created: (XMLBEANS-175) Validation of decimal in exponential representation fails

Validation of decimal in exponential representation fails
---------------------------------------------------------

         Key: XMLBEANS-175
         URL: http://issues.apache.org/jira/browse/XMLBEANS-175
     Project: XMLBeans
        Type: Bug
  Components: Validator  
    Versions: Version 2    
    Reporter: Johannes Stamminger


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.

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 ... ?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Assigned: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "Radu Preotiuc-Pietro (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-175?page=all ]

Radu Preotiuc-Pietro reassigned XMLBEANS-175:
---------------------------------------------

    Assign To: Radu Preotiuc-Pietro

> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>          Key: XMLBEANS-175
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-175
>      Project: XMLBeans
>         Type: Bug
>   Components: Validator
>     Versions: Version 2
>     Reporter: Johannes Stamminger
>     Assignee: Radu Preotiuc-Pietro
>  Attachments: TestExponent.jar, TestExponent.xsd, XMLBeansExponentTest.java
>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "Ian Jones (JIRA)" <xm...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XMLBEANS-175?page=comments#action_12415962 ] 

Ian Jones commented on XMLBEANS-175:
------------------------------------

I've been experiencing the same issue, and agree the exponents 1.5 BigDecimal spits out are not valid in xs:decimal.

However the above workaround does not always work:

java.lang.System.out.println(new java.math.BigDecimal("0.00000001").toString());
java.lang.System.out.println(new java.math.BigDecimal(new java.math.BigDecimal("1E-8").toPlainString()).toString());

Prints out:

1E-8
1E-8

I agree with Johannes that the long term solution is to use BigDecimal.toPlainString() when creating an xml document within the xml beans code (JavaDecimalHolder.compute_text). However, this would make xmlbeans incompatible with Java 1.4. Perhaps an 'is 1.5' option could be used when generating code and use toString and toPlainString when appropriate.

I also agree using XmlDecimal is a possible solution, but that rather bloats my code (3 lines for every 'set' that used to be 1 line). My current work around is to use a PlainBigDecimal class which extends BigDecimal and overrides toString to call toPlainString.

Ian

> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>          Key: XMLBEANS-175
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-175
>      Project: XMLBeans
>         Type: Bug

>   Components: Validator
>     Versions: Version 2
>     Reporter: Johannes Stamminger
>     Assignee: Radu Preotiuc-Pietro
>  Attachments: TestExponent.jar, TestExponent.xsd, XMLBeansExponentTest.java
>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Resolved: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "Radu Preotiuc-Pietro (JIRA)" <xm...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XMLBEANS-175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Radu Preotiuc-Pietro resolved XMLBEANS-175.
-------------------------------------------

       Resolution: Fixed
    Fix Version/s: TBD

Unfortunately, it wasn't a one-liner, because the code still has to compile under JDK 1.4 and then give the correct result when run with JDK 1.5. I had to implement the conversion from BigDecimal to String without using toString() or toPlainString(). SVN revision 641600.

> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>                 Key: XMLBEANS-175
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-175
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Validator
>    Affects Versions: Version 2
>            Reporter: Johannes Stamminger
>            Assignee: Radu Preotiuc-Pietro
>             Fix For: TBD
>
>         Attachments: TestExponent.jar, TestExponent.xsd, XMLBeansExponentTest.java
>
>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "Ian Sollars (JIRA)" <xm...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XMLBEANS-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12582007#action_12582007 ] 

Ian Sollars commented on XMLBEANS-175:
--------------------------------------

*bump*

As confirmed above I only have this with XMLBeans on 1.5.

This is a one-line fix on org.apache.xmlbeans.impl.values.JavaDecimalHolder:37:

protected String compute_text(NamespaceManager nsm) { return _value.toPlainString(); }

The only problem is, toPlainString doesn't exist in 1.4. You could compile in 1.5 with an if() on a static "JVM version" variable or something...

> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>                 Key: XMLBEANS-175
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-175
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Validator
>    Affects Versions: Version 2
>            Reporter: Johannes Stamminger
>            Assignee: Radu Preotiuc-Pietro
>         Attachments: TestExponent.jar, TestExponent.xsd, XMLBeansExponentTest.java
>
>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "Wing Yew Poon (JIRA)" <xm...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XMLBEANS-175?page=comments#action_12358866 ] 

Wing Yew Poon commented on XMLBEANS-175:
----------------------------------------

It seems to me that this problem does not occur when using XMLBeans (2.1 in my case) built with Java 1.4 (which is the case for the binary distribution).
In your test case,

    public void testDecimal() {
        final TestExponentDocument.TestExponent exponent = TestExponentDocument.TestExponent.Factory.newInstance();
        exponent.setDecimal(new BigDecimal("1E1"));
        final ArrayList errors = new ArrayList();
        final XmlOptions validationOptions = new XmlOptions();
        validationOptions.setErrorListener(errors);
        exponent.validate(validationOptions);
        assertEquals(0, errors.size()); // this passes in 1.4, fails in 1.5
        // the second half omitted, as BigDecimal.toPlainString() does not exist in 1.4
    }

the first assertEquals() passes, when I build everything in 1.4.


> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>          Key: XMLBEANS-175
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-175
>      Project: XMLBeans
>         Type: Bug
>   Components: Validator
>     Versions: Version 2
>     Reporter: Johannes Stamminger
>     Assignee: Radu Preotiuc-Pietro
>  Attachments: TestExponent.jar, TestExponent.xsd, XMLBeansExponentTest.java
>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "Johannes Stamminger (JIRA)" <xm...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XMLBEANS-175?page=comments#action_12316660 ] 

Johannes Stamminger commented on XMLBEANS-175:
----------------------------------------------

My documentation was not correct (and the other parser neighther), but I still believe xmlbeans should be changed concerning handling of decimals:

according http://www.w3.org/TR/xmlschema-2/#decimal exponential representation is not allowed. Though java.lang.BigDecimal does.

In my app I build up the document in memory using the xmlbeans created API. There the schema-decimal is mapped to java BigDecimals. When setting such value and having exponential representation, this string is complained about when validating the document (and is written to output on saving).

IMHO xmlbeans should not use the BigDecimal#toString() but BigDecimal#toPlainString() (1E1 becomes 10 this way) when validating/saving/... .

Workaround is to do so "from outside" at the moment, here some junit test for the attached schema/xmlbeans generated library that currently fails:

    public void testDecimal() {
        final TestExponentDocument.TestExponent exponent = TestExponentDocument.TestExponent.Factory.newInstance();
        exponent.setDecimal(new BigDecimal("1E1"));
        final ArrayList errors = new ArrayList();
        final XmlOptions validationOptions = new XmlOptions();
        validationOptions.setErrorListener(errors);
        exponent.validate(validationOptions);
        assertEquals(0, errors.size()); // fails, IMHO should not!

        // workaround
        exponent.setDecimal(new BigDecimal(new BigDecimal("1E1").toPlainString()));
        errors.removeAll(errors);
        exponent.validate(validationOptions);
        assertEquals(0, errors.size());
    }


One additional note on the error handling here: it is not very helpfull only to report the wrong char. Message should contain at least the complete number String.

> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>          Key: XMLBEANS-175
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-175
>      Project: XMLBeans
>         Type: Bug
>   Components: Validator
>     Versions: Version 2
>     Reporter: Johannes Stamminger
>  Attachments: TestExponent.jar, TestExponent.xsd, XMLBeansExponentTest.java
>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "Johannes Stamminger (JIRA)" <xm...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XMLBEANS-175?page=comments#action_12427901 ] 
            
Johannes Stamminger commented on XMLBEANS-175:
----------------------------------------------

I just tried to switch to XmlDecimal ... but it fails the same way as when using the reported mechanism:

        final XmlDecimal decimal = XmlDecimal.Factory.newInstance();
        decimal.setBigDecimalValue(new BigDecimal("4.0E+7"));
        assertFalse(decimal.xmlText().contains("E"));

 fails, the "4.0E+7" stays unchanged.

But the following works, event with the 1E-8 reported not doing so in my first workaround:

        decimal.setStringValue(new BigDecimal("4.0E+7").toPlainString());
        assertFalse(decimal.xmlText().contains("E"));
        decimal.setStringValue(new BigDecimal("1E-8").toPlainString());
        assertFalse(decimal.xmlText().contains("E"));


> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>                 Key: XMLBEANS-175
>                 URL: http://issues.apache.org/jira/browse/XMLBEANS-175
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Validator
>    Affects Versions: Version 2
>            Reporter: Johannes Stamminger
>         Assigned To: Radu Preotiuc-Pietro
>         Attachments: TestExponent.jar, TestExponent.xsd, XMLBeansExponentTest.java
>
>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Updated: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "Wing Yew Poon (JIRA)" <xm...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XMLBEANS-175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wing Yew Poon updated XMLBEANS-175:
-----------------------------------

    Fix Version/s:     (was: TBD)
                   Version 2.4 

Radu's fix is in 2.4.0.

> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>                 Key: XMLBEANS-175
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-175
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Validator
>    Affects Versions: Version 2
>            Reporter: Johannes Stamminger
>            Assignee: Radu Preotiuc-Pietro
>             Fix For: Version 2.4 
>
>         Attachments: TestExponent.jar, TestExponent.xsd, XMLBeansExponentTest.java
>
>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Updated: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "Johannes Stamminger (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-175?page=all ]

Johannes Stamminger updated XMLBEANS-175:
-----------------------------------------

    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 ... ?

  was:
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.

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 ... ?


> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>          Key: XMLBEANS-175
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-175
>      Project: XMLBeans
>         Type: Bug
>   Components: Validator
>     Versions: Version 2
>     Reporter: Johannes Stamminger

>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Updated: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "Johannes Stamminger (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-175?page=all ]

Johannes Stamminger updated XMLBEANS-175:
-----------------------------------------

    Attachment: TestExponent.jar
                XMLBeansExponentTest.java

> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>          Key: XMLBEANS-175
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-175
>      Project: XMLBeans
>         Type: Bug
>   Components: Validator
>     Versions: Version 2
>     Reporter: Johannes Stamminger
>  Attachments: TestExponent.jar, TestExponent.xsd, XMLBeansExponentTest.java
>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "Radu Preotiuc-Pietro (JIRA)" <xm...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XMLBEANS-175?page=comments#action_12319449 ] 

Radu Preotiuc-Pietro commented on XMLBEANS-175:
-----------------------------------------------

I think I understand; Johannes, have you tried using XmlDecimal instead? That shouldn't give you any trouble.

> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>          Key: XMLBEANS-175
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-175
>      Project: XMLBeans
>         Type: Bug
>   Components: Validator
>     Versions: Version 2
>     Reporter: Johannes Stamminger
>     Assignee: Radu Preotiuc-Pietro
>  Attachments: TestExponent.jar, TestExponent.xsd, XMLBeansExponentTest.java
>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "Wing Yew Poon (JIRA)" <xm...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XMLBEANS-175?page=comments#action_12415003 ] 

Wing Yew Poon commented on XMLBEANS-175:
----------------------------------------

In my last comment, I asserted that the first assertEquals() passes when I build everything in 1.4. This is true, but I think now that the reason is not that I build XMLBeans with 1.4 but that I build and run the test with 1.4 (and not 1.5).


> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>          Key: XMLBEANS-175
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-175
>      Project: XMLBeans
>         Type: Bug

>   Components: Validator
>     Versions: Version 2
>     Reporter: Johannes Stamminger
>     Assignee: Radu Preotiuc-Pietro
>  Attachments: TestExponent.jar, TestExponent.xsd, XMLBeansExponentTest.java
>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Updated: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "Johannes Stamminger (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-175?page=all ]

Johannes Stamminger updated XMLBEANS-175:
-----------------------------------------

    Attachment: TestExponent.xsd

> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>          Key: XMLBEANS-175
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-175
>      Project: XMLBeans
>         Type: Bug
>   Components: Validator
>     Versions: Version 2
>     Reporter: Johannes Stamminger
>  Attachments: TestExponent.jar, TestExponent.xsd, XMLBeansExponentTest.java
>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "andrew (JIRA)" <xm...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XMLBEANS-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643306#action_12643306 ] 

andrew commented on XMLBEANS-175:
---------------------------------

Hi, is this fix going to be released soon?

> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>                 Key: XMLBEANS-175
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-175
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Validator
>    Affects Versions: Version 2
>            Reporter: Johannes Stamminger
>            Assignee: Radu Preotiuc-Pietro
>             Fix For: TBD
>
>         Attachments: TestExponent.jar, TestExponent.xsd, XMLBeansExponentTest.java
>
>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "Bala Rathakrishnan (JIRA)" <xm...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XMLBEANS-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662479#action_12662479 ] 

Bala Rathakrishnan commented on XMLBEANS-175:
---------------------------------------------

Has this issue been fixed? I still see the Fix Version as TBD, but the issue has been marked as resolved.

> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>                 Key: XMLBEANS-175
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-175
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Validator
>    Affects Versions: Version 2
>            Reporter: Johannes Stamminger
>            Assignee: Radu Preotiuc-Pietro
>             Fix For: TBD
>
>         Attachments: TestExponent.jar, TestExponent.xsd, XMLBeansExponentTest.java
>
>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-175) Validation of decimal in exponential representation fails

Posted by "Kirk Wylie (JIRA)" <xm...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XMLBEANS-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463976 ] 

Kirk Wylie commented on XMLBEANS-175:
-------------------------------------

This also causes another problem, which is that the .NET/C# xml parsing DOES successfully disallow exponential notation for xs:decimal values when using the xsd.exe tool, which affected me today. I'm working around by using the toPlainString format as well, but it's definitely a flaw to EVER export an exponential number to an xs:decimal field.

> Validation of decimal in exponential representation fails
> ---------------------------------------------------------
>
>                 Key: XMLBEANS-175
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-175
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Validator
>    Affects Versions: Version 2
>            Reporter: Johannes Stamminger
>         Assigned To: Radu Preotiuc-Pietro
>         Attachments: TestExponent.jar, TestExponent.xsd, XMLBeansExponentTest.java
>
>
> 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 ... ?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org