dbXML API

## com.dbxml.xml.dom
Class TextWriter

    java.lang.Object
      com.dbxml.xml.dom.TextWriter

public final class TextWriter
extends java.lang.Object

TextWriter takes a Document, DocumentFragment, or Element and streams it as text or HTML to an output source (or a String)

Constructor Summary
`TextWriter(org.w3c.dom.Node node)`
`TextWriter(org.w3c.dom.Node node, boolean produceHTML)`
`TextWriter(org.w3c.dom.Node node, boolean produceHTML, boolean prettyPrint)`
`TextWriter(org.w3c.dom.Node node, boolean produceHTML, boolean prettyPrint, int indentSize)`

Method Summary
`boolean` `isPrettyPrint()`
`boolean` `isProduceHTML()`
`void` `setPrettyPrint(boolean prettyPrint)`
`void` `setProduceHTML(boolean produceHTML)`
`static java.lang.String` `toHTMLString(org.w3c.dom.Node node)` toHTMLString returns the node as a HTML String.
`static java.lang.String` `toPrettyHTMLString(org.w3c.dom.Node node)` toPrettyHTMLString returns the node as a Pretty HTML String.
`static java.lang.String` `toPrettyString(org.w3c.dom.Node node)` toPrettyString returns the node as a Pretty String.
`java.lang.String` `toString()` toString returns the node as a String.
`static java.lang.String` `toString(org.w3c.dom.Node node)` toString returns the node as a String.
`static void` `write(org.w3c.dom.Node node, java.io.OutputStream output)` write writes the specified node to the OutputStream as text.
`static void` `write(org.w3c.dom.Node node, java.io.Writer writer)` write writes the specified node to the writer as text.
`void` `write(java.io.OutputStream output)` write writes the node to the OutputStream as text.
`void` `write(java.io.Writer writer)` write writes the node to the writer as text.
`static void` `writeHTML(org.w3c.dom.Node node, java.io.OutputStream output)` writeHTML writes the specified node to the OutputStream as HTML.
`static void` `writeHTML(org.w3c.dom.Node node, java.io.Writer writer)` writeHTML writes the specified node to the writer as HTML.
`static void` `writePretty(org.w3c.dom.Node node, java.io.OutputStream output)` writePretty writes the specified node to the OutputStream as pretty text.
`static void` `writePretty(org.w3c.dom.Node node, java.io.Writer writer)` writePretty writes the specified node to the writer as pretty text.
`static void` `writePrettyHTML(org.w3c.dom.Node node, java.io.OutputStream output)` writePrettyHTML writes the specified node to the OutputStream as pretty HTML.
`static void` `writePrettyHTML(org.w3c.dom.Node node, java.io.Writer writer)` writePrettyHTML writes the specified node to the writer as pretty HTML.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### TextWriter

    public TextWriter(org.w3c.dom.Node node,
                      boolean produceHTML,
                      boolean prettyPrint,
                      int indentSize)

### TextWriter

    public TextWriter(org.w3c.dom.Node node,
                      boolean produceHTML,
                      boolean prettyPrint)

### TextWriter

    public TextWriter(org.w3c.dom.Node node,
                      boolean produceHTML)

### TextWriter

    public TextWriter(org.w3c.dom.Node node)

Method Detail

### isProduceHTML

    public boolean isProduceHTML()

### setProduceHTML

    public void setProduceHTML(boolean produceHTML)

### isPrettyPrint

    public boolean isPrettyPrint()

### setPrettyPrint

    public void setPrettyPrint(boolean prettyPrint)

### write

    public static void write(org.w3c.dom.Node node,
                             java.io.Writer writer)
                      throws java.io.IOException

  write writes the specified node to the writer as text.

  Parameters:
    `node` - The Node to write
    `writer` - The Writer to write to
  Throws:
    `java.io.IOException`

### writeHTML

    public static void writeHTML(org.w3c.dom.Node node,
                                 java.io.Writer writer)
                          throws java.io.IOException

  writeHTML writes the specified node to the writer as HTML.

  Parameters:
    `node` - The Node to write
    `writer` - The Writer to write to
  Throws:
    `java.io.IOException`

### writePretty

    public static void writePretty(org.w3c.dom.Node node,
                                   java.io.Writer writer)
                            throws java.io.IOException

  writePretty writes the specified node to the writer as pretty text.

  Parameters:
    `node` - The Node to write
    `writer` - The Writer to write to
  Throws:
    `java.io.IOException`

### writePrettyHTML

    public static void writePrettyHTML(org.w3c.dom.Node node,
                                       java.io.Writer writer)
                                throws java.io.IOException

  writePrettyHTML writes the specified node to the writer as pretty HTML.

  Parameters:
    `node` - The Node to write
    `writer` - The Writer to write to
  Throws:
    `java.io.IOException`

### write

    public void write(java.io.Writer writer)
               throws java.io.IOException

  write writes the node to the writer as text.

  Parameters:
    `writer` - The Writer to write to
  Throws:
    `java.io.IOException`

### write

    public static void write(org.w3c.dom.Node node,
                             java.io.OutputStream output)
                      throws java.io.IOException

  write writes the specified node to the OutputStream as text.

  Parameters:
    `node` - The Node to write
    `output` - The OutputStream to write to
  Throws:
    `java.io.IOException`

### writeHTML

    public static void writeHTML(org.w3c.dom.Node node,
                                 java.io.OutputStream output)
                          throws java.io.IOException

  writeHTML writes the specified node to the OutputStream as HTML.

  Parameters:
    `node` - The Node to write
    `output` - The OutputStream to write to
  Throws:
    `java.io.IOException`

### writePretty

    public static void writePretty(org.w3c.dom.Node node,
                                   java.io.OutputStream output)
                            throws java.io.IOException

  writePretty writes the specified node to the OutputStream as pretty text.

  Parameters:
    `node` - The Node to write
    `output` - The OutputStream to write to
  Throws:
    `java.io.IOException`

### writePrettyHTML

    public static void writePrettyHTML(org.w3c.dom.Node node,
                                       java.io.OutputStream output)
                                throws java.io.IOException

  writePrettyHTML writes the specified node to the OutputStream as pretty HTML.

  Parameters:
    `node` - The Node to write
    `output` - The OutputStream to write to
  Throws:
    `java.io.IOException`

### write

    public void write(java.io.OutputStream output)
               throws java.io.IOException

  write writes the node to the OutputStream as text.

  Parameters:
    `output` - The OutputStream to write to
  Throws:
    `java.io.IOException`

### toString

    public static java.lang.String toString(org.w3c.dom.Node node)

  toString returns the node as a String.

  Parameters:
    `node` - The Node to convert
  Returns:
    The String value

### toHTMLString

    public static java.lang.String toHTMLString(org.w3c.dom.Node node)

  toHTMLString returns the node as a HTML String.

  Parameters:
    `node` - The Node to convert
  Returns:
    The String value

### toPrettyString

    public static java.lang.String toPrettyString(org.w3c.dom.Node node)

  toPrettyString returns the node as a Pretty String.

  Parameters:
    `node` - The Node to convert
  Returns:
    The String value

### toPrettyHTMLString

    public static java.lang.String toPrettyHTMLString(org.w3c.dom.Node node)

  toPrettyHTMLString returns the node as a Pretty HTML String.

  Parameters:
    `node` - The Node to convert
  Returns:
    The String value

### toString

    public java.lang.String toString()

  toString returns the node as a String.

  Returns:
    The String value

dbXML API

Copyright (c) 2004 The dbXML Group