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

XMLNamespaceDigest

public class XMLNamespaceDigest extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

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


		Pages pages = new Pages();
		
		Digester digester = new Digester();
		digester.setNamespaceAware(true);

		digester.setRuleNamespaceURI("http://discursive.com/page");
		URL pageRules = getClass().getResource("./page-rules.xml");
		digester.addRuleSet( new FromXmlRuleSet( pageRules ) );
		
		digester.setRuleNamespaceURI("http://discursive.com/person");
		URL personRules = getClass().getResource("./person-rules.xml");
		digester.addRuleSet( new FromXmlRuleSet( personRules ) );
		
		digester.push(pages);

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

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