On 2011-01-20, Dean Schulze wrote: > When I create a Diff with two log4j.xml files it throws a > FileNotFoundException with this message:
> java.io.FileNotFoundException: > C:\dean\projects\ear.expand.diff\log4j.dtd (The system cannot find the > file specified) > Apparently XmlUnit is looking for log4j.dtd in the directory where I'm > executing XmlUnit. > I don't want XmlUnit to validate the 2 log4j.xml files. I only want > to know if they are similar. XMLUnit itself doesn't try to validate the documents per se, but your XML parser might want to do so. > Do I have to turn off validation in this case? Yes. If you are configuring the DocumentBuilder XMLUnit uses yourself, make sure you don't enable validation. If you do not configure it yourself than the default created by your JVM is in validating mode. In order to turn validation off you'd have to create an instance of the default DocumentBuilderFactory, set it to not validate XML and pass it to both XMLUnit.setControlDocumentBuilderFactory and setTestDocumentBuildFactory. Alternatively you can create the DOM Document instances yourself and use the Diff constructor (or the XMLunit.compareXML overload) taking two Documents. Stefan ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Xmlunit-general mailing list Xmlunit-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xmlunit-general