> -----Original Message-----
> From: boraldo [mailto:boraldo_at_hotbox.ru]
> Sent: Wednesday, June 16, 2010 11:06 AM
> To: users_at_jaxb.dev.java.net
> Subject: How can I bind nested element
>
>
> There is my xml:
>
> <parent>
> <children>
> <child>1</child>
> <child>2</child>
> </children>
> </parent>
>
> I want to have the following Parent class:
>
> Parent{
> List<Child> children;
> }
>
> I don't want to have class for element 'children'.
> How should I map List<Child> children ?
Continuing with Erik's reply, I almost always declare collections like
this:
@XmlElementWrapper(name = "children")
@XmlElement(name = "child")
List<Child> children;
This will produce what you want.