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
FieldsModifier and TypeFieldDescriptionprotected booleanCanonical output.protected PrintWriterPrint writer.protected booleanProcessing XML 1.1 document. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.XmlDomWriter(boolean canonical) Creates an XmlDomWriter. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidnormalizeAndPrint(char c, boolean isAttValue) Normalizes and print the given character.protected voidnormalizeAndPrint(String s, boolean isAttValue) Normalizes and prints the given string.voidsetCanonical(boolean canonical) Sets whether output is canonical.voidsetOutput(OutputStream stream, String encoding) Sets the output stream for printing.protected Attr[]sortAttributes(NamedNodeMap attrs) Returns a sorted list of attributes.voidWrites 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- theOutputStreamto which data will be written -
encoding- output stream encoding
-
write
Writes the specified node, recursively.- Parameters:
-
node- the type ofNodefor writing
-
sortAttributes
Returns a sorted list of attributes.- Parameters:
-
attrs- objects implementingNamedNodeMapthat will be sorted - Returns:
- a sorted list of attributes
-
normalizeAndPrint
Normalizes and prints the given string.- Parameters:
-
s- theStringthat 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
-