From: Stefan B. <bo...@ap...> - 2007-05-29 04:33:32
|
On Thu, 24 May 2007, Erik van Oosten <eri...@fi...> wrote: > (Trying from my work e-mail now.) which didn't seem to work. Unfortunately I'm not a moderator for this list so I can't help. > Ok, those are good points. The pretty printing was sloppy, but > actually the same xml (except for whitespace). > > When I remove whitespace from the input with a liberal > replaceAll(">\\s*<", "><") I get the differences I expected. Good. This means it really is a whitespace issue. > However, when I do XMLUnit.setIgnoreWhitespace(true) instead, I get > the following exception: > > java.lang.NullPointerException > at net.sf.saxon.Controller.prepareInputTree(Controller.java:1386) ... > On my classpath I have: > xmlunit 1.1beta1 > saxon 8.7 > xalan 2.6.0 > xercesImpl 2.8.1 > stax 1.1.1 Try setting the Transformer to Xalan instead. XMLUnit uses the following (trivial, I think) stylesheet to strip whitespace when you enable ignoreWhitespace. <?xml version="1.0" encoding="UTF-8" standalone="no"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" version="1.0" indent="no"/> <xsl:strip-space elements="*"/> <xsl:template match="/"><xsl:copy-of select="."/></xsl:template> </xsl:stylesheet> No idea why Saxon should choke on it. Stefan |