org.apache.catalina.util
Class DOMWriter
java.lang.Object
org.apache.catalina.util.DOMWriter
public class DOMWriter
extends java.lang.Object
A sample DOM writer. This sample program illustrates how to
traverse a DOM tree in order to print a document that is parsed.
protected boolean | canonical - Canonical output.
|
protected PrintWriter | out - Print writer.
|
DOMWriter(String encoding, boolean canonical)
|
DOMWriter(Writer writer, boolean canonical)
|
DOMWriter(boolean canonical) - Default constructor.
|
canonical
protected boolean canonical
Canonical output.
out
protected PrintWriter out
Print writer.
DOMWriter
public DOMWriter(String encoding,
boolean canonical)
throws UnsupportedEncodingException
DOMWriter
public DOMWriter(Writer writer,
boolean canonical)
DOMWriter
public DOMWriter(boolean canonical)
throws UnsupportedEncodingException
Default constructor.
getQualifiedNames
public boolean getQualifiedNames()
getWriterEncoding
public static String getWriterEncoding()
isValidJavaEncoding
public static boolean isValidJavaEncoding(String encoding)
normalize
protected String normalize(String s)
Normalizes the given string.
print
public void print(Node node)
Prints the specified node, recursively.
setQualifiedNames
public void setQualifiedNames(boolean qualifiedNames)
setWriterEncoding
public static void setWriterEncoding(String encoding)
sortAttributes
protected Attr[] sortAttributes(NamedNodeMap attrs)
Returns a sorted list of attributes.
Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.