Added another example with complete files.
[docutils/kirr.git] / sandbox / docbook / examples / report2 / long_tables.xsl
blobdc3d68c2e990d1c2a71e5ba1c9e2ef4bba76f617
1 <xsl:stylesheet
2 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:d="http://docbook.org/ns/docbook"
4 version="1.1">
6 <xsl:import
7 href="http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/sandbox/docbook/xsl/long_table.xsl"/>
9 <xsl:template match="table[@classes='long-metrics']">
10 <xsl:variable name="position">
11 <xsl:value-of select="count(preceding::table[@classes='long-metrics']) + 1"/>
12 </xsl:variable>
13 <xsl:variable name="first-page-rows">
14 <xsl:choose>
15 <xsl:when test="$position &lt; 1000">
16 <xsl:text>34</xsl:text>
17 </xsl:when>
18 </xsl:choose>
19 </xsl:variable>
20 <xsl:if test="$position != 1">
21 <xsl:processing-instruction name="hard-pagebreak"/>
22 </xsl:if>
23 <xsl:choose>
24 <xsl:when test="$position = 3">
25 <xsl:copy-of select="."/>
26 <xsl:apply-templates select="following-sibling::container[1][@classes='caption']" mode="keep"/>
27 </xsl:when>
28 <xsl:otherwise>
29 <xsl:call-template name="split-table">
30 <xsl:with-param name="first-page-rows" select="$first-page-rows"/>
31 </xsl:call-template>
32 </xsl:otherwise>
33 </xsl:choose>
34 </xsl:template>
35 </xsl:stylesheet>