My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
RunningScenarios  
How to test whether your stylesheet meets its description
Phase-Deploy
Updated Aug 30, 2011 by dev.xs...@menteithconsulting.com

Currently, to run the tests, the XSpec description document is transformed into an XSLT stylesheet which imports the stylesheet being tested. Running this stylesheet results in an XML document that holds the results, which is then transformed into an HTML report. The two stylesheets involved in this process are:

Two scripts are provided that will perform this pipeline for you:

  • xspec.bat, a Windows batch script.
  • xspec.sh, a bash script for Mac OS X (might work on linux, but untested).

Note that you will have to edit each script to match the location of Saxon on your system.

To run the batch/bash scripts, use the command line:

> xspec filename

Two alternative scripts are also provided:

  • build.xml, an Ant build. You will have to edit the script to point to location of Saxon on your system. To run, use the command line:
    > ant -Dxspec.xml=filename
Also see RunningWithAnt.
  • xspec.xpl, an XProc pipeline (note that it doesn't indent the XML output correctly). To run, use the command line:
   > java com.xmlcalabash.drivers.Main -i source=filename xspec.xpl

You can also integrate XSpec into Oxygen.

If you develop more scripts, please share them.

Comment by goo...@saremba.de, Sep 11, 2008

Obviously, a simple XSpec example document that demonstrates the main features would help a lot in understanding. (Or even a more elaborate one - how about testing generate-xspec-tests.xsl with XSpec?)

Comment by gigaple...@gmail.com, Apr 30, 2009

Are there plans to integrate this with JUnit like "Tennison Tests" does?

Comment by hutchkin...@gmail.com, Mar 23, 2010

Hi,and thanks for a great test framework! I've been looking for a good way to test my xslt 2.0 stylesheets and this works like a charm.

Are there any plans to provide a maven2 plugin to run these tests automatically during a build?

Comment by project member fgeor...@gmail.com, Mar 23, 2010

Hi, thanks! I personally do not have such plans, maybe others. Actually I do not really know Maven, so I am not sure how generally useful that would be. But we'd be glad to add a link in the documentation to any work done by someone else. By the way, I suggest to use the mailing list for any discussion, following the comments is quite difficult.


Sign in to add a comment
Powered by Google Project Hosting