Hi,

comments in-line.

Regards
Werner

fmarchioni wrote:
> Hi all !
> I have the following XML which is received from one system:
> 
> <ccsmp-create session="8u8989h789h9h8989">
>   <DialPlan ent-id="name" name="333"/>
> </ccsmp-create>
> 
> How can I Unmarshall the class DialPlan ?
> I have tried with this XML which works fine when you Marshal from Java to
> XML:
> 
>     <class name="com.sample.DialPlan">
>     <map-to xml="ccsmp-create" />
>           
>    <field name="sessionId" type="java.lang.String">
>         <bind-xml name="session" node="attribute"  />
>     </field>         
>     
>     <field name="entId" type="java.lang.String">
>         <bind-xml name="ent-id" node="attribute" location="DialPlan" />
>     </field>
>         <field name="name" type="java.lang.String">
>         <bind-xml name="name" node="attribute" location="DialPlan" />
>     </field>
>   </class> 
> 
> Unfortunately the reverse process (unmarshalling XML to Java) doesn't work ! 
> It just creates a DialPlan Object with null attributes.
> 
>  DialPlan plan = (DialPlan) 
>          Unmarshaller.unmarshal(DialPlan.class, 
>            new FileReader("data.xml"));

You are using one of the static unmarshal methods, which will ignore any
 mapping defined by you. Can you please switch to a non-static one, and
see whether it works ?
> 
> Please can anybody give me a hint ?
> thanks
> francesco

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

    http://xircles.codehaus.org/manage_email


Reply via email to