marshaller.setSupressXMLDeclaration(true);

Isn't this for that? To prevent castor to output xml declaration ?
I've used it with success.

Diogo


-----------------------------------
Diogo Bacelar Quintela
EF - Tecnologias de Informação, Lda.
Av. António Serpa, 26 - 4º Dto.
1050-027 Lisboa, Portugal
Tel: (+351) 217 827 800
Fax: (+351) 217 827 830
Email: [EMAIL PROTECTED]
PGP: 0xF51A5AB9 

> -----Original Message-----
> From: Keith Visco [mailto:[EMAIL PROTECTED]
> Sent: quinta-feira, 10 de Novembro de 2005 4:34
> To: [email protected]
> Subject: Re: [castor-user] How to add comment in XML output ?
> 
> 
> Stephane,
> 
> You could do the following:
> 
> writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
> writer.write("<!--WARNING: Do NOT edit ... by Castor. -->\n");
> marshaller.setMarshalAsDocument(false);
> marshaller.marshal(myObject);
> 
> The important step being the marshaller.setMarshalAsDocument(false)
> which will prevent Castor from outputting the xml declaration.
> 
> --Keith
> 
> Bedin, Stephane (GE Healthcare) wrote:
> > Hi,
> > Is there a way with castor
> > when marshalling an object, to add an XML comment to the generated
> document ?
> >
> > I expect the XML document to looks like:
> >
> >   <?xml version="1.0" encoding="UTF-8"?>
> >   <!--WARNING: Do NOT edit this file.  It was produced automatically by
> Castor. -->
> >   <MaClass>
> >     ...
> >   </MyClass>
> >
> > Stéphane
> >
> > -------------------------------------------------
> > If you wish to unsubscribe from this list, please
> > send an empty message to the following address:
> >
> > [EMAIL PROTECTED]
> > -------------------------------------------------
> >
> >
> 
> 
> -------------------------------------------------
> If you wish to unsubscribe from this list, please
> send an empty message to the following address:
> 
> [EMAIL PROTECTED]
> -------------------------------------------------

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to