XSLT Unit Test (XSpec)

XSpec is a behavior driven development (BDD) framework for XSLT and XQuery. XSpec consists of a syntax for describing the behavior of your XSLT or XQuery code, and some code that enables you to test your code against those descriptions.

To create an XSLT Unit Test, go to File > New > XSLT Unit Test. You can also create an XSLT Unit Test from the contextual menu of an XSL file in the Project view. Oxygen XML Editor plugin allows you to customize the XSpec document when you create it. In the customization dialog, you can enter the path to an XSL document or to a master XSL document.

When you create an XSpec document based on an XSL document, Oxygen XML Editor plugin uses information from the validation and transformation scenarios associated with the XSL file. From the transformation scenario Oxygen XML Editor plugin uses extensions and properties of Saxon 9.5.0.1, improving the ANT scenario associated with the XSpec document.

The New XSLT Unit Test wizard

An XSpec file contains one, or more test scenarios. You can test a stylesheet in one of the following ways: You are able to refer test files between each other, which allows you to define a suite of tests. For further details about test scenarios, go to http://code.google.com/p/xspec/wiki/WritingScenarios.