Hi,

I'm using Betwixt for the following sort of format XML:

<results>
        <company name="blah" />
        <company name="blah2" />
</results>

Now, if I have a results class with the following:
private java.util.Collection companyList new java.util.ArrayList();
public void addCompany( Company c ) { companyList.add( c ); }
public java.util.Collection getCompanyList() { return companyList; }

And a Company class with:
private String name;
public String getName() { return name; }
public void setName( String name ) { this.name = name; }

and use a similar test class as the src/tests version (BeanReader then 
BeanWriter) I get back:

<results id="1">
        <companyList/>
</results>

If I change the XML to have <companyList> around it, it seems ok, except 
it can't deal with name as an attribute, it needs an element.

If I specify a .betwixt file for results:
<?xml version="1.0"?>
<info primitiveTypes="attribute">
         <element name="results">
                 <element name="company" property="companyList">
                        <addDefaults/>
                </element>
         </element>
</info>

... it works as I expect.

So, do I need the .betwixt file for each class, or am I missing 
something? I don't care what the output is, but the bean is not being 
built correctly without it.

Thanks,
Brett Porter


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

Reply via email to