| 1 |
<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- --> |
| 2 |
<!-- |
| 3 |
This program is free software; you can redistribute it and/or modify it under |
| 4 |
the terms of the GNU Lesser General Public License as published by the Free |
| 5 |
Software Foundation; either version 2 of the License, or (at your option) any |
| 6 |
later version. |
| 7 |
|
| 8 |
This program is distributed in the hope that it will be useful, but WITHOUT |
| 9 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 10 |
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
| 11 |
details. |
| 12 |
|
| 13 |
You should have received a copy of the GNU Lesser General Public License |
| 14 |
along with this program; see the file COPYING.LGPL. If not, see <http://www.gnu.org/licenses/>. |
| 15 |
--> |
| 16 |
<!DOCTYPE xsl:stylesheet [ |
| 17 |
<!ENTITY % selectors SYSTEM "../common/dita-selectors.mod"> |
| 18 |
%selectors; |
| 19 |
]> |
| 20 |
|
| 21 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 22 |
xmlns:yelp="http://projects.gnome.org/yelp/" |
| 23 |
xmlns="http://www.w3.org/1999/xhtml" |
| 24 |
exclude-result-prefixes="yelp" |
| 25 |
version="1.0"> |
| 26 |
|
| 27 |
<!--!!========================================================================== |
| 28 |
DITA to HTML - Tables |
| 29 |
|
| 30 |
REMARK: Describe this module |
| 31 |
--> |
| 32 |
|
| 33 |
|
| 34 |
<!-- = simpletable = --> |
| 35 |
<xsl:template mode="dita2html.topic.mode" match="&topic_simpletable;"> |
| 36 |
<xsl:variable name="conref" select="yelp:dita.ref.conref(.)"/> |
| 37 |
<xsl:variable name="keycol" select="@keycol"/> |
| 38 |
<div> |
| 39 |
<xsl:call-template name="dita.id"/> |
| 40 |
<xsl:call-template name="html.lang.attrs"/> |
| 41 |
<xsl:call-template name="html.class.attr"> |
| 42 |
<xsl:with-param name="class" select="'table'"/> |
| 43 |
</xsl:call-template> |
| 44 |
<table class="table"> |
| 45 |
<xsl:for-each select="$conref/&topic_sthead;[1]"> |
| 46 |
<thead> |
| 47 |
<xsl:call-template name="dita2html.table.simpletable.row"> |
| 48 |
<xsl:with-param name="keycol" select="$keycol"/> |
| 49 |
</xsl:call-template> |
| 50 |
</thead> |
| 51 |
</xsl:for-each> |
| 52 |
<tbody> |
| 53 |
<xsl:for-each select="$conref/&topic_strow;"> |
| 54 |
<xsl:call-template name="dita2html.table.simpletable.row"> |
| 55 |
<xsl:with-param name="keycol" select="$keycol"/> |
| 56 |
</xsl:call-template> |
| 57 |
</xsl:for-each> |
| 58 |
</tbody> |
| 59 |
</table> |
| 60 |
</div> |
| 61 |
</xsl:template> |
| 62 |
|
| 63 |
<xsl:template name="dita2html.table.simpletable.row"> |
| 64 |
<xsl:param name="node" select="."/> |
| 65 |
<xsl:param name="keycol"/> |
| 66 |
<xsl:variable name="conref" select="yelp:dita.ref.conref($node)"/> |
| 67 |
<tr> |
| 68 |
<xsl:call-template name="dita.id"> |
| 69 |
<xsl:with-param name="node" select="$node"/> |
| 70 |
</xsl:call-template> |
| 71 |
<xsl:call-template name="html.lang.attrs"> |
| 72 |
<xsl:with-param name="node" select="$node"/> |
| 73 |
</xsl:call-template> |
| 74 |
<xsl:call-template name="html.class.attr"> |
| 75 |
<xsl:with-param name="node" select="$node"/> |
| 76 |
</xsl:call-template> |
| 77 |
<xsl:for-each select="$conref/&topic_stentry;"> |
| 78 |
<xsl:choose> |
| 79 |
<xsl:when test="position() = $keycol or $node[self::&topic_sthead;]"> |
| 80 |
<th> |
| 81 |
<xsl:call-template name="dita.id"/> |
| 82 |
<xsl:call-template name="html.lang.attrs"/> |
| 83 |
<xsl:apply-templates mode="dita2html.topic.mode" |
| 84 |
select="yelp:dita.ref.conref(.)/node()"/> |
| 85 |
</th> |
| 86 |
</xsl:when> |
| 87 |
<xsl:otherwise> |
| 88 |
<td> |
| 89 |
<xsl:call-template name="dita.id"/> |
| 90 |
<xsl:call-template name="html.lang.attrs"/> |
| 91 |
<xsl:apply-templates mode="dita2html.topic.mode" |
| 92 |
select="yelp:dita.ref.conref(.)/node()"/> |
| 93 |
</td> |
| 94 |
</xsl:otherwise> |
| 95 |
</xsl:choose> |
| 96 |
</xsl:for-each> |
| 97 |
</tr> |
| 98 |
</xsl:template> |
| 99 |
|
| 100 |
</xsl:stylesheet> |