users@jaxb.java.net

Re: JAXB marshalling question

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Mon, 1 Oct 2007 07:44:12 +0200

Hi.

> I have a question about JAXB that I am hoping someone here can help me with.
>
> Assuming I have the following java class:
>
> @XmlElement
> public class Item {
> @XmlElement;
> private String name;
> }
>
> I know that I can get JAXB to marshall this object into an xml stricture
> similar to:
>
> <item>
> <name>...</name>
> </item>
>
> Is there a way for me to get a List of type Item to output like:
>
> <items>
> <item>
> <name>...</name>
> </item>
> </items>
>
> Specifically can I do this without having to create and annotate a holder
> class? Thanks in advance for any help.

I don't think it's possible without a container class.

Bye.
/lexi