From: SourceForge.net <no...@so...> - 2007-06-06 12:17:23
|
Bugs item #1731980, was opened at 2007-06-06 12:16 Message generated for change (Comment added) made by rooks_sf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1731980&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Rooks (rooks_sf) Assigned to: Nobody/Anonymous (nobody) Summary: XMLUnit say indentical xmls are different Initial Comment: Consider the 2 attached xmls : They are same but for whitespaces but following code says they are different. public static boolean compareFiles(File f1, File f2) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document d1 = builder.parse(f1); DocumentBuilder builder1 = factory.newDocumentBuilder(); Document d2 = builder1.parse(f2); Diff xmlDiff = XMLUnit.compareXML(d1, d2); debug("XML Diff :: " + xmlDiff.toString()); return xmlDiff.identical() || xmlDiff.similar(); } The debug diff printed out is : XML Diff :: org.custommonkey.xmlunit.Diff [different] Expected number of child nodes '8' but was '9' - comparing <hierarchy...> at /hierarchy[1] to <hierarchy...> at /hierarchy[1] ---------------------------------------------------------------------- >Comment By: Rooks (rooks_sf) Date: 2007-06-06 12:17 Message: Logged In: YES user_id=1535638 Originator: YES File Added: testExportHierarchy_Output.xml ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1731980&group_id=23187 |