Code example for DocumentBuilder

Methods: parse, setEntityResolver

0
		throws IOException 
	{ 
		try { 
			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
			DocumentBuilder builder = factory.newDocumentBuilder();
			builder.setEntityResolver(new NoResolver());
			return builder.parse(stream);
		} catch (Exception ex) {
			throw new IOException(ex);
		} 
	} 
	 
	 
	/** 
	 * Reads and returns the XML document in the given string. 
	 */ 
	public static Document read(String data)
		throws IOException 
	{ 
		try { 
			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();