Package com.itextpdf.kernel.xmp
Class XmlDomWriter
java.lang.Object
com.itextpdf.kernel.xmp.XmlDomWriter
This class writes the DOM structure of the XML to the specified output.
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Canonical output.protected PrintWriter
Print writer.protected boolean
Processing XML 1.1 document. -
Constructor Summary
ConstructorDescriptionDefault constructor.XmlDomWriter
(boolean canonical) Creates an XmlDomWriter. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
Writes the specified node, recursively.
-
Field Details
-
fOut
Print writer. -
fCanonical
protected boolean fCanonicalCanonical output. -
fXML11
protected boolean fXML11Processing XML 1.1 document.
-
-
Constructor Details
-
XmlDomWriter
public XmlDomWriter()Default constructor. -
XmlDomWriter
public XmlDomWriter(boolean canonical) Creates an XmlDomWriter.- Parameters:
-
canonical
- should the writer write canonical output or not
-
-
Method Details
-
setCanonical
public void setCanonical(boolean canonical) Sets whether output is canonical.- Parameters:
-
canonical
- should the writer write canonical output or not
-
setOutput
Sets the output stream for printing.- Parameters:
-
stream
- theOutputStream
to which data will be written -
encoding
- output stream encoding
-
write
Writes the specified node, recursively.- Parameters:
-
node
- the type ofNode
for writing
-
sortAttributes
Returns a sorted list of attributes.- Parameters:
-
attrs
- objects implementingNamedNodeMap
that will be sorted - Returns:
- a sorted list of attributes
-
normalizeAndPrint
Normalizes and prints the given string.- Parameters:
-
s
- theString
that should be printed -
isAttValue
- this flag determines whether some characters will be escaped
-
normalizeAndPrint
protected void normalizeAndPrint(char c, boolean isAttValue) Normalizes and print the given character.- Parameters:
-
c
- character that should be printed -
isAttValue
- this flag determines whether some characters will be escaped
-