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:
http://xchecker.sf.net/
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"
result="result/output.html">
<check>/html/head/title = 'Books by publisher'</check>
<check>exists(/html/head/meta)</check>
</transform>
</xchecker>
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
failure:
<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/
cheers
andrew
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--