Hi,

I'm trying to marshall a collection and am having some trouble getting
the output I want.

Say my class looks like this:

class Stuff {
 public ArrayList<String> names;
}

I'd like to marshall this into xml that looks like this:

<stuff>
 <names>
   <item>
     <name>Bob</name>
   </item>
   <item>
     <name>Chuck</name>
   </item>
 </names>
</stuff>

The mapping snippet for names looks like this:

<field name="names" direct="true" type="java.lang.String"
collection="arraylist">
       <bind-xml name="name" location="names/item" node="element" />
</field>

Which produces output that looks like this:

<stuff>
 <names>
   <item>
     <name>Bob</name>
     <name>Chuck</name>
   </item>
 </names>
</stuff>

I'm not sure how to use the location field, or even a specific mapping
for java.lang.String to have multiple item elements.

If anyone can help with this, it would be much appreciated.

Regards,
Liehann

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

    http://xircles.codehaus.org/manage_email


Reply via email to