Contents | Package | Class | Tree | Deprecated | Index | Help | XML for Java
PREV | NEXT | SHOW LISTS | HIDE LISTS |

# Class com.ibm.xml.parser.Format

    java.lang.Object
        |
        +----com.ibm.xml.parser.Format

public class Format
extends java.lang.Object

A Utility class for output XML document. This class prints extara white-spaces for indentation (`TXDocument#print()` method adds no white-spaces).

Version:
  1.1

Method Summary
static void | indent(java.io.PrintWriter pw, int n) Print a return character and `printSpace(pw,n)`.
static void | print(TXDocument doc, java.io.PrintWriter pw, java.lang.String encoding, int dx) Print a document to a stream in XML format.
static void | print(TXDocument doc, java.io.PrintWriter pw, java.lang.String encoding) Print with 2 spaces for indentation.
static void | print(TXDocument doc, java.io.PrintWriter pw) Print with 2 spaces for indentation.
static void | printDTD(DTD dtd, java.io.PrintWriter pw, java.lang.String enc, int ind, int dx)
static void | printElement(TXElement el, java.io.PrintWriter pw, java.lang.String enc, int ind, int dx) Print specified element.
static void | printSpace(java.io.PrintWriter pw, int n) Print n spaces.

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

### print

    public static void print(TXDocument doc,
                             java.io.PrintWriter pw,
                             java.lang.String encoding,
                             int dx)

  Print a document to a stream in XML format. This method adds some spaces in elements.
  Parameters:
    `dx` - indent width
    `encoding` - `PrintWriter`'s encoding name in Java encoding name. It can be `null`.

### print

    public static void print(TXDocument doc,
                             java.io.PrintWriter pw,
                             java.lang.String encoding)

  Print with 2 spaces for indentation.

### print

    public static void print(TXDocument doc,
                             java.io.PrintWriter pw)

  Print with 2 spaces for indentation.

### printDTD

    public static void printDTD(DTD dtd,
                                java.io.PrintWriter pw,
                                java.lang.String enc,
                                int ind,
                                int dx)

### printElement

    public static void printElement(TXElement el,
                                    java.io.PrintWriter pw,
                                    java.lang.String enc,
                                    int ind,
                                    int dx)

  Print specified element.

### printSpace

    public static void printSpace(java.io.PrintWriter pw,
                                  int n)

  Print n spaces.

### indent

    public static void indent(java.io.PrintWriter pw,
                              int n)

  Print a return character and `printSpace(pw,n)`.

Contents | Package | Class | Tree | Deprecated | Index | Help |
PREV | NEXT | SHOW LISTS | HIDE LISTS |