Java XML DocumentBuilder Create getDocumentBuilder()

Here you can find the source of getDocumentBuilder()

Description

get Document Builder

License

Apache License

Declaration

private static DocumentBuilder getDocumentBuilder() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

public class Main {
    private static DocumentBuilder getDocumentBuilder() {
        try {//from ww  w  .j  av  a 2  s.  co m
            return getDocumentBuilderFactory().newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            throw new IllegalStateException("Could not create DocumentBuilder", e);
        }
    }

    private static DocumentBuilderFactory getDocumentBuilderFactory() {

        final DocumentBuilderFactory toReturn = DocumentBuilderFactory.newInstance();
        toReturn.setNamespaceAware(true);
        return toReturn;
    }
}

Related

  1. getDocumentBuilder()
  2. getDocumentBuilder()
  3. getDocumentBuilder()
  4. getDocumentBuilder()
  5. getDocumentBuilder()
  6. getDocumentBuilder()
  7. getDocumentBuilder()
  8. getDocumentBuilder()
  9. getDocumentBuilder()