Whamcloud - gitweb
LUDOC-120 presentation: build bits for webhelp.
[doc/manual.git] / webhelp / xhtml / htmltbl.xsl
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">
5
6 <!-- ********************************************************************
7      $Id: htmltbl.xsl 9916 2014-05-15 16:08:21Z bobstayton $
8      ********************************************************************
9
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.
13
14      ******************************************************************** -->
15
16 <!-- ==================================================================== -->
17
18 <xsl:template match="table" mode="htmlTable">
19   <xsl:element name="table" namespace="http://www.w3.org/1999/xhtml">
20     <xsl:apply-templates select="@*" mode="htmlTableAtt"/>
21     <xsl:call-template name="htmlTable"/>
22   </xsl:element>
23 </xsl:template>
24
25 <xsl:template match="colgroup" mode="htmlTable">
26   <xsl:element name="{local-name()}" namespace="http://www.w3.org/1999/xhtml">
27     <xsl:apply-templates select="@*" mode="htmlTableAtt"/>
28     <xsl:apply-templates mode="htmlTable"/>
29   </xsl:element>
30 </xsl:template>
31
32 <xsl:template match="col" mode="htmlTable">
33   <xsl:element name="{local-name()}" namespace="http://www.w3.org/1999/xhtml">
34     <xsl:apply-templates select="@*" mode="htmlTableAtt"/>
35   </xsl:element>
36 </xsl:template>
37
38 <!-- Handled by formal.object.title template -->
39 <xsl:template match="caption" mode="htmlTable"/>
40
41 <xsl:template match="tbody|thead|tfoot|tr" mode="htmlTable">
42   <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
43     <xsl:apply-templates select="@*" mode="htmlTableAtt"/>
44     <xsl:apply-templates mode="htmlTable"/>
45   </xsl:element>
46 </xsl:template>
47
48 <xsl:template match="th|td" mode="htmlTable">
49   <xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
50     <xsl:apply-templates select="@*" mode="htmlTableAtt"/>
51     <xsl:apply-templates/> <!-- *not* mode=htmlTable -->
52   </xsl:element>
53 </xsl:template>
54
55 <!-- don't copy through DocBook-specific attributes on HTML table markup -->
56 <!-- default behavior is to not copy through because there are more
57      DocBook attributes than HTML attributes -->
58 <xsl:template mode="htmlTableAtt" match="@*"/>
59
60 <!-- copy these through -->
61 <xsl:template mode="htmlTableAtt" match="@abbr                    | @align                    | @axis                    | @bgcolor                    | @border                    | @cellpadding                    | @cellspacing                    | @char                    | @charoff                    | @class                    | @dir                    | @frame                    | @headers                    | @height                    | @id                    | @lang                    | @nowrap                    | @onclick                    | @ondblclick                    | @onkeydown                    | @onkeypress                    | @onkeyup                    | @onmousedown                    | @onmousemove                    | @onmouseout                    | @onmouseover                    | @onmouseup                    | @rules                    | @scope                    | @style                    | @summary                    | @title                    | @valign                    | @valign                    | @width                    | @xml:id                    | @xml:lang">
62   <xsl:copy-of select="."/>
63 </xsl:template>
64
65 <xsl:template match="@span|@rowspan|@colspan" mode="htmlTableAtt">
66   <!-- No need to copy through the DTD's default value "1" of the attribute -->
67   <xsl:if test="number(.) != 1">
68     <xsl:attribute name="{local-name(.)}">
69       <xsl:value-of select="."/>
70     </xsl:attribute>
71   </xsl:if>
72 </xsl:template>
73
74 <!-- map floatstyle to HTML float values -->
75 <xsl:template match="@floatstyle" mode="htmlTableAtt">
76   <xsl:attribute name="style">
77     <xsl:text>float: </xsl:text>
78     <xsl:choose>
79       <xsl:when test="contains(., 'left')">left</xsl:when>
80       <xsl:when test="contains(., 'right')">right</xsl:when>
81       <xsl:when test="contains(., 'start')">
82         <xsl:value-of select="$direction.align.start"/>
83       </xsl:when>
84       <xsl:when test="contains(., 'end')">
85         <xsl:value-of select="$direction.align.end"/>
86       </xsl:when>
87       <xsl:when test="contains(., 'inside')">
88         <xsl:value-of select="$direction.align.start"/>
89       </xsl:when>
90       <xsl:when test="contains(., 'outside')">
91         <xsl:value-of select="$direction.align.end"/>
92       </xsl:when>
93       <xsl:when test="contains(., 'before')">none</xsl:when>
94       <xsl:when test="contains(., 'none')">none</xsl:when>
95     </xsl:choose>
96     <xsl:text>;</xsl:text>
97   </xsl:attribute>
98 </xsl:template>
99
100 </xsl:stylesheet>