Method Summary |
|
public void | closeWriter() Closes the output writer ignoring any errors recieved. |
protected String | convertNewline(String text) Convert newlines to what we want. |
protected static void | copyFile(File in, File out) |
public void | error(SAXParseException ex) |
public void | fatalError(SAXParseException ex) Fatal error. |
protected String | getIndent(int col) Get the normal indentation for a level. |
public String | getRequiredClass() Retrieve a class that must exist in the classpath for this to work. |
public Writer | getWriter() Get the output writer. |
public static void | main(String[] args) |
public static String | nodeToString(Node node) Return the given node as a string. |
public void | outputDocument(Node node) Output the document whose root element is the specified node. |
public void | print(String string, String indent) Prints the string to the output at an indentation. |
public void | print(String string) Prints the string to the output. |
protected void | printTree(Node node, int col) Output the node (and children) at the specified indentation level. |
protected void | printTree(Node node) Output the node (and children) at the current indentation level. |
public void | println(String string, String indent) Prints the string to the output at an indentation following it with a newline. |
public void | println(String string) Prints the string to the output following it with a newline. |
public static int | run(String[] args, XMLPrinter printer) |
public static int | run(String[] args) |
public void | saveDocument(OutputStream os, Document document) |
public void | setFile(File file) Creates an output writer that will create the file specified and any
parent directories needed to do so. |
public void | setFile(String filename) Creates an output writer that will create the file specified and any
parent directories needed to do so. |
public void | setIndent(char indentChar, int size) Set the indent semantics. |
public void | setIndentSize(int indentSize) Set the indentation size to the number of characters specified using the
current indent character. |
public void | setOmitXmlDecl(boolean b) Set whether the xml declaration should be output at the start of a document. |
public void | setWriter(Writer out) Set the output writer. |
public static String | toXML(String html) |
public static String | toXML(String html, boolean escapeAll) Parse an string and convert it to xml style
Parameters: html - The string to be parsed Parameters: escapeAll - If false, the semicolon, apostrophe, and quote are left alone (useful for text nodes). |
public void | warning(SAXParseException ex) |