FileDocCategorySizeDatePackage
NamespaceDigest.javaAPI DocExample2768Wed May 18 09:39:04 BST 2005com.discursive.jccook.xml.bean

NamespaceDigest

public class NamespaceDigest extends Object

Fields Summary
Constructors Summary
Methods Summary
private voidaddPageRules(org.apache.commons.digester.Rules rules)

		rules.add("*/page", new ObjectCreateRule(Page.class));
		rules.add("*/page", new SetNextRule("add"));
	
public static voidmain(java.lang.String[] args)

		new NamespaceDigest().testDigest();
	
public voidtestDigest()


		Pages pages = new Pages();
		
		Digester digester = new Digester();
		digester.setNamespaceAware(true);
		digester.addRuleSet( new PageRuleSet() );
		digester.addRuleSet( new PersonRuleSet() );
		
		digester.push(pages);

		InputStream input = getClass().getResourceAsStream("./content.xml");
		digester.parse(input);

		Page page = (Page) pages.getPages().get(0);
		System.out.println(page);