users@jaxb.java.net

Re: how to marshal an object to document fragment

From: Ryan Shoemaker - JavaSoft East <Ryan.Shoemaker_at_Sun.COM>
Date: Mon, 27 Jan 2003 17:29:07 -0500

zhidong zhao wrote:
> How to set the marshaller to marshal a globe type into document fragment string without xml
> prolog or xsi:xxx xmlns:xxx attributes?
>

There is no way to do this via the javax.xml.bind interfaces. We considered adding
this feature to the 1.0 version of JAXB, but ultimately removed it. You should be
able to marshal to a custom ContentHandler that strips the start|endDocument events
out of the SAX stream.

--Ryan Shoemaker, Sun Microsystems, Inc.