I'm having alot of problems creating the right list element in my schema
that can be correctly unmarshalled from an xml file. The schema is
valid and well-formed, and I've tested the xml document against it using
xmlSpy with no problems. I used SourceGenerator to create the beans,and
created a test to read the xml file and unmarshall it. Well it crashes
when it gets to my <xsd:list> element, citing a NumberFormatException.
****************************************************************
*** excerpt of xsd used to create beans through SourceGenerator:
****************************************************************
<xsd:element name="grades">
<xsd:simpleType>
<xsd:list itemType="xsd:float"/>
</xsd:simpleType>
</xsd:element>
-OR-
<xsd:element name="grades">
<xsd:simpleType>
<xsd:restriction base="gradeList">
<xsd:length value="10"/>
</xsd:restriction"/>
</xsd:simpleType>
</xsd:element>
<xsd:simpleType name="gradeList">
<xsd:list itemType="xsd:float"/>
</xsd:simpleType>
Compiles fine creating a java.util.ArrayList object for grades, but
neither of above works during runtime unless there is a single data item
in the xml file.
*****************
*** xml testfile:
*****************
<grades>65.3 86.2 95.6</grades> - errors
- On the other hand -
<grades>65.3</grades> - no errors, will unmarshal and marshal fine
The parser will not parse the list into the bean, it wants only a single
value for the grades element. Does anyone have a clue what I'm doing
wrong?
Thanks
Tony Vann
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user