Code example for DocumentBuilder

Methods: newDocument

0
			documentBuilder = documentBuilderFactory.newDocumentBuilder();
		} catch (ParserConfigurationException e) {
			e.printStackTrace();
		} 
		 
		doc = documentBuilder.newDocument();
		createRootElement(); 
		createPreferencesElement(); 
	} 
	 
	private void createPreferencesElement() { 
		propertiesElement = doc.getDocumentElement().appendChild(doc.createElement("properties"));
	} 
 
	private void createRootElement() { 
		doc.appendChild(doc.createElement("metriculator"));
	} 
}