Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Invalid
-
Version 2.2
-
None
-
None
-
Linux-Debian/Ubuntu 6.10/X86_64
Description
I have a provided schema that contains a Duration, comprising of start and end xs:date fields. The schema compiled perfectly and Im pulling out all data. The only problem is xs:date fields. As soon as I access getStart (xs:date) I get the following stack:
Exception in thread "main" org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException: Invalid date value: wrong type: 2007-04-01
at org.apache.xmlbeans.impl.values.XmlObjectBase$ValueOutOfRangeValidationContext.invalid(XmlObjectBase.java:285)
at org.apache.xmlbeans.impl.values.JavaGDateHolderEx.lex(JavaGDateHolderEx.java:81)
at org.apache.xmlbeans.impl.values.JavaGDateHolderEx.set_text(JavaGDateHolderEx.java:56)
at org.apache.xmlbeans.impl.values.XmlObjectBase.update_from_wscanon_text(XmlObjectBase.java:1135)
at org.apache.xmlbeans.impl.values.XmlObjectBase.check_dated(XmlObjectBase.java:1274)
at org.apache.xmlbeans.impl.values.JavaGDateHolderEx.calendarValue(JavaGDateHolderEx.java:192)
at org.apache.xmlbeans.impl.values.XmlObjectBase.getCalendarValue(XmlObjectBase.java:1516)
at com.bvi.schemas.itds.interfaces.manifestFile.impl.DurationImpl.getStart(DurationImpl.java:42)
Given the only code I've actually written is the test code, and that I cannot change the schema. The xml document is valid according to the schema, and the actual date node text appears to be ISO8601 (YYYY-MM-DD). Is this a bug or am I missing something?
A workaround is to access the node directly, and get the child node values out. Schema, example XML and test code to be attached.