2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5
<!-- ********************************************************************
6
$Id: htmltbl.xsl 8477 2009-07-13 11:38:55Z nwalsh $
7
********************************************************************
9
This file is part of the XSL DocBook Stylesheet distribution.
10
See ../README or http://docbook.sf.net/release/xsl/current/ for
11
copyright and other information.
13
******************************************************************** -->
15
<!-- ==================================================================== -->
17
<xsl:template match="colgroup" mode="htmlTable">
18
<xsl:element name="{local-name()}" namespace="">
19
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
20
<xsl:apply-templates mode="htmlTable"/>
24
<xsl:template match="col" mode="htmlTable">
25
<xsl:element name="{local-name()}" namespace="">
26
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
30
<xsl:template match="caption" mode="htmlTable">
31
<!-- do not use xsl:copy because of XHTML's needs -->
33
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
35
<xsl:apply-templates select=".." mode="object.title.markup">
36
<xsl:with-param name="allow-anchors" select="1"/>
37
</xsl:apply-templates>
42
<xsl:template match="tbody|thead|tfoot|tr" mode="htmlTable">
43
<xsl:element name="{local-name(.)}">
44
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
45
<xsl:apply-templates mode="htmlTable"/>
49
<xsl:template match="th|td" mode="htmlTable">
50
<xsl:element name="{local-name(.)}">
51
<xsl:apply-templates select="@*" mode="htmlTableAtt"/>
52
<xsl:apply-templates/> <!-- *not* mode=htmlTable -->
56
<!-- don't copy through DocBook-specific attributes on HTML table markup -->
57
<!-- default behavior is to not copy through because there are more
58
DocBook attributes than HTML attributes -->
59
<xsl:template mode="htmlTableAtt" match="@*"/>
61
<!-- copy these through -->
62
<xsl:template mode="htmlTableAtt"
97
<xsl:copy-of select="."/>
100
<xsl:template match="@span|@rowspan|@colspan" mode="htmlTableAtt">
101
<!-- No need to copy through the DTD's default value "1" of the attribute -->
102
<xsl:if test="number(.) != 1">
103
<xsl:attribute name="{local-name(.)}">
104
<xsl:value-of select="."/>
109
<!-- map floatstyle to HTML float values -->
110
<xsl:template match="@floatstyle" mode="htmlTableAtt">
111
<xsl:attribute name="style">
112
<xsl:text>float: </xsl:text>
114
<xsl:when test="contains(., 'left')">left</xsl:when>
115
<xsl:when test="contains(., 'right')">right</xsl:when>
116
<xsl:when test="contains(., 'start')">
117
<xsl:value-of select="$direction.align.start"/>
119
<xsl:when test="contains(., 'end')">
120
<xsl:value-of select="$direction.align.end"/>
122
<xsl:when test="contains(., 'inside')">
123
<xsl:value-of select="$direction.align.start"/>
125
<xsl:when test="contains(., 'outside')">
126
<xsl:value-of select="$direction.align.end"/>
128
<xsl:when test="contains(., 'before')">none</xsl:when>
129
<xsl:when test="contains(., 'none')">none</xsl:when>
131
<xsl:text>;</xsl:text>