Testing XSLT

Build 1501 on 14/Nov/2017  This topic last edited on: 7/Mar/2013, at 10:26

When creating XSLT for content processing, you will surely need to test the transformation results to finely tune the XSLT.

For this, you need a sample file to be processed. Wen you deal with importing of wire texts or wire images

The best way to test the transformation results is to use Back4 with enabled errors logging. After you created the XSL you want to test, at its end, before the closing statement, add the "debug" node such as:

 <debug>

   <params>

     <xsl:copy-of select="$pars"/>

   </params>

   <context>

     <xsl:copy-of select="$context"/>

   </context>

 </debug>

The purpose of such addition is double:

It will force an error in XML processing, so you will see the outcome in the output file in the log folder, and be able to review the results of your transformation.

It will print in the output file the parameters, received by XSL (both from the dataSrcTemplate and workflow), and the general context variables, available on the system level.

If XSLT is in an external file

Re-import the XSLT, and then copy in the appropriate input folder the sample file you want to test.

If XSLT is in a workflow

Re-import the workflow, and then re-submit the sample file you want to test.