Package com.aowagie.text.xml
Class XmlDomWriter
java.lang.Object
com.aowagie.text.xml.XmlDomWriter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
Canonical output.private PrintWriter
Print writer.private boolean
Processing XML 1.1 document. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
normalizeAndPrint
(char c, boolean isAttValue) Normalizes and print the given character.private 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.void
Sets the output writer.private Attr[]
sortAttributes
(NamedNodeMap attrs) Returns a sorted list of attributes.void
Writes the specified node, recursively.
-
Field Details
-
fOut
Print writer. -
fCanonical
private boolean fCanonicalCanonical output. -
fXML11
private boolean fXML11Processing XML 1.1 document.
-
-
Constructor Details
-
XmlDomWriter
public XmlDomWriter()Default constructor.
-
-
Method Details
-
setCanonical
public void setCanonical(boolean canonical) Sets whether output is canonical.- Parameters:
canonical
- Canonical
-
setOutput
Sets the output stream for printing.- Parameters:
stream
- Streamencoding
- Encoding- Throws:
UnsupportedEncodingException
- on error
-
setOutput
Sets the output writer.- Parameters:
writer
- Writer
-
write
Writes the specified node, recursively.- Parameters:
node
- Node
-
sortAttributes
Returns a sorted list of attributes.- Parameters:
attrs
- Attributes- Returns:
- Attributes
-
normalizeAndPrint
Normalizes and prints the given string.- Parameters:
s
- StringisAttValue
- Attribute value
-
normalizeAndPrint
private void normalizeAndPrint(char c, boolean isAttValue) Normalizes and print the given character.- Parameters:
c
- CharisAttValue
- Is attribute
-