Hi,

what if I asked you to author a new XML HOW-TO document about exactly this 'problem' ? Would you be willing to spend the odd 15 or 20 minutes and help us (the community) ?

Werner

ManuRom wrote:
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






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

   http://xircles.codehaus.org/manage_email


Reply via email to