Package com.itextpdf.kernel.xmp
Class XmlDomWriter
- java.lang.Object
-
- com.itextpdf.kernel.xmp.XmlDomWriter
-
public class XmlDomWriter extends java.lang.Object
This class writes the DOM structure of the XML to the specified output.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
fCanonical
Canonical output.protected java.io.PrintWriter
fOut
Print writer.protected boolean
fXML11
Processing XML 1.1 document.
-
Constructor Summary
Constructors Constructor Description XmlDomWriter()
Default constructor.XmlDomWriter(boolean canonical)
Creates an XmlDomWriter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
normalizeAndPrint(char c, boolean isAttValue)
Normalizes and print the given character.protected void
normalizeAndPrint(java.lang.String s, boolean isAttValue)
Normalizes and prints the given string.void
setCanonical(boolean canonical)
Sets whether output is canonical.void
setOutput(java.io.OutputStream stream, java.lang.String encoding)
Sets the output stream for printing.protected org.w3c.dom.Attr[]
sortAttributes(org.w3c.dom.NamedNodeMap attrs)
Returns a sorted list of attributes.void
write(org.w3c.dom.Node node)
Writes the specified node, recursively.
-
-
-
Method Detail
-
setCanonical
public void setCanonical(boolean canonical)
Sets whether output is canonical.- Parameters:
canonical
- should the writer write canonical output or not
-
setOutput
public void setOutput(java.io.OutputStream stream, java.lang.String encoding)
Sets the output stream for printing.- Parameters:
stream
- theOutputStream
to which data will be writtenencoding
- output stream encoding
-
write
public void write(org.w3c.dom.Node node)
Writes the specified node, recursively.- Parameters:
node
- the type ofNode
for writing
-
sortAttributes
protected org.w3c.dom.Attr[] sortAttributes(org.w3c.dom.NamedNodeMap attrs)
Returns a sorted list of attributes.- Parameters:
attrs
- objects implementingNamedNodeMap
that will be sorted- Returns:
- a sorted list of attributes
-
normalizeAndPrint
protected void normalizeAndPrint(java.lang.String s, boolean isAttValue)
Normalizes and prints the given string.- Parameters:
s
- theString
that should be printedisAttValue
- 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 printedisAttValue
- this flag determines whether some characters will be escaped
-
-