Class XMLUtil


  • public class XMLUtil
    extends Object
    Utility methods for the manipulation of XML documents and elements.
    • Constructor Detail

      • XMLUtil

        public XMLUtil()
    • Method Detail

      • prettyPrintToFile

        public static void prettyPrintToFile​(File f,
                                             Document doc)
        Pretty print a specified XML document to a file.
        Parameters:
        f - the File to which the document should be serialized
        doc - the XML document to serialize
      • prettyPrintToString

        public static String prettyPrintToString​(Document doc)
        Pretty print a specified XML document to a string.
        Parameters:
        doc - the XML document to serialize
        Returns:
        a string containing serialized XML document
      • prepareTransformer

        public static Transformer prepareTransformer()
      • docFromFilePath

        public static Document docFromFilePath​(String documentPath)
        Parameters:
        documentPath - Fully qualified path to the PMML / XML document.
        Returns:
        the document object.