From: Anamika M. <pra...@ho...> - 2007-05-02 15:59:20
|
Hello -=20 I have written the following method in which I am trying to first validate = two xml documents against an external dtd and then my aim is to compare the= two validated xml documents, but am getting an error (no protocol InfoSett= lementResponse.dtd) during the comparing step because of the external dtd.= =20 Here is my code - could someone pl. let me know what is missing - i.e. how = do I compare two xml files that have an external DTD?? =20 public void testValidationThenCompareTwoXMLFiles() throws Exception { File testf =3D new File("C:/Program Files/xmlunit/tests/etc/InfoSettlementR= esponse_test.xml"); File controlf =3D new File("C:/Program Files/xmlunit/tests/etc/InfoSettleme= ntResponse_control.xml"); File dtdFile =3D new File("C:/Program Files/xmlunit/tests/etc/InfoSettlemen= tResponse.dtd"); assertEquals(dtdFile.getAbsolutePath(), true, dtdFile.exists()); String dtdUrl =3D dtdFile.toURL().toExternalForm(); Validator vTest =3D new Validator(new FileReader(testf), dtdUrl); Validator vControl =3D new Validator(new FileReader(controlf), dtdUrl); assertXMLValid(vTest); assertXMLValid(vControl); //GETTING AN ERROR IN THE FOLLOWING LINE=20 compareXML(new FileReader(testf), new FileReader(controlf)); } Thank you. Anamika.----------------------------------------------------------=20 _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=3Dwindows+vista&mkt=3Den-US&form=3DQBR= E= |