1 16 17 package org.apache.commons.digester; 18 19 20 21 import java.io.File ; 22 23 import javax.xml.parsers.SAXParser ; 24 import javax.xml.parsers.SAXParserFactory ; 25 26 import org.xml.sax.helpers.DefaultHandler ; 27 28 import junit.framework.TestCase; 29 30 35 public class TestEntityResolution extends TestCase { 36 37 public void testParserResolveRelative() throws Exception { 38 SAXParserFactory factory = SAXParserFactory.newInstance(); 39 factory.setValidating(true); 40 factory.setNamespaceAware(true); 41 SAXParser parser = factory.newSAXParser(); 42 43 parser.parse( 44 new File ("src/test/org/apache/commons/digester/document-with-relative-dtd.xml"), 45 new DefaultHandler ()); 46 } 47 48 public void testDigesterResolveRelative() throws Exception { 49 Digester digester = new Digester(); 50 digester.setValidating(true); 51 digester.parse( 52 new File ("src/test/org/apache/commons/digester/document-with-relative-dtd.xml")); 53 } 54 } 55 | Popular Tags |