From: <pau...@us...> - 2012-02-15 18:56:34
|
Revision: 7359 http://docutils.svn.sourceforge.net/docutils/?rev=7359&view=rev Author: paultremblay Date: 2012-02-15 18:56:28 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Used for breaking up long tables, since FOP doesn't yet put in a "continue" label. Added Paths: ----------- trunk/sandbox/docbook/xsl/long_table.xsl Added: trunk/sandbox/docbook/xsl/long_table.xsl =================================================================== --- trunk/sandbox/docbook/xsl/long_table.xsl (rev 0) +++ trunk/sandbox/docbook/xsl/long_table.xsl 2012-02-15 18:56:28 UTC (rev 7359) @@ -0,0 +1,80 @@ +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.1" +> + + <xsl:output method="xml" encoding="UTF-8"/> + + + <xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </xsl:template> + + + <xsl:template match="comment()"> + <xsl:comment> + <xsl:value-of select="."/> + </xsl:comment> + </xsl:template> + + <xsl:template match="table"> + <xsl:call-template name="split-table"> + <xsl:with-param name="first-page-rows" select="2"/> + </xsl:call-template> + </xsl:template> + + <xsl:template name="split-table"> + <xsl:param name="first-page-rows"/> + <xsl:copy > + <xsl:copy-of select="@*"/> + <xsl:copy-of select="title"/> + <tgroup> + <xsl:copy-of select="tgroup/@*"/> + <xsl:copy-of select="tgroup/colspec"/> + <xsl:copy-of select="tgroup/thead"/> + <xsl:copy-of select="tgroup/tfoot"/> + <tbody> + <xsl:copy-of select="tgroup/tbody/@*"/> + <xsl:copy-of select="tgroup/tbody/row[position() <= + $first-page-rows]"/> + </tbody> + </tgroup> + </xsl:copy> + <table > + <xsl:copy-of select="@*"/> + <tgroup> + <xsl:copy-of select="tgroup/@*"/> + <xsl:copy-of select="tgroup/colspec"/> + <thead> + <xsl:copy-of select="tgroup/thead/@*"/> + <row classes="continuation-label"> + <entry> + <xsl:attribute name="morecols"> + <xsl:value-of select="tgroup/@cols"/> + </xsl:attribute> + <paragraph> + <xsl:apply-templates select="title" mode="continue-label"/> + </paragraph> + </entry> + </row> + <xsl:apply-templates select="tgroup/thead/*"/> + </thead> + <xsl:copy-of select="tgroup/tfoot"/> + <tbody> + <xsl:copy-of select="tgroup/tbody/@*"/> + <xsl:copy-of select="tgroup/tbody/row[position() > + $first-page-rows]"/> + </tbody> + </tgroup> + </table> + </xsl:template> + + <xsl:template match="title" mode="continue-label"> + <xsl:apply-templates/> + <xsl:text > (cont.)</xsl:text> + </xsl:template> + +</xsl:stylesheet> + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pau...@us...> - 2012-02-15 20:19:50
|
Revision: 7360 http://docutils.svn.sourceforge.net/docutils/?rev=7360&view=rev Author: paultremblay Date: 2012-02-15 20:19:44 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Commented out unnecessary parts of code. Modified Paths: -------------- trunk/sandbox/docbook/xsl/long_table.xsl Modified: trunk/sandbox/docbook/xsl/long_table.xsl =================================================================== --- trunk/sandbox/docbook/xsl/long_table.xsl 2012-02-15 18:56:28 UTC (rev 7359) +++ trunk/sandbox/docbook/xsl/long_table.xsl 2012-02-15 20:19:44 UTC (rev 7360) @@ -19,11 +19,13 @@ </xsl:comment> </xsl:template> + <!-- <xsl:template match="table"> <xsl:call-template name="split-table"> <xsl:with-param name="first-page-rows" select="2"/> </xsl:call-template> </xsl:template> + --> <xsl:template name="split-table"> <xsl:param name="first-page-rows"/> @@ -72,8 +74,10 @@ </xsl:template> <xsl:template match="title" mode="continue-label"> + <!--do nothing here, because the fo templates overwrite the content + here <xsl:apply-templates/> - <xsl:text > (cont.)</xsl:text> + --> </xsl:template> </xsl:stylesheet> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |