I want to fill java beans from some xml. This xml I already have and can't
change it.
try this small test.
public class User {
    String name;

    public String getName() {
        return name;
    }

    public void setName(String pName) {
        name= pName;
    }
}
User.betwixt file
<?xml version="1.0" encoding="UTF-8"?>
<info primitiveTypes="element">
<element name="ttt">
<element name="text2" property="text"/>
</element>
</info>


public class UserCollection {
    List userList = new ArrayList();
    public void addUser(User pAddedUser) {
        userList.add(pAddedUser);
    }

    public List getUserList() {
        return userList;
    }
}

UserCollection.betwixt
<?xml version="1.0" encoding="UTF-8"?>
<info primitiveTypes="element">
<element name="behaviour">
<element name="answers" property="answerList">
<addDefaults/>
</element>
</element>
</info>

This works just fine!
But then if I add property to UserCollection for example text and leave
UserCollection.betwixt the same It doesn't work!


----- Original Message ----- 
From: "__matthewHawthorne" <[EMAIL PROTECTED]>
To: "Jakarta Commons Users List" <[EMAIL PROTECTED]>
Sent: Thursday, October 30, 2003 10:12 PM
Subject: Re: [BETWIXT] question about collections


> I'm not sure why it isn't read correctly without the <addDefaults/> tag.
>
> Why don't you want to use <addDefaults/>?


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

Reply via email to