This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
XSLT 1.1 chunk stylesheet.
- To: docbook-apps at lists dot oasis-open dot org
- Subject: DOCBOOK-APPS: XSLT 1.1 chunk stylesheet.
- From: Robert Collins <robert dot collins at itdomain dot com dot au>
- Date: Sun, 27 May 2001 23:14:16 +1000
The attached stylesheet does chunking with the XSLT 1.1 draft specs.
It's got a couple of workaround for xsltproc, but it might be useful for
someone. xsltproc doesn't currently support the doctype-public and
doctype-system attributes, I generated a partical patch (which supports
the attributes, but breaks single-file-redirected-stdout). Search the
xlst@gnome.org archives for
"[xslt] PATCH: xsl:document doctypePublic and doctypeSystem" if you are
interested in the partial patch.
Rob
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:include href="docbookxsl/html/chunk-common.xsl"/>
<xsl:template name="make-relative-filename">
<xsl:param name="base.dir" select="'./'"/>
<xsl:param name="base.name" select="''"/>
<xsl:value-of select="concat($base.dir,$base.name)"/>
</xsl:template>
<xsl:template name="write.chunk">
<xsl:param name="filename" select="''"/>
<xsl:param name="method" select="'html'"/>
<xsl:param name="encoding" select="'ISO-8859-1'"/>
<xsl:param name="content" select="''"/>
<xsl:document href="{$filename}"
method="html"
encoding="ISO-8859-1"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd">
<!-- method was {$method} but xlstproc spits the dummy -->
<!-- encoding="{$encoding}"> -->
<xsl:copy-of select="$content"/>
</xsl:document>
</xsl:template>
</xsl:stylesheet>