Code example for DocumentBuilder

Methods: parse

0
            factory.setIgnoringComments(true);
            factory.setNamespaceAware(true);
 
            DocumentBuilder builder = factory.newDocumentBuilder();
            xml.reset();
            Document doc = builder.parse(new InputSource(xml));
 
            return doc;
        } catch (ParserConfigurationException e) {
            monitor.logError("Failed to create XML document builder");
 
        } catch (SAXException e) {
            monitor.logError("Failed to parse XML document");
 
        } catch (IOException e) {
            monitor.logError("Failed to read XML document");
        } 
 
        return null; 
    }