From: Anamika M. <pra...@ho...> - 2007-05-02 16:30:44
|
Stephan - I Stephan, I see that you have posted a response to my question -= but am not able to view the response (getting an Internal Server Error). C= ould you pl. send me your response at pra...@ho...ank you very = much.Anamika.----------------------------------------------------------=20 From: pra...@ho...To: xml...@li...Date: W= ed, 2 May 2007 11:59:07 -0400Subject: [Xmlunit-general] Comparing two xml d= ocs with an external dtd Hello - I have written the following method in which I am trying to first v= alidate two xml documents against an external dtd and then my aim is to com= pare the two validated xml documents, but am getting an error (no protocol = InfoSettlementResponse.dtd) during the comparing step because of the extern= al dtd. 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/InfoSettlem= entResponse_control.xml");File dtdFile =3D new File("C:/Program Files/xmlun= it/tests/etc/InfoSettlementResponse.dtd");assertEquals(dtdFile.getAbsoluteP= ath(), true, dtdFile.exists());String dtdUrl =3D dtdFile.toURL().toExternal= Form();Validator vTest =3D new Validator(new FileReader(testf), dtdUrl);Val= idator vControl =3D new Validator(new FileReader(controlf), dtdUrl);assertX= MLValid(vTest);assertXMLValid(vControl);//GETTING AN ERROR IN THE FOLLOWING= LINE compareXML(new FileReader(testf), new FileReader(controlf));}Thank yo= u.Anamika.----------------------------------------------------------=20 Discover the new Windows Vista Learn more!=20 _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=3Dwindows+vista&mkt=3Den-US&form=3DQBR= E= |