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:doc="http://nwalsh.com/xsl/documentation/1.0" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="doc" 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 <!-- ==================================================================== -->
18 <xsl:template match="qandaset">
19 <xsl:variable name="title" select="(blockinfo/title|title)[1]"/>
20 <xsl:variable name="preamble" select="*[name(.) != 'title' and name(.) != 'titleabbrev' and name(.) != 'qandadiv' and name(.) != 'qandaentry']"/>
21 <xsl:variable name="label-width">
22 <xsl:call-template name="dbhtml-attribute">
23 <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
24 <xsl:with-param name="attribute" select="'label-width'"/>
28 <xsl:variable name="table-summary">
29 <xsl:call-template name="dbhtml-attribute">
30 <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
31 <xsl:with-param name="attribute" select="'table-summary'"/>
35 <xsl:variable name="cellpadding">
36 <xsl:call-template name="dbhtml-attribute">
37 <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
38 <xsl:with-param name="attribute" select="'cellpadding'"/>
42 <xsl:variable name="cellspacing">
43 <xsl:call-template name="dbhtml-attribute">
44 <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
45 <xsl:with-param name="attribute" select="'cellspacing'"/>
49 <xsl:variable name="toc">
50 <xsl:call-template name="dbhtml-attribute">
51 <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
52 <xsl:with-param name="attribute" select="'toc'"/>
56 <xsl:variable name="toc.params">
57 <xsl:call-template name="find.path.params">
58 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
62 <div class="{name(.)}">
63 <xsl:apply-templates select="$title"/>
64 <xsl:if test="(contains($toc.params, 'toc') and $toc != '0') or $toc = '1'">
65 <xsl:call-template name="process.qanda.toc"/>
67 <xsl:apply-templates select="$preamble"/>
68 <table border="0" summary="Q and A Set">
69 <xsl:if test="$table-summary != ''">
70 <xsl:attribute name="summary">
71 <xsl:value-of select="$table-summary"/>
75 <xsl:if test="$cellpadding != ''">
76 <xsl:attribute name="cellpadding">
77 <xsl:value-of select="$cellpadding"/>
81 <xsl:if test="$cellspacing != ''">
82 <xsl:attribute name="cellspacing">
83 <xsl:value-of select="$cellspacing"/>
88 <xsl:attribute name="width">
90 <xsl:when test="$label-width != ''">
91 <xsl:value-of select="$label-width"/>
93 <xsl:otherwise>1%</xsl:otherwise>
98 <xsl:apply-templates select="qandaentry|qandadiv"/>
104 <xsl:template match="qandaset/blockinfo/title|qandaset/title">
105 <xsl:variable name="qalevel">
106 <xsl:call-template name="qanda.section.level"/>
108 <xsl:element name="h{string(number($qalevel)+1)}" namespace="http://www.w3.org/1999/xhtml">
109 <xsl:attribute name="class">
110 <xsl:value-of select="name(.)"/>
112 <xsl:apply-templates/>
116 <xsl:template match="qandaset/blockinfo">
117 <!-- what should this template really do? -->
118 <xsl:apply-templates select="legalnotice" mode="titlepage.mode"/>
121 <xsl:template match="qandadiv">
122 <xsl:variable name="preamble" select="*[name(.) != 'title' and name(.) != 'titleabbrev' and name(.) != 'qandadiv' and name(.) != 'qandaentry']"/>
124 <xsl:if test="blockinfo/title|title">
125 <tr class="qandadiv">
126 <td align="left" valign="top" colspan="2">
127 <xsl:call-template name="anchor">
128 <xsl:with-param name="conditional" select="0"/>
130 <xsl:apply-templates select="(blockinfo/title|title)[1]"/>
135 <xsl:variable name="toc">
136 <xsl:call-template name="dbhtml-attribute">
137 <xsl:with-param name="pis" select="processing-instruction('dbhtml')"/>
138 <xsl:with-param name="attribute" select="'toc'"/>
142 <xsl:variable name="toc.params">
143 <xsl:call-template name="find.path.params">
144 <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
148 <xsl:if test="(contains($toc.params, 'toc') and $toc != '0') or $toc = '1'">
149 <tr class="toc" colspan="2">
150 <td align="left" valign="top" colspan="2">
151 <xsl:call-template name="process.qanda.toc"/>
155 <xsl:if test="$preamble">
156 <tr class="toc" colspan="2">
157 <td align="left" valign="top" colspan="2">
158 <xsl:apply-templates select="$preamble"/>
162 <xsl:apply-templates select="qandadiv|qandaentry"/>
165 <xsl:template match="qandadiv/blockinfo/title|qandadiv/title">
166 <xsl:variable name="qalevel">
167 <xsl:call-template name="qandadiv.section.level"/>
170 <xsl:element name="h{string(number($qalevel)+1)}" namespace="http://www.w3.org/1999/xhtml">
171 <xsl:attribute name="class">
172 <xsl:value-of select="name(.)"/>
174 <xsl:call-template name="anchor">
175 <xsl:with-param name="node" select=".."/>
176 <xsl:with-param name="conditional" select="0"/>
178 <xsl:apply-templates select="parent::qandadiv" mode="label.markup"/>
179 <xsl:if test="$qandadiv.autolabel != 0">
180 <xsl:apply-templates select="." mode="intralabel.punctuation"/>
181 <xsl:text> </xsl:text>
183 <xsl:apply-templates/>
187 <xsl:template match="qandaentry">
188 <xsl:apply-templates/>
191 <xsl:template match="question">
192 <xsl:variable name="deflabel">
194 <xsl:when test="ancestor-or-self::*[@defaultlabel]">
195 <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()] /@defaultlabel"/>
198 <xsl:value-of select="$qanda.defaultlabel"/>
203 <tr class="{name(.)}">
204 <td align="left" valign="top">
205 <xsl:call-template name="anchor">
206 <xsl:with-param name="node" select=".."/>
207 <xsl:with-param name="conditional" select="0"/>
209 <xsl:call-template name="anchor">
210 <xsl:with-param name="conditional" select="0"/>
214 <xsl:apply-templates select="." mode="label.markup"/>
215 <xsl:if test="$deflabel = 'number' and not(label)">
216 <xsl:apply-templates select="." mode="intralabel.punctuation"/>
220 <td align="left" valign="top">
222 <xsl:when test="$deflabel = 'none' and not(label)">
223 <b><xsl:apply-templates select="*[name(.) != 'label']"/></b>
226 <xsl:apply-templates select="*[name(.) != 'label']"/>
233 <xsl:template match="answer">
234 <xsl:variable name="deflabel">
236 <xsl:when test="ancestor-or-self::*[@defaultlabel]">
237 <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()] /@defaultlabel"/>
240 <xsl:value-of select="$qanda.defaultlabel"/>
245 <tr class="{name(.)}">
246 <td align="left" valign="top">
247 <xsl:call-template name="anchor"/>
249 <xsl:variable name="answer.label">
250 <xsl:apply-templates select="." mode="label.markup"/>
252 <xsl:copy-of select="$answer.label"/>
255 <td align="left" valign="top">
256 <xsl:apply-templates select="*[name(.) != 'label']"/>
261 <xsl:template match="label">
262 <xsl:apply-templates/>
265 <!-- ==================================================================== -->
267 <xsl:template name="process.qanda.toc">
269 <xsl:apply-templates select="qandadiv" mode="qandatoc.mode"/>
270 <xsl:apply-templates select="qandaentry" mode="qandatoc.mode"/>
274 <xsl:template match="qandadiv" mode="qandatoc.mode">
275 <dt><xsl:apply-templates select="title" mode="qandatoc.mode"/></dt>
276 <dd><xsl:call-template name="process.qanda.toc"/></dd>
279 <xsl:template match="qandadiv/blockinfo/title|qandadiv/title" mode="qandatoc.mode">
280 <xsl:variable name="qalevel">
281 <xsl:call-template name="qandadiv.section.level"/>
283 <xsl:variable name="id">
284 <xsl:call-template name="object.id">
285 <xsl:with-param name="object" select="parent::*"/>
289 <xsl:apply-templates select="parent::qandadiv" mode="label.markup"/>
290 <xsl:value-of select="$autotoc.label.separator"/>
291 <xsl:text> </xsl:text>
293 <xsl:attribute name="href">
294 <xsl:call-template name="href.target">
295 <xsl:with-param name="object" select="parent::*"/>
298 <xsl:apply-templates/>
302 <xsl:template match="qandaentry" mode="qandatoc.mode">
303 <xsl:apply-templates select="question" mode="qandatoc.mode"/>
306 <xsl:template match="question" mode="qandatoc.mode">
307 <xsl:variable name="firstch" select="(*[name(.)!='label'])[1]"/>
308 <xsl:variable name="deflabel">
310 <xsl:when test="ancestor-or-self::*[@defaultlabel]">
311 <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()] /@defaultlabel"/>
314 <xsl:value-of select="$qanda.defaultlabel"/>
320 <xsl:apply-templates select="." mode="label.markup"/>
321 <xsl:if test="$deflabel = 'number' and not(label)">
322 <xsl:apply-templates select="." mode="intralabel.punctuation"/>
324 <xsl:text> </xsl:text>
326 <xsl:attribute name="href">
327 <xsl:call-template name="href.target">
328 <xsl:with-param name="object" select=".."/>
331 <xsl:value-of select="$firstch"/>
336 <!-- ==================================================================== -->
338 <xsl:template match="*" mode="no.wrapper.mode">
339 <xsl:apply-templates/>
342 <!-- ==================================================================== -->