users@jaxb.java.net

UnmarshalException when unmarshalling castor-generated xml data

From: Houle, Felix <FHoule_at_oerlikon.ca>
Date: Wed, 19 Nov 2003 14:53:10 -0500

I get an UnmarshalException when im trying to unmarshal a XML data stream that was marshalled using "Castor" library (version 0.9.5.2).

(See attachments for the corresponding schemas and the generated XML data from Castor)

The schema UUTVersionResponse.xsd defines the element UUTVersion which correspond to the type UUTVersionResponse.
When Castor generates (or marshal) the XML data, it set the XML tag name to "UUTVersionResponse".
However, JAXB is expecting "UUTVersion" XML tag name. This generate the UnmarshalException when im using JAXB-generated classes to unmarshall the XML data.

Any idea or workaround?

Thanks

Exception trace:

DefaultValidationEventHandler: [ERROR]: tag name "UUTVersionResponse" is not allowed. Possible tag names are: <ModemStatusCmd>,<ModemStatusResponse>,<PingCmd>,<QualTestResultResponse>,<StartQualTestCmd>,<StopQualTestCmd>,<UUTVersion>
     Location:
Caught UnmarshalException

Castor generated xml:

<?xml version="1.0" encoding="UTF-8"?>
<UUTVersionResponse TWCVersion="1.0">
    <head timeStamp="1069258679160" handle="0"/>
</UUTVersionResponse>

It works if the XML data (generated by Jaxb) is:
<?xml version="1.0" encoding="UTF-8"?>
<UUTVersion TWCVersion="1.0">
    <head timeStamp="1069258679160" handle="0"/>
</UUTVersion>



 <<Command.xsd>> <<UUTVersionResponse.xsd>>





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net