Class XmlUtils


  • public class XmlUtils
    extends Object
    Author:
    pthomas3
    • Method Detail

      • toString

        public static String toString​(Node node)
      • toString

        public static String toString​(Node node,
                                      boolean pretty)
      • trimWhiteSpace

        public static void trimWhiteSpace​(Node node)
      • toXmlDoc

        public static Document toXmlDoc​(String xml,
                                        boolean namespaceAware)
      • getNodeListByPath

        public static NodeList getNodeListByPath​(Node node,
                                                 String path)
      • stripNameSpacePrefixes

        public static String stripNameSpacePrefixes​(String path)
      • getNodeByPath

        public static Node getNodeByPath​(Node node,
                                         String path,
                                         boolean create)
      • getTextValueByPath

        public static String getTextValueByPath​(Node node,
                                                String path)
      • setByPath

        public static void setByPath​(Node doc,
                                     String path,
                                     String value)
      • removeByPath

        public static void removeByPath​(Document doc,
                                        String path)
      • toJsonDoc

        public static com.jayway.jsonpath.DocumentContext toJsonDoc​(Node node)
      • getChildElementCount

        public static int getChildElementCount​(Node node)
      • toObject

        public static Object toObject​(Node node)
      • toObject

        public static Object toObject​(Node node,
                                      boolean removeNamespace)
      • newDocument

        public static Document newDocument()
      • toNewDocument

        public static Document toNewDocument​(Node in)
      • fromJavaObject

        public static Document fromJavaObject​(Object o)
      • isXml

        public static boolean isXml​(String s)