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]
-------------------------------------------------