All pastes #921700 Raw Edit

Unnamed

public java v1 · immutable
#921700 ·published 2008-02-28 07:25 UTC
rendered paste body
String parentName = root.getTagName();// Verify that any Required tags are presentif( required ) {	NodeList nl = root.getElementsByTagName( tagName );	if( nl.getLength() < 1 )		throw new MissingRequiredTag( tagName, parentName );}// Proccess all child tagsnl = root.getChildNodes();for(int i=0; i<nl.getLength(); i++) {	Node n = nl.item(i);	if( n.getNodeType() == Node.ELEMENT_NODE ) {		Element e = (Element)n;		if( e.getTagName().equals( tagName ) ) {			callbackFunc(e);		}else{			String childTag = e.getTagName();			throw new UnknownXMLTag( tagName, childTag );		}	}}// End for i