To serialize a document using SAX events, create a compatible serializer and pass it around as a {@link org.xml.sax.DocumentHandler}. If an I/O error occurs while serializing, it will be thrown by {@link DocumentHandler#endDocument}. The SAX serializer may also be used as {@link org.xml.sax.DTDHandler}, {@link org.xml.sax.ext.DeclHandler} and{@link org.xml.sax.ext.LexicalHandler}.
To serialize a DOM document or DOM element, create a compatible serializer and call it's {@link DOMSerializer#serialize(Document)} or {@link DOMSerializer#serialize(Element)} methods.Both methods would produce a full XML document, to serizlie only the portion of the document use {@link OutputFormat#setOmitXMLDeclaration}and specify no document type.
The {@link OutputFormat} dictates what underlying serialized is usedto serialize the document based on the specified method. If the output format or method are missing, the default is an XML serializer with UTF-8 encoding and now indentation. @deprecated This class was deprecated in Xerces 2.9.0. It is recommended that new applications use the DOM Level 3 LSSerializer or JAXP's Transformation API for XML (TrAX) for serializing XML and HTML. See the Xerces documentation for more information. @version $Revision: 699892 $ $Date: 2008-09-28 17:08:27 -0400 (Sun, 28 Sep 2008) $ @author Assaf Arkin @author Scott Boag @see DocumentHandler @see ContentHandler @see OutputFormat @see DOMSerializer
|
|