[prev in list] [next in list] [prev in thread] [next in thread]
List: xmlbeans-dev
Subject: [jira] Commented: (XMLBEANS-175) Validation of decimal in exponential representation fails
From: "Wing Yew Poon (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date: 2005-11-30 1:50:33
Message-ID: 487273573.1133315433604.JavaMail.jira () ajax ! apache ! org
[Download RAW message or body]
[ 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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic