Software / XSLT Checker

The free tool for finding unused XSLT instructions

The XSLT Checker is a small data2type command-line project available for free download and use on GitHub.

What does XSLT Checker do?

It analyses existing XSLT stylesheets against an XML input dataset and lists all XSLT instructions unused during processing.

Why is this useful?

Stylesheets often evolve over years, with multiple developers changing and expanding them. They can accumulate dead or unused templates and instructions.

Unnecessary instructions make stylesheets harder to read and understand and slow processing.

XSLT Checker can also detect changes in the XML Schema being used, code dependencies and changes in the use of particular XSLT elements and attributes (for example, xsl:if {@val}).

How does the checker work?

The diagram below summarises the process: XSLT Checker checks XML files against stylesheets and produces a summary.

How XSLT Checker works

Figure: How XSLT Checker works.

The report is supplied as text and XML. It lists every unused instruction with its stylesheet line number and position, for example for querying with XPath.

Detailed instructions for XSLT Checker are available in English on our GitHub page.

Which XSLT elements are checked?

The next diagram shows two examples:

  1. A namespace that a template should match may have changed, or

  2. Conditions in an xsl:choose construct have been rewritten.

XSLT Checker — examples

Figure: XSLT Checker examples.

Requirements

XSLT Checker has the following requirements:

  • Windows systems only.

  • Java must be installed and the java environment variable should be set.

  • Stylesheets must be compatible with Saxon 8.9.

  • Stylesheets must be valid for the input data.

  • Only a single stylesheet invocation is supported. An XSLT pipeline cannot be processed by the checker.

   

back to top