Package com.itextpdf.kernel.xmp
Class XmlDomWriter
- java.lang.Object
-
- com.itextpdf.kernel.xmp.XmlDomWriter
-
public class XmlDomWriter extends java.lang.ObjectThis class writes the DOM structure of the XML to the specified output.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanfCanonicalCanonical output.protected java.io.PrintWriterfOutPrint writer.protected booleanfXML11Processing 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 voidnormalizeAndPrint(char c, boolean isAttValue)Normalizes and print the given character.protected voidnormalizeAndPrint(java.lang.String s, boolean isAttValue)Normalizes and prints the given string.voidsetCanonical(boolean canonical)Sets whether output is canonical.voidsetOutput(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.voidwrite(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- theOutputStreamto 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 ofNodefor writing
-
sortAttributes
protected org.w3c.dom.Attr[] sortAttributes(org.w3c.dom.NamedNodeMap attrs)
Returns a sorted list of attributes.- Parameters:
attrs- objects implementingNamedNodeMapthat 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- theStringthat 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
-
-