[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Any students looking for an interesting project?


Subject: Re: [xsl] Any students looking for an interesting project?
From: Michael Sokolov <msokolov@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 03 Oct 2013 07:30:14 -0400

One of my colleagues has written a code coverage plugin for Saxon; he calls it "tectura." It counts up the number of times different lines of an XSLT file are executed. I think this empirical approach could get you a quick answer to the problem without the need for deep analysis. He has been planning to release the package as open source, but I don't think he has done that yet -- still I'm sure you could whip something up, and I bet your users would appreciate it, too.

-Mike

On 10/3/13 4:42 AM, Michael Kay wrote:
Here's an XSLT project that I think would be ideal for a bright student:

Given a stylesheet S, and a representative selection of input documents D, create a trimmed-down stylesheet S' that is equivalent to S when applied to any document in D, by eliminating all template rules that don't match anything in D (as well as other components like named templates and functions that become unreachable after this process).

It's a practical problem: the docbook stylesheets, for example, are far too large to run in Saxon-CE, but if trimmed down to contain only the rules needed for a particular docbook profile, might well be a tiny fraction of the size. Using trimmed-down stylesheets could also give performance benefits in many batch publishing workflows.

The only tricky part of the problem, I think, is dealing with any cases of template rules that are there to match nodes in temporary trees rather than nodes in a source document. One might be able to determine the set of element names used in temporary trees by static analysis, or to determine that xsl:apply-templates is never applied to a temporary tree, or perhaps to gather extra information by actually running S against D and monitoring what happens.

Michael Kay
Saxonica


Current Thread
Keywords