Hi David,

In the Castor mapping file, just mark the field as a container:

  <field name="c" type="C" container="true"/>

--Keith


David Corbin wrote:
> 
> I'm looking at using Castor to generate an XML file from by business objects.
> We have several objects that follow this pattern:
> 
> class A {
>    B b;
>    Foo foo;
>    Bar bar;
> }
> class B {
>   C c;
> }
> class C {
>   String data;
> }
> 
> I want the output to look like this:
> <A>
>   <B="data">
>   <foo />
>   <bar />
> </A>
> 
> I do not want:
> 
> <A>
>   <B>
>     <C data="data"/>
>   </B>
>   <foo />
>   <bar />
> </A>
> 
> Essentially, I want to hide the fact that there is a C bean/class/object from
> the XML.  I do not need to read these XML files back with Castor.  It seems
> to me that I can do this with a FieldHandler, but then I have to write one
> for each type of object.  I want to use "nested properties" in my spec
> somehow.  Is there some support for this?
> 
> Thanks
> David
> 
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-user



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to