Hi Jeremy,

I am not sure what you mean. Is addressBook a collection of Person objects?

java.util.ArrayList addressBook = new java.util.ArrayList();
addressBook.add(new Person("Bob"));
addressBook.add(new Person("John"));
bWriter.write("addressBook", addressBook);
bWriter.flush();

This should do what you want to do, if I understand you correctly.

Otherwise, if you can make your Addressbook a class with a addPerson() method that adds new Person objects to an internal collection, it will give you better (and more configurable) results. You can also use the .betwixt file to override default behaviors.

BTW, there are several books on Commons now available (including mine!): http://wiki.apache.org/jakarta-commons/JakartaCommonsResources

HTH,
Vikram

---------------------------------------------------------------------------------------
Jakarta Commons Online Bookshelf
Module 5: JXPath and Betwixt: http://www.manning.com/catalog/view.php?book=goyal5
All Modules: http://www.manning.com/goyal
---------------------------------------------------------------------------------------


----- Original Message ----- From: "Jeremy Denton" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, March 20, 2005 5:09 AM
Subject: [betwixt] root Collections?




Is there any way of specifying root collections in betwixt?

<addressBook>
<person name="bob"/>
<person name="joe"/>
<person name="frank/">
<person name="jim"/>
</addressBook >


The documentation for Betwixt is a bit lacking. (I'll happily contribute to the Wiki once I figure out how to use it myself).


Otherwise, I'm pleased by the project. There are very few XML Binding frameworks that leaves your Beans alone.

Cheers,
Jeremy


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]







--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to