Adrian,
It's not a "static" field as in the java keyword, but it doesn't change between marshalling as long as you use the same instance of the Marshaller. So you only need to set it once. If you create a new instance of the Marshaller of course you'll need to set the field on that particular instance as well. Hope that clears it up. --Keith "Adrian G. Klingel" wrote: > > Keith, thanks very much! That remains static for any item that you call the > marshal() method on, until you set it differently, I assume? > > Adrian > > -----Original Message----- > From: Keith Visco [mailto:[EMAIL PROTECTED] > Sent: Friday, August 06, 2004 2:02 PM > To: [EMAIL PROTECTED] > Subject: Re: [castor-user] Writing very large XML files while NOT writing > the XML > > You can disable the XML declaration by: > > Marshaller m = new Marshaller(myWriter); m.setMarshalAsDocument(false); > > That will basically tell the Marshaller to treat the XML as a fragment and > not a complete document. > > --Keith > > > "Adrian G. Klingel" wrote: > > > > I want to write a very large XML document containing tens of thousands > > of a single repeating element within a root element. There's no way > > to do this by assembling everything into the root element and then > > marshalling the whole thing. > > > > I could use a FileWriter to write the opening root element tag, > > marshal each of the repeating elements that I've returned from a > > database result set, and then use the FileWriter to write the close > > tag. > > > > Unfortunately, the XML header > > > > <?xml version="1.0" encoding="UTF-8"?> > > > > gets written upon every marshal. Is there any way to suppress that? > > > > I found a StreamedMarshaller class in the archive, but it seems like > > it may be overkill for what I'm trying to accomplish. > > > > Any ideas would be appreciated, as I'm sure this is something commonly > > done. > > > > Sincerely, > > > > Adrian Klingel > > > > > > > > --------------------------------------------------------------- > > ----------------------------------------------------------- > > If you wish to unsubscribe from this mailing, send mail to > > [EMAIL PROTECTED] with a subject of: > > unsubscribe castor-user > > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-user > > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-user ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-user
