Java XML DocumentBuilder Create getDocumentBuilder(boolean NamespaceAwareness)

Here you can find the source of getDocumentBuilder(boolean NamespaceAwareness)

Description

get Document Builder

License

Apache License

Declaration

private static DocumentBuilder getDocumentBuilder(boolean NamespaceAwareness)
            throws ParserConfigurationException 

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(boolean NamespaceAwareness)
            throws ParserConfigurationException {
        DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
        domFactory.setNamespaceAware(NamespaceAwareness);
        //domFactory.setValidating(true);
        //domFactory.setIgnoringElementContentWhitespace( true );
        domFactory.setAttribute("http://apache.org/xml/features/dom/include-ignorable-whitespace", Boolean.FALSE);

        return domFactory.newDocumentBuilder();
    }//  w  ww  .ja v  a2 s.c o  m
}

Related

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