Java XML DocumentBuilder Create getDocumentBuilder()

Here you can find the source of getDocumentBuilder()

Description

Get a DocumentBuilder that is namespace aware.

License

Open Source License

Return

a namespace-aware DocumentBuilder.

Declaration

public static DocumentBuilder getDocumentBuilder() throws Exception 

Method Source Code


//package com.java2s;
/*---------------------------------------------------------------
*  Copyright 2005 by the Radiological Society of North America
*
*  This source software is released under the terms of the
*  RSNA Public License (http://mirc.rsna.org/rsnapubliclicense)
*----------------------------------------------------------------*/

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

public class Main {
    /**/*from   w  ww . jav a2  s. c  o m*/
     * Get a DocumentBuilder that is namespace aware.
     * @return a namespace-aware DocumentBuilder.
     */
    public static DocumentBuilder getDocumentBuilder() throws Exception {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        return dbf.newDocumentBuilder();
    }
}

Related

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