 |
 |
 |
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
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |