Class XmlStringPrettyFormatter


  • public class XmlStringPrettyFormatter
    extends Object
    Format an XML String with indent = 2 space.

    Very much inspired by http://stackoverflow.com/questions/139076/how-to-pretty-print-xml-from-java and http://pastebin.com/XL7932aC

    • Constructor Detail

      • XmlStringPrettyFormatter

        private XmlStringPrettyFormatter()
    • Method Detail

      • xmlPrettyFormat

        public static String xmlPrettyFormat​(String xmlStringToFormat)
      • prettyFormat

        private static String prettyFormat​(Document document,
                                           boolean keepXmlDeclaration)
      • toXmlDocument

        private static Document toXmlDocument​(String xmlString)