users@jaxb.java.net

Re: Marshalling and unmarshalling to several root elements

From: Rózsás László <rozsas_at_sztaki.hu>
Date: Mon, 12 May 2003 10:13:49 +0200

> R?zs?s L?szl? wrote:
> > Hi,
> >
> > I have an XML schema with a root element called for example <cars>,
> > that can contain several <car> tags, that in turn contain the
description
> > of a car. In some cases I only need the description of one car, so I'd
> > like to get an XML file that contains only one <car> tag as its root
> > element, but in some other cases I need the complete list of cars with
> > their descriptions, so I'd like to generate an XML file with a <cars>
tag
> > as root element. How can I do that in JAXB?
> >
>
> I'm reading Laszlo's question differently than Kohsuke and Han Ming.
>
> I could be wrong, but I think he's asking if he has the choice between
> marshalling the entire tree (resulting in a <cars> root element) and
> marshalling a portion of the tree (resulting in a <car> root element).
>
> Laszlo, can you clarify?

Yes, that is exactly what I was asking, but fortunately I have solved the
problem
since then. Thank you for the answers any way.

Regards,

Laszlo Rozsas