1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets. Do not edit this file.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
6 <!-- ********************************************************************
8 ********************************************************************
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
12 and other information.
14 ******************************************************************** -->
16 <xsl:template name="formal.object">
17 <xsl:param name="placement" select="'before'"/>
18 <xsl:param name="class" select="local-name(.)"/>
20 <div class="{$class}">
21 <xsl:call-template name="anchor">
22 <xsl:with-param name="conditional" select="0"/>
26 <xsl:when test="$placement = 'before'">
27 <xsl:call-template name="formal.object.heading"/>
28 <xsl:apply-templates/>
30 <!-- HACK: This doesn't belong inside formal.object; it should be done by -->
31 <!-- the table template, but I want the link to be inside the DIV, so... -->
32 <xsl:if test="local-name(.) = 'table'">
33 <xsl:call-template name="table.longdesc"/>
36 <xsl:if test="$spacing.paras != 0"><p/></xsl:if>
39 <xsl:if test="$spacing.paras != 0"><p/></xsl:if>
40 <xsl:apply-templates/>
42 <!-- HACK: This doesn't belong inside formal.object; it should be done by -->
43 <!-- the table template, but I want the link to be inside the DIV, so... -->
44 <xsl:if test="local-name(.) = 'table'">
45 <xsl:call-template name="table.longdesc"/>
48 <xsl:call-template name="formal.object.heading"/>
54 <xsl:template name="formal.object.heading">
55 <xsl:param name="object" select="."/>
56 <xsl:param name="title">
57 <xsl:apply-templates select="$object" mode="object.title.markup">
58 <xsl:with-param name="allow-anchors" select="1"/>
59 </xsl:apply-templates>
64 <xsl:copy-of select="$title"/>
69 <xsl:template name="informal.object">
70 <xsl:param name="class" select="local-name(.)"/>
72 <div class="{$class}">
73 <xsl:if test="$spacing.paras != 0"><p/></xsl:if>
74 <xsl:call-template name="anchor"/>
75 <xsl:apply-templates/>
77 <!-- HACK: This doesn't belong inside formal.object; it should be done by -->
78 <!-- the table template, but I want the link to be inside the DIV, so... -->
79 <xsl:if test="local-name(.) = 'informaltable'">
80 <xsl:call-template name="table.longdesc"/>
83 <xsl:if test="$spacing.paras != 0"><p/></xsl:if>
87 <xsl:template name="semiformal.object">
88 <xsl:param name="placement" select="'before'"/>
89 <xsl:param name="class" select="local-name(.)"/>
92 <xsl:when test="title">
93 <xsl:call-template name="formal.object">
94 <xsl:with-param name="placement" select="$placement"/>
95 <xsl:with-param name="class" select="$class"/>
99 <xsl:call-template name="informal.object">
100 <xsl:with-param name="class" select="$class"/>
106 <xsl:template match="figure">
107 <xsl:variable name="param.placement" select="substring-after(normalize-space($formal.title.placement), concat(local-name(.), ' '))"/>
109 <xsl:variable name="placement">
111 <xsl:when test="contains($param.placement, ' ')">
112 <xsl:value-of select="substring-before($param.placement, ' ')"/>
114 <xsl:when test="$param.placement = ''">before</xsl:when>
116 <xsl:value-of select="$param.placement"/>
122 <xsl:when test="@float and @float != 0">
123 <xsl:variable name="float">
125 <xsl:when test="@float = 1">
126 <xsl:value-of select="$default.float.class"/>
129 <xsl:value-of select="@float"/>
134 <div class="figure-float">
135 <xsl:if test="$float = 'left' or $float = 'right'">
136 <xsl:attribute name="style">
137 <xsl:text>float: </xsl:text>
138 <xsl:value-of select="$float"/>
139 <xsl:text>;</xsl:text>
142 <xsl:call-template name="formal.object">
143 <xsl:with-param name="placement" select="$placement"/>
148 <xsl:call-template name="formal.object">
149 <xsl:with-param name="placement" select="$placement"/>
155 <xsl:template match="table">
157 <xsl:when test="tgroup|mediaobject|graphic">
158 <xsl:call-template name="calsTable"/>
162 <xsl:copy-of select="@*"/>
163 <xsl:if test="not(@id)">
164 <xsl:attribute name="id">
165 <xsl:call-template name="object.id"/>
168 <xsl:call-template name="htmlTable"/>
174 <xsl:template name="calsTable">
175 <xsl:if test="tgroup/tbody/tr |tgroup/thead/tr |tgroup/tfoot/tr">
176 <xsl:message terminate="yes">Broken table: tr descendent of CALS Table.</xsl:message>
179 <xsl:variable name="param.placement" select="substring-after(normalize-space($formal.title.placement), concat(local-name(.), ' '))"/>
181 <xsl:variable name="placement">
183 <xsl:when test="contains($param.placement, ' ')">
184 <xsl:value-of select="substring-before($param.placement, ' ')"/>
186 <xsl:when test="$param.placement = ''">before</xsl:when>
188 <xsl:value-of select="$param.placement"/>
193 <xsl:call-template name="formal.object">
194 <xsl:with-param name="placement" select="$placement"/>
195 <xsl:with-param name="class">
197 <xsl:when test="@tabstyle">
198 <!-- hack, this will only ever occur on table, not example -->
199 <xsl:value-of select="@tabstyle"/>
202 <xsl:value-of select="local-name(.)"/>
209 <xsl:template name="htmlTable">
210 <xsl:if test="tgroup/tbody/row |tgroup/thead/row |tgroup/tfoot/row">
211 <xsl:message terminate="yes">Broken table: row descendent of HTML table.</xsl:message>
214 <xsl:apply-templates mode="htmlTable"/>
217 <xsl:template match="example">
218 <xsl:variable name="param.placement" select="substring-after(normalize-space($formal.title.placement), concat(local-name(.), ' '))"/>
220 <xsl:variable name="placement">
222 <xsl:when test="contains($param.placement, ' ')">
223 <xsl:value-of select="substring-before($param.placement, ' ')"/>
225 <xsl:when test="$param.placement = ''">before</xsl:when>
227 <xsl:value-of select="$param.placement"/>
232 <xsl:call-template name="formal.object">
233 <xsl:with-param name="placement" select="$placement"/>
234 <xsl:with-param name="class" select="local-name(.)"/>
238 <xsl:template match="equation">
239 <xsl:variable name="param.placement" select="substring-after(normalize-space($formal.title.placement), concat(local-name(.), ' '))"/>
241 <xsl:variable name="placement">
243 <xsl:when test="contains($param.placement, ' ')">
244 <xsl:value-of select="substring-before($param.placement, ' ')"/>
246 <xsl:when test="$param.placement = ''">before</xsl:when>
248 <xsl:value-of select="$param.placement"/>
253 <xsl:call-template name="semiformal.object">
254 <xsl:with-param name="placement" select="$placement"/>
258 <xsl:template match="figure/title"/>
259 <xsl:template match="figure/titleabbrev"/>
260 <xsl:template match="table/title"/>
261 <xsl:template match="table/titleabbrev"/>
262 <xsl:template match="table/textobject"/>
263 <xsl:template match="example/title"/>
264 <xsl:template match="example/titleabbrev"/>
265 <xsl:template match="equation/title"/>
266 <xsl:template match="equation/titleabbrev"/>
268 <xsl:template match="informalfigure">
269 <xsl:call-template name="informal.object"/>
272 <xsl:template match="informalexample">
273 <xsl:call-template name="informal.object"/>
276 <xsl:template match="informaltable">
278 <xsl:when test="tgroup|mediaobject|graphic">
279 <xsl:call-template name="informal.object">
280 <xsl:with-param name="class">
282 <xsl:when test="@tabstyle">
283 <xsl:value-of select="@tabstyle"/>
286 <xsl:value-of select="local-name(.)"/>
294 <xsl:copy-of select="@*"/>
295 <xsl:call-template name="htmlTable"/>
301 <xsl:template match="informaltable/textobject"/>
303 <xsl:template name="table.longdesc">
304 <!-- HACK: This doesn't belong inside formal.objectt; it should be done by -->
305 <!-- the table template, but I want the link to be inside the DIV, so... -->
306 <xsl:variable name="longdesc.uri">
307 <xsl:call-template name="longdesc.uri">
308 <xsl:with-param name="mediaobject" select="."/>
312 <xsl:variable name="irrelevant">
313 <!-- write.longdesc returns the filename ... -->
314 <xsl:call-template name="write.longdesc">
315 <xsl:with-param name="mediaobject" select="."/>
319 <xsl:if test="$html.longdesc != 0 and $html.longdesc.link != 0 and textobject[not(phrase)]">
320 <xsl:call-template name="longdesc.link">
321 <xsl:with-param name="longdesc.uri" select="$longdesc.uri"/>
326 <xsl:template match="informalequation">
327 <xsl:call-template name="informal.object"/>