Code example for Node

Methods: appendChild

0
	@Override 
	public void characters(char[] ch, int start, int length) {
		String str = new String(ch, start, length);
		if(length > 0) {
			Text text = doc.createTextNode(str);
			current.appendChild(text);
		} 
	} 
 
	@Override 
	public void processingInstruction(String target, String data) {
		ProcessingInstruction pi = doc
				.createProcessingInstruction(target, data);
		current.appendChild(pi);
	} 
 
	public static void generateDOM(String xml, Document doc) throws SAXException {
		SAXParserFactory fact = SAXParserFactory.newInstance();
		try { 
			SAXParser parser = fact.newSAXParser();
			SAX2DomHandler handler = new SAX2DomHandler(doc);