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?
Thanks,
--Ryan
> Example 1:
>
> <cars>
> <car>
> <type></type>
> </car>
> <car>
> <type></type>
> </car>
> <car>
> <type></type>
> </car>
> .....
> </cars>
>
> Example 2:
>
> <car>
> <type></type>
> </car>
>
> Thanks,
>
> Laszlo Rozsas