1 <?xml version="1.0" encoding="ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
6 <!-- ********************************************************************
7 $Id: htmltbl.xsl 8477 2009-07-13 11:38:55Z nwalsh $
8 ********************************************************************
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://docbook.sf.net/release/xsl/current/ for
12 copyright and other information.
14 ******************************************************************** -->
16 <!-- ==================================================================== -->
18 <xsl:template match="colgroup" mode="htmlTable">
19 <xsl:element name="{local-name()}" namespace="http://www.w3.org/1999/xhtml">
20 <xsl:apply-templates select="@*" mode="htmlTableAtt"/>
21 <xsl:apply-templates mode="htmlTable"/>
25 <xsl:template match="col" mode="htmlTable">
26 <xsl:element name="{local-name()}" namespace="http://www.w3.org/1999/xhtml">
27 <xsl:apply-templates select="@*" mode="htmlTableAtt"/>
31 <xsl:template match="caption" mode="htmlTable">
32 <!-- do not use xsl:copy because of XHTML's needs -->
34 <xsl:apply-templates select="@*" mode="htmlTableAtt"/>
36 <xsl:apply-templates select=".." mode="object.title.markup">
37 <xsl:with-param name="allow-anchors" select="1"/>
38 </xsl:apply-templates>
43 <xsl:template match="tbody|thead|tfoot|tr" mode="htmlTable">
44 <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
45 <xsl:apply-templates select="@*" mode="htmlTableAtt"/>
46 <xsl:apply-templates mode="htmlTable"/>
50 <xsl:template match="th|td" mode="htmlTable">
51 <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
52 <xsl:apply-templates select="@*" mode="htmlTableAtt"/>
53 <xsl:apply-templates/> <!-- *not* mode=htmlTable -->
57 <!-- don't copy through DocBook-specific attributes on HTML table markup -->
58 <!-- default behavior is to not copy through because there are more
59 DocBook attributes than HTML attributes -->
60 <xsl:template mode="htmlTableAtt" match="@*"/>
62 <!-- copy these through -->
63 <xsl:template mode="htmlTableAtt" match="@abbr | @align | @axis | @bgcolor | @border | @cellpadding | @cellspacing | @char | @charoff | @class | @dir | @frame | @headers | @height | @lang | @nowrap | @onclick | @ondblclick | @onkeydown | @onkeypress | @onkeyup | @onmousedown | @onmousemove | @onmouseout | @onmouseover | @onmouseup | @rules | @style | @summary | @title | @valign | @valign | @width | @xml:lang">
64 <xsl:copy-of select="."/>
67 <xsl:template match="@span|@rowspan|@colspan" mode="htmlTableAtt">
68 <!-- No need to copy through the DTD's default value "1" of the attribute -->
69 <xsl:if test="number(.) != 1">
70 <xsl:attribute name="{local-name(.)}">
71 <xsl:value-of select="."/>
76 <!-- map floatstyle to HTML float values -->
77 <xsl:template match="@floatstyle" mode="htmlTableAtt">
78 <xsl:attribute name="style">
79 <xsl:text>float: </xsl:text>
81 <xsl:when test="contains(., 'left')">left</xsl:when>
82 <xsl:when test="contains(., 'right')">right</xsl:when>
83 <xsl:when test="contains(., 'start')">
84 <xsl:value-of select="$direction.align.start"/>
86 <xsl:when test="contains(., 'end')">
87 <xsl:value-of select="$direction.align.end"/>
89 <xsl:when test="contains(., 'inside')">
90 <xsl:value-of select="$direction.align.start"/>
92 <xsl:when test="contains(., 'outside')">
93 <xsl:value-of select="$direction.align.end"/>
95 <xsl:when test="contains(., 'before')">none</xsl:when>
96 <xsl:when test="contains(., 'none')">none</xsl:when>
98 <xsl:text>;</xsl:text>