Hey thanks. i got it.
this is the mapping file i wrote for the xml i mentioned.
<?xml version="1.0" encoding="UTF-8"?>
<mapping >
<class name="xyz.Simple">
<map-to xml="abc" />
<field name="sample" type="xyz.Sample" >
<bind-xml name="bcd" node="element"/>
</field>
</class>
<class name="xyz.Sample">
<map-to xml="bcd" />
<field name="tex" type="java.lang.String" >
<bind-xml node="text" />
</field>
<field name="atr" type="java.lang.String" >
<bind-xml name="rs" node="attribute" />
</field>
</class>
</mapping>
and it works fine.
Regards,
Manu
Werner Guttmann wrote:
>
> Hi,
>
> have a look at the documentation of the <bind-xml> element of the
> mapping file, available at
>
> http://castor.org/xml-mapping.html#The-%3Cbind-xml%3E-element
>
> The 'content' attribute allows you to specify whether a given field of
> your Java class is mapped to an element, an attribute or content.
>
> Now there's nothing that prevents you from using a combination of fields
> (and their associated bindings) so that you are dealing with element and
> text content.
>
> I hope this makes things a bit clearer.
>
> Regards
> Werner Guttmann
>
>
> ManuRom wrote:
>> HI,
>> in my xml tag if it contains field as shown how it will be handled
>> <abc>
>> <bcd rs="attribute">node</bcd>
>> </abc>
>>
>> how do i write mapping file for this.
>>
>> Thanking you,
>> Regards,
>> Manu
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
>
--
View this message in context:
http://www.nabble.com/how-do-we-handle-mixed%3Dtrue-in-mapping-tp15434524p15458925.html
Sent from the Castor - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email