public class DOMWriter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
canonical
Canonical output (or not).
|
protected java.lang.String |
docHeader
The document header
|
protected java.lang.String |
docType
The document type
|
static java.lang.String |
PRINTWRITER_ENCODING
Default Encoding
|
Constructor and Description |
---|
DOMWriter(boolean can,
java.lang.String dH,
java.lang.String dT)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
normalize(java.lang.String s)
Normalizes the given string.
|
void |
print(org.w3c.dom.Node node)
Prints the specified node with all its subnodes to System.out.
|
protected void |
print(org.w3c.dom.Node node,
int level,
java.io.PrintWriter out)
Prints the specified node, recursively.
|
void |
print(org.w3c.dom.Node node,
java.io.PrintWriter w)
Prints the specified node with all its subnodes to a printwriter.
|
protected org.w3c.dom.Attr[] |
sortAttributes(org.w3c.dom.NamedNodeMap attrs)
Returns a sorted list of attributes.
|
public static java.lang.String PRINTWRITER_ENCODING
protected boolean canonical
protected java.lang.String docHeader
protected java.lang.String docType
public DOMWriter(boolean can, java.lang.String dH, java.lang.String dT)
can
- Canonical of notdH
- The document headerdT
- The document typepublic void print(org.w3c.dom.Node node)
node
- The node to be printed.public void print(org.w3c.dom.Node node, java.io.PrintWriter w)
node
- The node to be printed.w
- The writer to be printed to.protected void print(org.w3c.dom.Node node, int level, java.io.PrintWriter out)
node
- The node to be printed.level
- The level of indentationout
- The writer to be printed to.protected org.w3c.dom.Attr[] sortAttributes(org.w3c.dom.NamedNodeMap attrs)
attrs
- The attributes.protected java.lang.String normalize(java.lang.String s)
s
- The string.