[xsl] [ANN] xchecker

Subject: [xsl] [ANN] xchecker
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 5 Jun 2007 12:03:02 +0100
As it's quiet today it seems like a good time to announce a little
utility I've been working on  recently that I've called "xchecker" (I
don't really like the name and I came up with it! at least its
slightly better than the original of 'CheckXML'...)

xchecker allows you to:

- test XML (or the XML result of a transform) using XPath, XSLT, XSD,
XQuery, Relax NG in combination.
- embed XPath 2.0 checks (and others) in XML Schema

It can be downloaded from here:


The relevant topic for this list is to use xchecker as a test
framework for XSLT. To do that you create a Check Config with a
transform subject:

<xchecker xmlns="http://xchecker.sf.net/";>

 <transform xml="xml/books.xml" xslt="xslt/books.xslt"
   <check>/html/head/title = 'Books by publisher'</check>


xchecker will apply the transform (using Saxon) and then evaluate each
<check> on the result.  In order for a check to pass, xchecker looks
for the following:

- For XML Schema / Relax NG the document should validate
- For XSLT / XQuery checks a single 'true' should be the result
- For XPath a sequence of items can be returned with each one being 'true'

Any non-'true' values are returned as the failure message, so you can
re-write your tests to be a little more informative in the event of a

<check>if (/html/head/title = 'Books by publisher') then 'true'
             else concat('Unexpected title:', /html/head/title)</check>

...or some other inventive use of XPath.

There's more info on the xchecker home page at http://xchecker.sf.net/


Current Thread