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

[xsl] Any students looking for an interesting project?

Subject: [xsl] Any students looking for an interesting project?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Thu, 3 Oct 2013 09:42:14 +0100

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

Michael Kay

Current Thread