public class XmlDomWriter extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
fCanonical
Canonical output.
|
protected PrintWriter |
fOut
Print writer.
|
protected boolean |
fXML11
Processing XML 1.1 document.
|
Constructor and Description |
---|
XmlDomWriter()
Default constructor.
|
XmlDomWriter(boolean canonical)
Creates an XmlDomWriter.
|
Modifier and Type | Method and Description |
---|---|
protected void |
normalizeAndPrint(char c, boolean isAttValue)
Normalizes and print the given character.
|
protected void |
normalizeAndPrint(String s, boolean isAttValue)
Normalizes and prints the given string.
|
void |
setCanonical(boolean canonical)
Sets whether output is canonical.
|
void |
setOutput(OutputStream stream, String encoding)
Sets the output stream for printing.
|
protected Attr[] |
sortAttributes(NamedNodeMap attrs)
Returns a sorted list of attributes.
|
void |
write(Node node)
Writes the specified node, recursively.
|
protected PrintWriter fOut
protected boolean fCanonical
protected boolean fXML11
public XmlDomWriter()
public XmlDomWriter(boolean canonical)
canonical
- should the writer write canonical output or not
public void setCanonical(boolean canonical)
canonical
- should the writer write canonical output or not
public void setOutput(OutputStream stream, String encoding)
stream
- the OutputStream
to which data will be written
encoding
- output stream encoding
public void write(Node node)
node
- the type of Node
for writing
protected Attr[] sortAttributes(NamedNodeMap attrs)
attrs
- objects implementing NamedNodeMap
that will be sorted
protected void normalizeAndPrint(String s, boolean isAttValue)
s
- the String
that should be printed
isAttValue
- this flag determines whether some characters will be escaped
protected void normalizeAndPrint(char c, boolean isAttValue)
c
- character that should be printed
isAttValue
- this flag determines whether some characters will be escaped
Copyright © 1998–2022 iText Group NV. All rights reserved.