Hi,

I just took your classes, and got it running with the following field mappings 
for 'logs':

<field name="logs" type="xml.estado.Log" collection="collection" 
container="true">
   <bind-xml name="log" node="element" />
</field>

If you don't set the container="true", Castor will assume that there's an outer 
'bracket' for the Log instances, whcih in your case you don't want.

Regards
Werner

> -----Original Message-----
> From: nuno pires [mailto:[EMAIL PROTECTED] 
> Sent: Montag, 22. Jänner 2007 16:00
> To: [email protected]
> Subject: [castor-user] Problems with mapping file
> 
> Hello,
> 
> I am having problems creating my castor mapping file to to 
> conver a xml request to Java classes.
> 
> ->The xml request is the following one:
> 
> <Response command-group='execution' application-id='Dummy' 
> operation='GET' client-id='test_client' correlation-id='123' 
> session-id='dummy'>
>     <id>9398383983</msisdn>
>     <status>2</estado>
>     <log>34434,8,23.1256,-8.09335</bts>
>     <log>1034343,9,34.7294,-9.2997</bts>
>     <RESULT>0</RESULT>
> </Response>
> 
> ->The Java Code:
> 
> public class Response{
>     
>     private String command_group;
>     private String application_id;
>     private String operation;
>     private String client_id;
>     private String status;
>     private String id;
>     private String result;
>     private List logs = new ArrayList();
> 
> public class log{
>     
>     private String description;
> 
> 
> ->And my mapping file:
> 
> <?xml version="1.0"?>
> http://castor.exolab.org/mapping.dtd";>
> <mapping>
>     <description>A mapping file for our Address Book 
> application</description>
>     <class name="castor.mapping.log">
>         <field name="description" type="string">
>         <bind-xml name="log" node="element" /></field>
>     </class>
>     <class name="castor.mapping.RequestHomeSubscriber">
>     <map-to xml="Response"/>
>         <field name="application_id" type="string"><bind-xml 
> name="application-id" node="attribute" /></field>
>         <field name="client_id" type="string"><bind-xml 
> name="client-id" node="attribute" /></field>
>         <field name="command_group" type="string"><bind-xml 
> name="command-group" node="attribute"/></field>
>         <field name="operation" type="string"><bind-xml 
> name="operation" node="attribute"/></field>
>         <field name="msisdn" type="string"><bind-xml 
> name="msisdn" node="element"/></field>
>         <field name="status" type="string"><bind-xml 
> name="estado" node="element"/></field>
>         <field name="result" type="string"><bind-xml 
> name="RESULT" node="element"/></field>
>         <field name="logs" type="castor.mapping.log" 
> collection="collection"><bind-xml name="log" node="element"/></field>
>     </class>
> </mapping>
> 
> 
> I am getting the error: "Illegal Text data found as child of: ..."
> Anyone can help me fixing the map file?
> 
> Best Regards,
> Nuno
> 
> 
> 
> 
>  
> ______________________________________________________________
> ______________________
> Get your own web address.  
> Have a HUGE year through Yahoo! Small Business.
> http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to