From: SourceForge.net <no...@so...> - 2008-04-04 15:14:09
|
Bugs item #1903923, was opened at 2008-02-28 15:26 Message generated for change (Comment added) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1903923&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: Java 1.1 >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Stefan Bodewig (bodewig) Assigned to: Stefan Bodewig (bodewig) Summary: ignoreWhitespace and CDATA don't mix well Initial Comment: as originally reported by "nobody" in bug 1863632 public void testDit() throws SAXException, IOException { String shcont = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Data><Person><Name><![CDATA[JOE]]></Name></Person></Data>"; String newTest = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +"<Data>" +" <Person>" +" <Name>" +" <![CDATA[JOE]]>" +" </Name>" +" </Person>" +"</Data>"; XMLUnit.setIgnoreWhitespace(true); try { Diff diff = XMLUnit.compareXML(shcont, newTest); System.out.println(diff.toString()); assertTrue(diff.similar()); } finally { XMLUnit.setIgnoreWhitespace(false); } } fails ---------------------------------------------------------------------- >Comment By: Stefan Bodewig (bodewig) Date: 2008-04-04 17:14 Message: Logged In: YES user_id=113148 Originator: YES if you setIgnoreDiffBetweenCDATAAndText to true as well, whitespace can be ignored in the presence of CDATA as well. http://xmlunit.svn.sourceforge.net/viewvc/xmlunit?view=rev&revision=260 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1903923&group_id=23187 |