[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    [jira] Commented: (XMLBEANS-175) Validation of decimal in
From:       "Johannes Stamminger (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date:       2006-08-14 14:30:16
Message-ID: 26679772.1155565816383.JavaMail.jira () brutus
[Download RAW message or body]

    [ 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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic