Hello Arnaud,
thanks for your reply
I retreived the version from cvs and the result is exactly the same
(generated classes and exception).
I try to unmarchal the xml like this :
DataUpload dl = DataUpload.unmarshal(new
FileReader("e:\\castor\\event_upload.xml"));
and the result is :
ValidationException: tr_id is a required field.
I think the attribute "_trId" should be in the Transaction class and not in
the TransactionItem class, am I right ?
Marc
----- Original Message -----
From: "Arnaud Blandin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 28, 2001 3:14 PM
Subject: Re: [castor-dev] How to unmarshall this xml?
> Hi Marc,
>
> can you try the CVS version and let me know if
> you still encounter this problem.
> I fixed a bug some weeks ago that might solve your problem.
>
> Arnaud
> -----Original Message-----
> From: marc2076 [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 28, 2001 2:51 PM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] How to unmarshall this xml?
>
>
> How to unmarshall this xml?
>
> <?xml version="1.0" encoding="UTF-8"?>
> <data_upload xmlns="http://www.tech-leap.com"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.tech-leap.com e:\castor\upload_event.xsd">
> <transaction tr_id="tr1">
> <create_new_product>radio v55</create_new_product>
> <create_new_customer>john</create_new_customer>
> <create_new_customer>bill</create_new_customer>
> <create_new_product>tv2000</create_new_product>
> </transaction>
> </data_upload>
>
> This is my xml schema:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!--DOCTYPE schema PUBLIC "-//W3C/DTD XML Schema Version 1.0//EN"
>
> "http://www.w3.org/TR/2000/WD-xmlschema-1-20000225/structures.dtd"-->
> <xs:schema targetNamespace="http://www.tech-leap.com"
> xmlns="http://www.tech-leap.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
> <xs:element name="data_upload">
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="transaction"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="transaction">
> <xs:complexType>
> <xs:choice maxOccurs="unbounded">
> <xs:element ref="create_new_customer" minOccurs="0"/>
> <xs:element ref="create_new_product" minOccurs="0"/>
> </xs:choice>
> <xs:attribute name="tr_id" type="xs:string" use="required"/>
> </xs:complexType>
> </xs:element>
> <xs:element name="create_new_customer" type="xs:string"/>
> <xs:element name="create_new_product" type="xs:string"/>
> </xs:schema>
>
> I generated the classes using the generator but the attribute "tr_id"
causes
> troubles. It's also seems to me that this attribute is not in the correct
class.
>
> It generated a DataUpload class, which contains a Transaction class. So
far so
> goog. The Transaction class should contain a _trId String and an item list
but
> it contains only the item list.The _trId field is in the TransactionItem
class
> with the createNewCustomer list and the createNewProduct list.
>
> The trId is duplicated but it could work if the value is the same in all
items.
> This is not the case. It stops during the umarshall process with the
message
> "tr_id is a required field".
>
> King regards,
>
> Marc
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev