You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Peter Fielding (JIRA)" <xm...@xml.apache.org> on 2011/09/08 22:30:09 UTC
[jira] [Created] (XMLBEANS-469) ElementImpl.getMinOccurs() causes
XmlValueNotSupportedException
ElementImpl.getMinOccurs() causes XmlValueNotSupportedException
---------------------------------------------------------------
Key: XMLBEANS-469
URL: https://issues.apache.org/jira/browse/XMLBEANS-469
Project: XMLBeans
Issue Type: Bug
Components: XmlObject
Affects Versions: Version 2.4
Environment: Linux
Reporter: Peter Fielding
This code:
if (elem.isSetMaxOccurs()) {
Object o = elem.getMinOccurs();
if (o instanceof Number) {
myElem.setMinOccurs(((Number) o).intValue());
}
}
causes this exception:
org.apache.xmlbeans.impl.values.XmlValueNotSupportedException: Could not get a Java numeric type from a Schema unknown type
at org.apache.xmlbeans.impl.values.XmlObjectBase.getBigDecimalValue(XmlObjectBase.java:1392)
at org.apache.xmlbeans.impl.values.XmlObjectBase.bigDecimalValue(XmlObjectBase.java:1545)
at org.apache.xmlbeans.impl.values.XmlObjectBase.getBigIntegerValue(XmlObjectBase.java:1397)
at org.apache.xmlbeans.impl.xb.xsdschema.impl.ElementImpl.getMinOccurs(ElementImpl.java:942)
in line 2, where elem.getMinOccurs() is called. A similar code for maxOccurs works just fine. Exception will be thrown as soon as minOccurs is set to a random positive integer value in the XSD file (e.g. 1, 5 and so on).
--
This message is automatically generated by JIRA.
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] [Closed] (XMLBEANS-469) ElementImpl.getMinOccurs() causes
XmlValueNotSupportedException
Posted by "Peter Fielding (JIRA)" <xm...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XMLBEANS-469?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Peter Fielding closed XMLBEANS-469.
-----------------------------------
Resolution: Not A Problem
Faulty XSD file caused exception. However setting maxOccurs() does not cause any trouble.
> ElementImpl.getMinOccurs() causes XmlValueNotSupportedException
> ---------------------------------------------------------------
>
> Key: XMLBEANS-469
> URL: https://issues.apache.org/jira/browse/XMLBEANS-469
> Project: XMLBeans
> Issue Type: Bug
> Components: XmlObject
> Affects Versions: Version 2.4
> Environment: Linux
> Reporter: Peter Fielding
> Labels: XmlValueNotSupportedException,, getMinOccurs
>
> This code:
> if (elem.isSetMaxOccurs()) {
> Object o = elem.getMinOccurs();
> if (o instanceof Number) {
> myElem.setMinOccurs(((Number) o).intValue());
> }
> }
> causes this exception:
> org.apache.xmlbeans.impl.values.XmlValueNotSupportedException: Could not get a Java numeric type from a Schema unknown type
> at org.apache.xmlbeans.impl.values.XmlObjectBase.getBigDecimalValue(XmlObjectBase.java:1392)
> at org.apache.xmlbeans.impl.values.XmlObjectBase.bigDecimalValue(XmlObjectBase.java:1545)
> at org.apache.xmlbeans.impl.values.XmlObjectBase.getBigIntegerValue(XmlObjectBase.java:1397)
> at org.apache.xmlbeans.impl.xb.xsdschema.impl.ElementImpl.getMinOccurs(ElementImpl.java:942)
> in line 2, where elem.getMinOccurs() is called. A similar code for maxOccurs works just fine. Exception will be thrown as soon as minOccurs is set to a random positive integer value in the XSD file (e.g. 1, 5 and so on).
--
This message is automatically generated by JIRA.
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