cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ron Chan" <>
Subject Re: How can I write to a File a XML document
Date Sun, 06 Aug 2000 10:50:30 GMT
this worked for me



Document doc = new DocumentImpl();

add your elements here...

OutputFormat format  = new OutputFormat( doc );
FileWriter out = new FileWriter("/path/filename.xml");
XMLSerializer serial = new XMLSerializer( out, format );
serial.serialize( document.getDocumentElement() );


it will also work with the current XML page using the default "document"

hope this helps

Ron Chan

----- Original Message -----
From: Pedro E. Gómez <>
To: Cocoon <>; <>
Sent: Thursday, August 03, 2000 6:04 PM
Subject: How can I write to a File a XML document

> I have create a new XML document object using DocumentImpl (is this the
way to do that) and I have populated the document but I do not know how to
save it in a File.
> Thanks.
> ______________________________________
> Message sent with Misiva.
> Visit us at

View raw message