summaryrefslogtreecommitdiff
path: root/tests/docbook/html/xtchunk.xsl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/docbook/html/xtchunk.xsl')
-rw-r--r--tests/docbook/html/xtchunk.xsl36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/docbook/html/xtchunk.xsl b/tests/docbook/html/xtchunk.xsl
new file mode 100644
index 00000000..aeb41b56
--- /dev/null
+++ b/tests/docbook/html/xtchunk.xsl
@@ -0,0 +1,36 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xt="http://www.jclark.com/xt"
+ extension-element-prefixes="xt"
+ version="1.0">
+
+<xsl:include href="chunk-common.xsl"/>
+
+<xsl:template name="make-relative-filename">
+ <xsl:param name="base.dir" select="'./'"/>
+ <xsl:param name="base.name" select="''"/>
+
+ <!-- XT makes chunks relative -->
+ <xsl:choose>
+ <xsl:when test="count(parent::*) = 0">
+ <xsl:value-of select="concat($base.dir,$base.name)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$base.name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</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="''"/>
+
+ <xt:document href="{$filename}"
+ method="{$method}"
+ encoding="{$encoding}">
+ <xsl:copy-of select="$content"/>
+ </xt:document>
+</xsl:template>
+
+</xsl:stylesheet> \ No newline at end of file