Re: [xsl] XSLT Unit testing

Subject: Re: [xsl] XSLT Unit testing
From: "Tony Graham" <tgraham@xxxxxxxxxx>
Date: Thu, 18 Aug 2011 15:06:13 +0100 (IST)
On Thu, August 18, 2011 2:46 pm, Florent Georges wrote:
> davep wrote:
>> > For what its worth, I've not used xslt specific test
>> > frameworks, instead using standard junt tests that run the
>> > transform and then use xpaths on the result (well, xquery).
>> Ever thought about using Schematron here Andrew?
>   The fundamental difference is that Schematron is aimed at
> representing assertions to be always true in all instance
> documents but are not representable in a schema (like "there must

If you wanted to, you could write test-specific Schematron rules.  If you
really wanted to slow down the processing, you could even transform XSpec
tests into Schematron (which would then be transformed into XSLT rather
than the XSpec framework transforming XSpec tests into XSLT).

But sometimes the test runner and the report format are as important as
the test itself: if you have, say, a lot of Java code and a bit of XSLT in
your project, it can be better to have the XSLT unit test results appear
in the same summary report as the Java tests, rather than having to run
them a different way and look somewhere else for the results.

Which is why several frameworks [1], including Juxy and <jxsl/> work with
JUnit or NUnit.


Tony Graham                                   tgraham@xxxxxxxxxx
Mentea       13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
 --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
    XML, XSL FO and XSLT consulting, training and programming


Current Thread