Hi.
> Hello friends. I'm wondering if anyone has any insight that could help me
> suppress the leading "<?xml version="1.0" encoding="UTF-8" standalone
> ="yes"?>" tag that comes out at marshall time.
>
> Essentially I'm looking at a situation where I need to generate a rather
> lengthy XML document representing thousands of accounts. I worry about
> memory usage trying to create a DOM/JDOM/JAXB generated object representing
> such a large document. It occurred to me, however, that there was nothing
> keeping me from opening a file writer, writing out my prologue, and then
> creating a jaxb style object for each account and appending that
> information to my output file in sequence, thus allowing me to keep my
> memory footprint small while creating a large file. But, in order to
> create a well formed object, I need to strip out the leading XML, otherwise
> I'd have something that looks like this:
>
> <? xml version="1.0"?>
> <accountUpdates>
> <xml version="1.0">
> <accountInfo>
> <address>....
>
> </accountInfo>
> <xml version="1.0">
> .....
> </accountUpdates>
>
> Any and all guidance is greatly appreciated!
I guess <?xml ...?> is generated by the XML serializer that you use or
JAXB uses if you're marshalling directly into the stream. The easiest
would be to marshall into SAX results and unite SAX streams stripping of
startDocument and endDocument events.
--
Dr. Aleksei Valikov (RUS)
Wissenschaftlicher Mitarbeiter
Forschungszentrum Informatik
Haid-und-Neu Str. 10-14
76131 Karlsruhe, Deutschland
Tel: +49-721-9654716
Fax: +49-721-9654717
E-mail: valikov_at_fzi.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net