[Home] [By Thread] [By Date] [Recent Entries]
Hi,
At 05:09 PM 3/9/2010, Liam wrote: On Tue, 2010-03-09 at 23:03 +0200, Jacobus Reyneke wrote: I agree that XProc is an excellent way to go, it being a standardized mechanism. On the other hand, one might also have: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://saxon.sf.net/" version="2.0" extension-element-prefixes="saxon"> <xsl:variable name="document" select="/" saxon:assignable="yes"/> <xsl:variable name="processes">
<step>filter.xsl</step>
<step>layout.xsl</step>
<step>targetmedia.xsl</step>
</xsl:variable> <xsl:template match="/">
<xsl:for-each select="$processes/step">
<xsl:message>
<xsl:text>
... Applying </xsl:text>
<xsl:value-of select="."/>
</xsl:message>
<saxon:assign name="document"
select="saxon:transform(
saxon:compile-stylesheet(doc(.)),
$document)"/>
<!-- A third argument to saxon:transform can specify
runtime parameters for any (or all) steps;
see the documentation -->
</xsl:for-each>
<xsl:sequence select="$document"/>
<xsl:message>
... Done</xsl:message>
</xsl:template></xsl:stylesheet> I've used this or the equivalent in a number of projects (sometimes the $processes variable is declared in a different module, calling this in, which makes it somewhat easier to deploy). Some of its refinements (such as using saxon:assign in order to manage the memory footprint) are at the kind suggestion of Sam Wilmott. Cheers, Wendell ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
|

Cart



