commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [Betwixt] Help : Writing collection of objects to sub element instead of attribute
Date Thu, 03 Apr 2008 17:49:14 GMT
Hello Han Ming,

I'm also somewhat new to Betwixt, but have gotten a number of things to 
work so
I'll take a crack at your question.

What do does you betwixt-config or .betwixt file look like for the 
Person class?

I belive that if you're depending on betwixt to infer the output it 
will assume
that properties are to be treated as xml-attributes of a given xml-element.

try placing an Item.betwixt in the same directory with the

<?xml version="1.0" encoding="UTF-8" ?>
<info primitiveTypes="element">
   <element name="person">
     <element name="id" property="id"/>
     <addDefaults />

I'd expect the output to be what you were expecting:

> <?xml version='1.0' ?>
> <person name="John Smith">
>   <items>
>     <Item><id>a</id></Item>
>     <Item><id>b</id></Item>
>   </items>
> </person>


  * @author: Andrew Lenards
  * @email:
  * @title:  Systems Programmer, Principal
  * @dept:   Tree of Life Web Project,
  *          Dept. of Entomology
  * @url:
  * @school: University of Arizona
  * @geo-loc:Tucson, AZ 85721

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message