commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juergen Weber <webe...@yahoo.com>
Subject [digester] how to parse node trees
Date Fri, 30 Apr 2004 08:25:46 GMT
Hi Josť and Simon,

thank you very much for your help, your suggestion to
push a Node object first, worked.

I append the changed code, in case somebody else needs
it.

Thanks again,
Juergen

public static Object digest(InputStream xmlfile, URL
dtdfile)
throws Exception
{
	Digester digester = new Digester();
	digester.setValidating(false);
	digester.push(new Node());

	digester.addObjectCreate("*/node", Node.class);
	digester.addSetProperties("*/node");
	digester.addSetNext("*/node", "addNode");

	InputSource inputSource = new InputSource(xmlfile);

	inputSource.setSystemId(dtdfile.toString());

	return digester.parse(inputSource);
}





	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message