te a document to be serialized org.w3c.dom.Document doc = ...; // Create a Serializer that will be used // to serialize the document org.apache.xml.serializer.Serializer ser = ...; // Set the Writer to write output to, and // serialize the DOM using that Serializer java.io.StringWriter sw = new java.io.StringWriter(); ser.setWriter(sw); DOMSerialzier dser = ser.asDOMSerializer(); dser.serialize(doc); // Write out the serialized XML in the String. System.out.println(sw.toString());
@see OutputPropertiesFactory
@see SerializerFactory
@see Serializer
@xsl.usage general
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.