org.jtool.jxplatform.dom
Class DomFormatter

java.lang.Object
  extended byorg.jtool.jxplatform.dom.DomFormatter

public class DomFormatter
extends java.lang.Object

Produces XML documents from DOM object trees.

Author:
Katsuhisa Maruyama

Constructor Summary
DomFormatter()
           
 
Method Summary
static java.lang.String getXMLText(org.w3c.dom.Document doc, java.lang.String charsetName)
          Returns a pretty-printed XML document from the DOM object tree.
static java.lang.String getXMLText(org.w3c.dom.Document doc, java.lang.String charsetName, java.lang.String dtdName)
          Returns a pretty-printed XML document from a DOM object tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomFormatter

public DomFormatter()
Method Detail

getXMLText

public static java.lang.String getXMLText(org.w3c.dom.Document doc,
                                          java.lang.String charsetName)
Returns a pretty-printed XML document from the DOM object tree.

Parameters:
doc - The DOM document object which is the root of the DOM object tree.
charsetName - The name of an XML document's charset.
Returns:
The text of the XML document.

getXMLText

public static java.lang.String getXMLText(org.w3c.dom.Document doc,
                                          java.lang.String charsetName,
                                          java.lang.String dtdName)
Returns a pretty-printed XML document from a DOM object tree.

Parameters:
doc - A DOM document object which is the root of the DOM object tree.
charsetName - The name of an XML document's charset.
dtdName - The DTD file name for a new XML document.
Returns:
The text of the XML document.