Hi John,

To avoid using the XML declaration in the output, you need to use the
marshaller directly...

Marshaller m = new Marshaller(myWriter);
//-- to avoid the XML Declaration (<?xml ... ?>)
m.setMarshalAsDocument(false); 

m.marshal(application);


--Keith



John Xu wrote:
> 
> Hello everyone,
> 
> Just a little background information...Due to the size of the XML file I am
> marshalling, I decided to split the xml marshal process (bad idea?).  The
> root node is <NewAccounts>.  <Application> is a child node.  Each
> application element is marshaled separately and appended onto the XML file.
> However, every time I call:
> 
> application.marshal();
> 
> I get the header tag,
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> at the beginning of every application.  Is there is a way to remove this
> line from the marshaller?
> 
> Thanks
> John
> 
> Example:
> 
> <NewAccounts>
>         <Applications>
>                 <?xml version="1.0" encoding="UTF-8" ?>
>                 <Application>
>                         <Clients>
>                                 <Line>Client1</Line>
>                         </Clients>
>                         <Address>
>                                 <Line>AddressLine1</Line>
>                                 <Line>AddressLine2</Line>
>                         </Address>
>                         <Accounts>
>                                 <Account>AccountLine</Account>
>                         </Accounts>
>                         <Language>En</Language>
>                 </Application>
>                 <?xml version="1.0" encoding="UTF-8" ?>
>                 <Application>
>                         <Clients>
>                                 <Line>Client1</Line>
>                         </Clients>
>                         <Address>
>                                 <Line>AddressLine1</Line>
>                                 <Line>AddressLine1</Line>
>                         </Address>
>                         <Accounts>
>                                 <Account>AccountLine</Account>
>                         </Accounts>
>                         <Language>En</Language>
>                 </Application>
>         </Applications>
>         <CurrentSystemDate>Jun 4, 2004</CurrentSystemDate>
>   </NewAccounts>
> 
> --------------------
> The information transmitted is intended only for the person or entity to which it is 
> addressed and may contain confidential and/or privileged material. Any review, 
> re-transmission, dissemination or other use of, or taking of any action in reliance 
> upon, this information by persons or entities other than the intended recipient is 
> prohibited. If you received this in error, please contact the sender immediately by 
> return electronic transmission and then immediately delete this transmission, 
> including all attachments, without copying, distributing or disclosing same. E-mail 
> is not a secure means of communication. Please advise us if you would prefer to use 
> an alternate form of communication.
> We accept no responsibility or liability for loss or damage arising from the receipt 
> or use of this transmission. Unless otherwise specifically stated, any opinions 
> expressed are those of the author only and this transmission is not intended as a 
> recommendation or solicitation of an offer to purchase or sell any security or 
> related financial instruments. The Scotia Capital trademark represents the corporate 
> and investment banking business of The Bank of Nova Scotia, Scotia Capital Inc. 
> ("SCI") and Scotia Capital (USA) Inc. ("SC-USA") - all members of the Scotiabank 
> Group. SC-USA is registered as a broker-dealer with the SEC and is a member of the 
> NASD and SIPC. ScotiaMcLeod and ScotiaMcLeod Direct Investing ("SMDI") are divisions 
> of SCI. SCI is a member of CIPF. ScotiaMcLeod and SMDI do not accept trading 
> instructions via e-mail or voice-mail.
> 
> -----------------------------------------------------------
> 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

Reply via email to