On Thu, 24 May 2007, Erik van Oosten <[EMAIL PROTECTED]>
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

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Xmlunit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xmlunit-general

Reply via email to