| Editing Documents / Editing XSLT Stylesheets | |
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 . 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
<x:scenario label="when processing a para element">
<x:context>
<para>...</para>
</x:context>
...
</x:scenario>
<x:scenario label="when processing a para element">
<x:context href="source/test.xml" select="/doc/body/p[1]" />
...
</x:scenario>
<x:scenario label="when capitalising a string">
<x:call function="eg:capital-case">
<x:param select="'an example string'" />
<x:param select="true()" />
</x:call>
...
</x:scenario>
<x:call template="createTable">
<x:param name="nodes">
<value>A</value>
<value>B</value>
</x:param>
<x:param name="cols" select="2" />
</x:call>