Java Mailing List Archive

Home » user.castor »

[castor-user] One Array List Collection Field Multiple XML Elements

Tim Milstead


Replies: Find Java Web Hosting

Author LoginPost Reply
I have a single array list collection field, e.g. addressLines that I
want to unmarshall from multiple XML elements, e.g. <C_ADDRESS1>,
<C_ADDRESS2>, etc. Each XML element contains the value of a single
element in the collection.

How do I go about mapping this?

I've tried something like:

   <field name="addressLines" type="string" collection="arraylist">
     <bind-xml name="C_ADDRESS1" node="element">


   <field name="addressLines" type="string" collection="arraylist">
     <bind-xml name="C_ADDRESS2" node="element">


But I unsurprisingly get a mapping exception telling me that the
addressLines field appears more than once.

I wonder if this is even impossible with a custom field handler since
that will still be configured with only one XML element name?


To unsubscribe from this list, please visit:

©2008 - Jax Systems, LLC, U.S.A.