Java Utililty Methods XML DocumentBuilder Create

List of utility methods to do XML DocumentBuilder Create

Description

The list of methods to do XML DocumentBuilder Create are organized into topic(s).

Method

DocumentBuilderFactorygetDocumentBuilderFactory(String schema)
Gets the document builder factory.
System.setProperty(DOCUMENT_BUILDER_FACTORY_KEY, DOCUMENT_BUILDER_FACTORY_VALUE);
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
factory.setValidating(true);
factory.setAttribute(SCHEMA_LANGUAGE_KEY, HTTP_WWW_W3_ORG_2001_XML_SCHEMA);
factory.setAttribute(SCHEMA_SOURCE_KEY, schema);
return factory;
StringgetDocumentBuilderFactoryClassName()
get Document Builder Factory Class Name
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
return factory.getClass().getName();
DocumentBuildergetNewDocumentBuilder()
get New Document Builder
return DOC_FACTORY.get().newDocumentBuilder();
DocumentBuildergetNewDocumentBuilder()
get New Document Builder
try {
    final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setAttribute("http://xml.org/sax/features/namespaces", true);
    factory.setAttribute("http://xml.org/sax/features/validation", false);
    factory.setAttribute("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false);
    factory.setAttribute("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
    factory.setNamespaceAware(true);
    factory.setIgnoringElementContentWhitespace(true);
...
DocumentBuildernewDocumentBuilder()
Construct a non-validating document builder.
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
factory.setValidating(false);
try {
    factory.setFeature("http://xml.org/sax/features/validation", false);
    factory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false);
    factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
    return factory.newDocumentBuilder();
...
DocumentBuildernewDocumentBuilder()
Return a new DocumentBuilder for parsing into DOM.
final DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);
documentBuilderFactory.setValidating(false);
documentBuilderFactory.setIgnoringComments(true);
documentBuilderFactory.setIgnoringElementContentWhitespace(true);
try {
    return documentBuilderFactory.newDocumentBuilder();
} catch (ParserConfigurationException exception) {
...
DocumentBuildernewDocumentBuilder()
new Document Builder
return newDocumentBuilder(true);
DocumentBuildernewDocumentBuilder()
new Document Builder
try {
    return DocumentBuilderFactory.newInstance().newDocumentBuilder();
} catch (final Exception e) {
    throw new IllegalStateException(e.getMessage(), e);
DocumentBuildernewDocumentBuilder()
new Document Builder
return newDocumentBuilderFactory().newDocumentBuilder();
DocumentBuildernewDocumentBuilder()
Creates a new DocumentBuilder object.
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setFeature(javax.xml.XMLConstants.FEATURE_SECURE_PROCESSING, true);
factory.setNamespaceAware(true);
factory.setValidating(false);
factory.setIgnoringComments(true);
factory.setExpandEntityReferences(false);
factory.setCoalescing(false);
factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
...