xsl-list
[Top] [All Lists]

[xsl] Any students looking for an interesting project?

2013-10-03 03:42:34
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
--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--