Look at org.apache.xml.serialize package. There are some serializers
for you to chose for different output format, such as html and xhtml.
In your case, construct a XMLSerializer like the following:
Document yourDocument;//populate with your input file.
OutputFormat format = new OutputFormat();
//here you can do something about format according your need, such
//as disabling the output of "DOCTYPE".
OutputStream file = new FileOutputStream("yourOutputFile");
XMLSerializer s = new org.apache.xml.serialize.XMLSerializer(file,
format);
s.serialize(yourDocument);
Good luck.
Zhaohua Meng
Hotlens.com Inc.
http://www.hotlens.com
350 Fifth AVE
Suite 3113
New York, NY 10118
Phone: 212-465-1700
Fax: � 212-465-1710
email: [EMAIL PROTECTED]
-----Original Message-----
From: "Li Liang" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Date: Mon, 16 Jul 2001 12:15:54 -0400
Subject: How to serialize a DOM document
> A dumb question: How can I serialize a DOM document into an XML file.
> Thanks.
>
> Li
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]