|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.xml.XMLSerializer
public class XMLSerializer
Generates a serialization (ie., a text representation) of a DOM 2 Document object, generic XML, XTM, XHTML, HTML or plain text content. This is deliberately a simple serializer that does not handle all DOM node types, does not process DTDs, namespaces, etc. It does produce simple, well-formed XML, can correctly process XHTML (including preformatted text), and handles ignoreable whitespace correctly.
Note 1: be sure to call close() at the end of a writing process, otherwise you may end up with an empty output document.
Note 2: this class is gradually being phased out in favour of using the Xerces XMLSerializer, XHTMLSerializer, etc. New code should not be written using this XML serializer; it is now deprecated.
| Field Summary | |
|---|---|
boolean |
addXMLDecl
Deprecated. Variable controlling whether XML comments should be preceded by a XML Declaration if they don't already have on (default false). |
String |
blockXHTML
Deprecated. A space-delimited list of a subset of XHTML elements considered as block elements. |
static int |
DOCTYPE_SHML_2
Deprecated. Used by getDoctypeDeclaration() to indicate the SHML 2.0 DTD. |
static int |
DOCTYPE_XHTML_FRAMESET
Deprecated. Used by getDoctypeDeclaration() to indicate the XHTML 1.0 Frameset DTD. |
static int |
DOCTYPE_XHTML_STRICT
Deprecated. Used by getDoctypeDeclaration() to indicate the XHTML 1.0 Strict DTD. |
static int |
DOCTYPE_XHTML_TRANSITIONAL
Deprecated. Used by getDoctypeDeclaration() to indicate the XHTML 1.0 Transitional DTD. |
String |
emptyXHTML
Deprecated. A space-delimited list of XHTML elements declared EMPTY. |
String |
emptyXTM
Deprecated. A space-delimited list of XTM elements declared EMPTY. |
static String |
encoding
Deprecated. The String used as the content of the XML declaration's encoding attribute. |
boolean |
expandCommentWS
Deprecated. Variable controlling whether XML comments should be preceded by a newline (default false). |
String |
inlineXHTML
Deprecated. A space-delimited list of XHTML elements considered (by the HTML 4 Recommendation) as inline. |
protected boolean |
m_closeOnComplete
Deprecated. Variable controlling whether to close the writer upon completion. |
boolean |
prettyPrint
Deprecated. Variable controlling whether to include whitespace indenting. |
static String |
SHML_DTD_PubId
Deprecated. A String containing the Formal Public Identifier (FPI) for the SHML 2.0 DTD. |
static String |
SHML_DTD_SysId
Deprecated. A String containing a system identifier for the SHML 2.0 DTD. |
static String |
XMLNS_shml
Deprecated. The URI indicating the SHML 2.0 XML namespace. |
static String |
XMLSPACE_ATTR
Deprecated. The XML attribute 'xml:space'. |
static String |
XMLSPACE_DEFAULT
Deprecated. The value 'default' for the XML 'xml:space' attribute. |
static String |
XMLSPACE_PRESERVE
Deprecated. The value 'preserve' for the XML 'xml:space' attribute. |
| Constructor Summary | |
|---|---|
XMLSerializer(Writer out)
Deprecated. |
|
XMLSerializer(Writer out,
int method)
Deprecated. |
|
| Method Summary | |
|---|---|
void |
close()
Deprecated. Close the output stream. |
static String |
getDoctypeDeclaration(int type)
Deprecated. |
static String |
getSerializedNode(Node node)
Deprecated. |
void |
serializeDocument(Node node)
Deprecated. Output a DOM Node (such as a Document) to the output stream, closing the writer when complete. |
void |
serializeElementContent(Element element)
Deprecated. Output an Element Node to the output stream, closing the writer when complete. |
static String |
serializeNode(MessageHandler mh,
Node node)
Deprecated. |
void |
setCloseOnComplete(boolean close)
Deprecated. Set the serializer to close (true) or leave open (false) the Writer upon completion of a serialization. |
void |
setMethod(int method)
Deprecated. Sets the serialization method to method. |
void |
setPreferences()
Deprecated. Reads the current serializer preferences using a PropertyManager. |
void |
setWriter(Writer writer)
Deprecated. Set the Writer used by this XMLSerializer. |
protected void |
write(Node node)
Deprecated. Output a DOM Node (such as a Document) to the output stream. |
protected void |
write(Node node,
int nest)
Deprecated. Output the specified DOM Node object, printing it using the specified indentation string |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public boolean prettyPrint
public static final String XMLSPACE_ATTR
public static final String XMLSPACE_DEFAULT
public static final String XMLSPACE_PRESERVE
public boolean addXMLDecl
public boolean expandCommentWS
public static final int DOCTYPE_XHTML_STRICT
public static final int DOCTYPE_XHTML_TRANSITIONAL
public static final int DOCTYPE_XHTML_FRAMESET
public static final int DOCTYPE_SHML_2
public static String encoding
public static final String XMLNS_shml
public static final String SHML_DTD_PubId
public static String SHML_DTD_SysId
public String emptyXHTML
public String inlineXHTML
public String blockXHTML
public String emptyXTM
protected boolean m_closeOnComplete
| Constructor Detail |
|---|
public XMLSerializer(Writer out)
public XMLSerializer(Writer out,
int method)
XMLUtils.SERIALIZE_XML,
XMLUtils.SERIALIZE_XTM,
XMLUtils.SERIALIZE_XHTML,
XMLUtils.SERIALIZE_HTML,
XMLUtils.SERIALIZE_TEXT| Method Detail |
|---|
public static String getSerializedNode(Node node)
public static String serializeNode(MessageHandler mh,
Node node)
public void setMethod(int method)
public void setCloseOnComplete(boolean close)
public void serializeDocument(Node node)
throws IOException
IOException
public void serializeElementContent(Element element)
throws IOException
IOException
public void setPreferences()
throws IOException
IOExceptionpublic void setWriter(Writer writer)
public void close()
throws IOException
IOException
protected void write(Node node)
throws IOException
IOException
protected void write(Node node,
int nest)
throws IOException
IOExceptionpublic static String getDoctypeDeclaration(int type)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||