Class XmlDomWriter


  • public class XmlDomWriter
    extends Object
    Author:
    psoares
    • Field Detail

      • fCanonical

        protected boolean fCanonical
        Canonical output.
      • fXML11

        protected boolean fXML11
        Processing XML 1.1 document.
    • Constructor Detail

      • XmlDomWriter

        public XmlDomWriter()
        Default constructor.
      • XmlDomWriter

        public XmlDomWriter​(boolean canonical)
    • Method Detail

      • setCanonical

        public void setCanonical​(boolean canonical)
        Sets whether output is canonical.
        Parameters:
        canonical - true if canonical, false otherwise
      • setOutput

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

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

        protected Attr[] sortAttributes​(NamedNodeMap attrs)
        Returns a sorted list of attributes.
        Parameters:
        attrs - the NameNomeMap of attributes
        Returns:
        a Attr array of sorted attributes
      • normalizeAndPrint

        protected void normalizeAndPrint​(String s,
                                         boolean isAttValue)
        Normalizes and prints the given string.
        Parameters:
        isAttValue - boolean
        s - the String to normalize and print
      • normalizeAndPrint

        protected void normalizeAndPrint​(char c,
                                         boolean isAttValue)
        Normalizes and print the given character.
        Parameters:
        c - the character
        isAttValue - boolean