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.
To serialize a document using SAX events, create a compatible serializer
and pass it around as a org.. If an I/O error occurs while serializing, it will
be thrown by DocumentHandler#endDocument. The SAX serializer
may also be used as org., org. and
org..
To serialize a DOM document or DOM element, create a compatible
serializer and call it's DOMSerializer#serialize(Document) or DOMSerializer#serialize(Element) methods.
Both methods would produce a full XML document, to serizlie only
the portion of the document use OutputFormat#setOmitXMLDeclaration
and specify no document type.
The OutputFormat dictates what underlying serialized is used
to 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.
DocumentHandler, ContentHandler, OutputFormat, DOMSerializer
| Modifier and Type | Method and Description |
|---|---|
| public ContentHandler | |
| public DocumentHandler | asDocumentHandler()
Deprecated
as a consequence of
Return a DocumentHandler being deprecated.
DocumentHandler interface into this serializer.
|
| public DOMSerializer | asDOMSerializer()
Deprecated
as a consequence of
Return a DOMSerializer being deprecated.
DOMSerializer interface into this serializer.
|
| public void | setOutputByteStream(OutputStream output)
Specifies an output stream to which the document should be serialized. |
| public void | |
| public void | setOutputFormat(OutputFormat
The output format to use format)
Deprecated
as a consequence of
Specifies an output format for this serializer.
OutputFormat being deprecated.
|
| asContentHandler | back to summary |
|---|---|
| public ContentHandler asContentHandler() throws IOException Return a | |
| asDocumentHandler | back to summary |
|---|---|
| public DocumentHandler asDocumentHandler() throws IOException
Deprecated as a consequence of Return a | |
| asDOMSerializer | back to summary |
|---|---|
| public DOMSerializer asDOMSerializer() throws IOException
Deprecated as a consequence of Return a | |
| setOutputByteStream | back to summary |
|---|---|
| public void setOutputByteStream(OutputStream output) Specifies an output stream to which the document should be serialized. This method should not be called while the serializer is in the process of serializing a document. | |
| setOutputCharStream | back to summary |
|---|---|
| public void setOutputCharStream(Writer output) Specifies a writer to which the document should be serialized. This method should not be called while the serializer is in the process of serializing a document. | |
| setOutputFormat | back to summary |
|---|---|
| public void setOutputFormat(OutputFormat format)
Deprecated as a consequence of Specifies an output format for this serializer. It the serializer has already been associated with an output format, it will switch to the new format. This method should not be called while the serializer is in the process of serializing a document.
| |