From: Majumder, A. <Ana...@Om...> - 2007-05-02 15:41:47
|
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 InfoSettlementResponse.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?? public void testValidationThenCompareTwoXMLFiles() throws Exception { File testf =3D new File("C:/Program Files/xmlunit/tests/etc/InfoSettlementResponse_test.xml"); File controlf =3D new File("C:/Program Files/xmlunit/tests/etc/InfoSettlementResponse_control.xml"); File dtdFile =3D new File("C:/Program Files/xmlunit/tests/etc/InfoSettlementResponse.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)); =20 } Thank you. Anamika. |