Class XmlDomWriter

java.lang.Object
com.aowagie.text.xml.XmlDomWriter

public class XmlDomWriter extends Object
  • Field Details

    • fOut

      private PrintWriter fOut
      Print writer.
    • fCanonical

      private boolean fCanonical
      Canonical output.
    • fXML11

      private boolean fXML11
      Processing XML 1.1 document.
  • Constructor Details

    • XmlDomWriter

      public XmlDomWriter()
      Default constructor.
  • Method Details

    • setCanonical

      public void setCanonical(boolean canonical)
      Sets whether output is canonical.
      Parameters:
      canonical - Canonical
    • setOutput

      public void setOutput(OutputStream stream, String encoding) throws UnsupportedEncodingException
      Sets the output stream for printing.
      Parameters:
      stream - Stream
      encoding - Encoding
      Throws:
      UnsupportedEncodingException - on error
    • setOutput

      public void setOutput(Writer writer)
      Sets the output writer.
      Parameters:
      writer - Writer
    • write

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

      private Attr[] sortAttributes(NamedNodeMap attrs)
      Returns a sorted list of attributes.
      Parameters:
      attrs - Attributes
      Returns:
      Attributes
    • normalizeAndPrint

      private void normalizeAndPrint(String s, boolean isAttValue)
      Normalizes and prints the given string.
      Parameters:
      s - String
      isAttValue - Attribute value
    • normalizeAndPrint

      private void normalizeAndPrint(char c, boolean isAttValue)
      Normalizes and print the given character.
      Parameters:
      c - Char
      isAttValue - Is attribute