Class XmlFormatter


  • public class XmlFormatter
    extends java.lang.Object
    Pretty-prints xml, supplied as a string.

    eg. String formattedXml = XmlFormatter.format("<tag><nested>hello</nested></tag>");

    StackOverflow: https://stackoverflow.com/questions/139076/how-to-pretty-print-xml-from-java

    • Constructor Summary

      Constructors 
      Constructor Description
      XmlFormatter()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String format​(java.lang.String xml)  
      static java.lang.String formatDocumentBody​(java.lang.String xml)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XmlFormatter

        public XmlFormatter()
    • Method Detail

      • format

        public static java.lang.String format​(java.lang.String xml)
      • formatDocumentBody

        public static java.lang.String formatDocumentBody​(java.lang.String xml)