cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ron Chan" <rcli...@i-tao.com>
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

<xsp:structure>
   <xsp:include>org.apache.xml.serialize.*</xsp:include>
   <xsp:include>org.apache.xerces.dom.*</xsp:include>
 </xsp:structure>


<xsp:logic><![CDATA[

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.asDOMSerializer();
serial.serialize( document.getDocumentElement() );

]]></xsp:logic>

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

hope this helps


Ron Chan
mailto:rchan@i-tao.com
www.i-tao.com


----- Original Message -----
From: Pedro E. Gómez <pgomez@pragma.com.co>
To: Cocoon <cocoon-dev@xml.apache.org>; <cocoon-users@xml.apache.org>
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 http://www.pragma.com.co/misiva
>


Mime
View raw message