Class XmlDomWriter

java.lang.Object
com.itextpdf.kernel.xmp.XmlDomWriter

public class XmlDomWriter extends Object
This class writes the DOM structure of the XML to the specified output.
  • Field Details

    • fOut

      protected PrintWriter fOut
      Print writer.
    • fCanonical

      protected boolean fCanonical
      Canonical output.
    • fXML11

      protected boolean fXML11
      Processing 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

      public void setOutput (OutputStream stream, String encoding)
      Sets the output stream for printing.
      Parameters:
      stream - the OutputStream to which data will be written
      encoding - output stream encoding
    • write

      public void write (Node node)
      Writes the specified node, recursively.
      Parameters:
      node - the type of Node for writing
    • sortAttributes

      protected Attr[] sortAttributes (NamedNodeMap attrs)
      Returns a sorted list of attributes.
      Parameters:
      attrs - objects implementing NamedNodeMap that will be sorted
      Returns:
      a sorted list of attributes
    • normalizeAndPrint

      protected void normalizeAndPrint (String s, boolean isAttValue)
      Normalizes and prints the given string.
      Parameters:
      s - the String 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