Code example for DocumentBuilder

Methods: newDocument

0
     */ 
    DocumentBuilder builder = null;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    try{ 
      builder = factory.newDocumentBuilder();
      this._report = builder.newDocument();
    } catch (ParserConfigurationException e) {
      e.printStackTrace();
    } 
       
    // Insert Root Element 
    Element root = (Element) this._report.createElement("PostExPerformanceDiagnosticReport");
    this._report.appendChild(root);
  } 
   
  /* 
   * Print the report document to console 
   */ 
  public void printReport() { 
    XMLUtils.printDOM(this._report);
Stop searching for code, let great code find you!  Add Codota to your java IDE