Class XMLUtil


  • public final class XMLUtil
    extends java.lang.Object
    Since:
    3.4
    Author:
    Eike Stepper
    • Method Detail

      • createDocumentBuilder

        public static javax.xml.parsers.DocumentBuilder createDocumentBuilder()
                                                                       throws javax.xml.parsers.ParserConfigurationException
        Throws:
        javax.xml.parsers.ParserConfigurationException
      • loadRootElement

        public static org.w3c.dom.Element loadRootElement​(javax.xml.parsers.DocumentBuilder documentBuilder,
                                                          java.io.File file)
                                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • loadDocument

        public static org.w3c.dom.Document loadDocument​(javax.xml.parsers.DocumentBuilder documentBuilder,
                                                        java.io.File file)
                                                 throws org.xml.sax.SAXException,
                                                        java.io.IOException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • handleElements

        public static int handleElements​(org.w3c.dom.NodeList nodeList,
                                         XMLUtil.ElementHandler handler)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • handleChildElements

        public static int handleChildElements​(org.w3c.dom.Element rootElement,
                                              XMLUtil.ElementHandler handler)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • handleElementsByTagName

        public static int handleElementsByTagName​(org.w3c.dom.Element rootElement,
                                                  java.lang.String tagName,
                                                  XMLUtil.ElementHandler handler)
                                           throws java.lang.Exception
        Throws:
        java.lang.Exception