public class DOMWriter
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private boolean |
canonical |
private java.lang.String |
charsetName |
private boolean |
completeNamespaces |
private java.lang.String |
currentDefaultNamespace |
private boolean |
ignoreWhitespace |
private java.io.PrintWriter |
out |
private int |
prettyIndent |
private boolean |
prettyprint |
private org.w3c.dom.Node |
rootNode |
private boolean |
writeXMLDeclaration |
private boolean |
wroteXMLDeclaration |
| Constructor and Description |
|---|
DOMWriter(java.io.OutputStream stream) |
DOMWriter(java.io.OutputStream stream,
java.lang.String charsetName) |
DOMWriter(java.io.Writer w) |
DOMWriter(java.io.Writer w,
java.lang.String charsetName) |
| Modifier and Type | Method and Description |
|---|---|
private java.lang.String |
getNamespaceURI(java.lang.String prefix,
org.w3c.dom.Element element,
org.w3c.dom.Node stopNode) |
boolean |
isCanonical() |
private boolean |
isEndMarkerIndented(org.w3c.dom.Node node) |
boolean |
isIgnoreWhitespace() |
boolean |
isPrettyprint() |
boolean |
isWriteXMLDeclaration() |
static java.lang.String |
normalize(java.lang.String s,
boolean canonical)
Normalizes the given string.
|
void |
print(org.w3c.dom.Node node) |
private void |
printInternal(org.w3c.dom.Node node,
boolean indentEndMarker) |
static java.lang.String |
printNode(org.w3c.dom.Node node,
boolean prettyprint)
Print a node with explicit prettyprinting.
|
DOMWriter |
setCanonical(boolean canonical)
Set wheter entities should appear in their canonical form.
|
DOMWriter |
setCompleteNamespaces(boolean complete)
Set wheter subelements should have their namespaces completed.
|
DOMWriter |
setIgnoreWhitespace(boolean ignoreWhitespace)
Set whether whitespace should be ignored.
|
DOMWriter |
setPrettyprint(boolean prettyprint)
Set wheter element should be indented.
|
DOMWriter |
setWriteXMLDeclaration(boolean flag)
Set wheter the XML declaration should be written.
|
private org.w3c.dom.Attr[] |
sortAttributes(org.w3c.dom.NamedNodeMap attrs)
Returns a sorted list of attributes.
|
private java.io.PrintWriter out
private boolean canonical
private boolean prettyprint
private boolean writeXMLDeclaration
private boolean ignoreWhitespace
private java.lang.String charsetName
private int prettyIndent
private boolean wroteXMLDeclaration
private org.w3c.dom.Node rootNode
private boolean completeNamespaces
private java.lang.String currentDefaultNamespace
public DOMWriter(java.io.Writer w)
public DOMWriter(java.io.Writer w,
java.lang.String charsetName)
public DOMWriter(java.io.OutputStream stream)
public DOMWriter(java.io.OutputStream stream,
java.lang.String charsetName)
public static java.lang.String printNode(org.w3c.dom.Node node,
boolean prettyprint)
public boolean isCanonical()
public DOMWriter setCanonical(boolean canonical)
public boolean isIgnoreWhitespace()
public DOMWriter setIgnoreWhitespace(boolean ignoreWhitespace)
public DOMWriter setCompleteNamespaces(boolean complete)
public boolean isPrettyprint()
public DOMWriter setPrettyprint(boolean prettyprint)
public boolean isWriteXMLDeclaration()
public DOMWriter setWriteXMLDeclaration(boolean flag)
public void print(org.w3c.dom.Node node)
private void printInternal(org.w3c.dom.Node node,
boolean indentEndMarker)
private java.lang.String getNamespaceURI(java.lang.String prefix,
org.w3c.dom.Element element,
org.w3c.dom.Node stopNode)
private boolean isEndMarkerIndented(org.w3c.dom.Node node)
private org.w3c.dom.Attr[] sortAttributes(org.w3c.dom.NamedNodeMap attrs)
public static java.lang.String normalize(java.lang.String s,
boolean canonical)