Yup. For Java that looks like this:
class Customers {
private ArrayList regionals;
}
class RegionalCustomer {
private ArrayList persons;
}
class Person {
int num;
String firstName;
String lastName;
String region;
}
You can define a binding that in general might like this:
<binding value-style="element">
<mapping name="Customers" class="Customers">
<collection field="regionals"
item-type="RegionalCustomer"/>
</mapping>
<mapping name="RegionalCustomers" class="RegionalCustomer">
<collection field="persons" item-type="Person"/>
</mapping>
<mapping name="person" class="Person">
<value name="cust-num" field="num"/>
<value name="first-name" field="firstName"/>
<value name="last-name" field="lastName"/>
<value name="region" field="region"/>
</mapping>
</binding>
-Mocky
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of yan fu
Sent: Tuesday, April 12, 2005 1:30 PM
To: [email protected]
Subject: [jibx-users] Does JiBX support nested collection
I would like to find out if nested collection is
supported by JiBX. For example, in following example, "Customers"
contains a collection of "RegionalCustomer", and each "RegionaCustomer"
contains a collection of "person"
<Customers>
<RegionalCustomers>
<person>
<cust-num>123456789</cust-num>
<first-name>John0</first-name>
<last-name>Smith0</last-name>
<region>E</region>
</person>
<person>
<cust-num>123456799</cust-num>
<first-name>John</first-name>
<last-name>Smith</last-name>
<region>E</region>
</person>
</RegionalCustomers>
<RegionalCustomers>
<person>
<cust-num>123456989</cust-num>
<first-name>John1</first-name>
<last-name>Smith1</last-name>
<region>P</region>
</person>
<person>
<cust-num>223456799</cust-num>
<first-name>John2</first-name>
<last-name>Smith2</last-name>
<region>P</region>
</person>
</RegionalCustomers>
</Customers>
Thanks,
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users