- Timestamp:
- 10/08/2013 08:03:29 PM (11 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 12.2, 12.2-rc1, 7.5, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/loongarch-12.2, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- 58675ce
- Parents:
- 09a35dd
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
stylesheets/lfs-xsl/docbook-xsl-1.78.1/xhtml-1_1/qandaset.xsl
r09a35dd r15c7d39 5 5 6 6 <!-- ******************************************************************** 7 $Id $7 $Id: qandaset.xsl 9354 2012-05-12 23:29:36Z bobstayton $ 8 8 ******************************************************************** 9 9 … … 30 30 31 31 <div> 32 <xsl:apply-templates select="." mode="class.attribute"/> 32 <xsl:apply-templates select="." mode="common.html.attributes"/> 33 <xsl:call-template name="id.attribute"> 34 <xsl:with-param name="conditional" select="0"/> 35 </xsl:call-template> 33 36 <xsl:apply-templates select="$title"/> 37 <xsl:if test="not($title)"> 38 <!-- andhor is output on title if there is one --> 39 <xsl:call-template name="anchor"> 40 <xsl:with-param name="conditional" select="0"/> 41 </xsl:call-template> 42 </xsl:if> 34 43 <xsl:if test="((contains($toc.params, 'toc') and $toc != '0') or $toc = '1') and not(ancestor::answer and not($qanda.nested.in.toc=0))"> 35 44 <xsl:call-template name="process.qanda.toc"/> … … 45 54 </xsl:variable> 46 55 <xsl:element name="h{string(number($qalevel)+1)}" namespace="http://www.w3.org/1999/xhtml"> 47 <xsl:attribute name="class"> 48 <xsl:value-of select="local-name(.)"/> 49 </xsl:attribute> 56 <xsl:apply-templates select="." mode="class.attribute"/> 50 57 <xsl:call-template name="anchor"> 51 58 <xsl:with-param name="node" select=".."/> … … 66 73 <xsl:if test="blockinfo/title|info/title|title"> 67 74 <tr class="qandadiv"> 68 <td align=" left" valign="top" colspan="2">75 <td align="{$direction.align.start}" valign="top" colspan="2"> 69 76 <xsl:apply-templates select="(blockinfo/title|info/title|title)[1]"/> 70 77 </td> … … 84 91 <xsl:if test="(contains($toc.params, 'toc') and $toc != '0') or $toc = '1'"> 85 92 <tr class="toc"> 86 <td align=" left" valign="top" colspan="2">93 <td align="{$direction.align.start}" valign="top" colspan="2"> 87 94 <xsl:call-template name="process.qanda.toc"/> 88 95 </td> … … 91 98 <xsl:if test="$preamble"> 92 99 <tr class="toc"> 93 <td align=" left" valign="top" colspan="2">100 <td align="{$direction.align.start}" valign="top" colspan="2"> 94 101 <xsl:apply-templates select="$preamble"/> 95 102 </td> … … 105 112 106 113 <xsl:element name="h{string(number($qalevel)+1)}" namespace="http://www.w3.org/1999/xhtml"> 107 <xsl:attribute name="class"> 108 <xsl:value-of select="local-name(.)"/> 109 </xsl:attribute> 114 <xsl:apply-templates select="." mode="class.attribute"/> 115 <xsl:call-template name="id.attribute"> 116 <xsl:with-param name="node" select=".."/> 117 <xsl:with-param name="conditional" select="0"/> 118 </xsl:call-template> 110 119 <xsl:call-template name="anchor"> 111 120 <xsl:with-param name="node" select=".."/> … … 127 136 <xsl:template match="question"> 128 137 <xsl:variable name="deflabel"> 129 <xsl:choose> 130 <xsl:when test="ancestor-or-self::*[@defaultlabel]"> 131 <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()] /@defaultlabel"/> 132 </xsl:when> 133 <xsl:otherwise> 134 <xsl:value-of select="$qanda.defaultlabel"/> 135 </xsl:otherwise> 136 </xsl:choose> 138 <xsl:apply-templates select="." mode="qanda.defaultlabel"/> 137 139 </xsl:variable> 138 140 139 141 <tr> 140 <xsl:apply-templates select="." mode="class.attribute"/> 141 <td align="left" valign="top"> 142 <xsl:apply-templates select="." mode="common.html.attributes"/> 143 <!-- capture the id of the quandaentry --> 144 <xsl:call-template name="id.attribute"> 145 <xsl:with-param name="node" select=".."/> 146 <xsl:with-param name="conditional" select="0"/> 147 </xsl:call-template> 148 <td align="{$direction.align.start}" valign="top"> 149 <!-- and the id of the question too --> 150 <xsl:call-template name="id.attribute"> 151 <xsl:with-param name="conditional" select="0"/> 152 </xsl:call-template> 142 153 <xsl:call-template name="anchor"> 143 154 <xsl:with-param name="node" select=".."/> … … 149 160 150 161 <xsl:variable name="label.content"> 151 <xsl:apply-templates select="." mode="label.markup"/> 152 <xsl:if test="$deflabel = 'number' and not(label)"> 153 <xsl:apply-templates select="." mode="intralabel.punctuation"/> 154 </xsl:if> 162 <xsl:apply-templates select="." mode="qanda.label"/> 155 163 </xsl:variable> 156 164 157 165 <xsl:if test="string-length($label.content) > 0"> 158 <p>< b>166 <p><strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform"> 159 167 <xsl:copy-of select="$label.content"/> 160 </ b></p>168 </strong></p> 161 169 </xsl:if> 162 170 </td> 163 <td align=" left" valign="top">171 <td align="{$direction.align.start}" valign="top"> 164 172 <xsl:choose> 165 173 <xsl:when test="$deflabel = 'none' and not(label)"> 166 < b><xsl:apply-templates select="*[local-name(.) != 'label']"/></b>174 <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform"><xsl:apply-templates select="*[local-name(.) != 'label']"/></strong> 167 175 </xsl:when> 168 176 <xsl:otherwise> … … 174 182 </xsl:template> 175 183 184 <xsl:template match="*" mode="qanda.defaultlabel"> 185 <xsl:choose> 186 <xsl:when test="ancestor-or-self::*[@defaultlabel]"> 187 <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()] /@defaultlabel"/> 188 </xsl:when> 189 <xsl:otherwise> 190 <xsl:value-of select="$qanda.defaultlabel"/> 191 </xsl:otherwise> 192 </xsl:choose> 193 </xsl:template> 194 195 <xsl:template match="question" mode="qanda.label"> 196 <xsl:variable name="deflabel"> 197 <xsl:apply-templates select="." mode="qanda.defaultlabel"/> 198 </xsl:variable> 199 <xsl:apply-templates select="." mode="label.markup"/> 200 <xsl:if test="contains($deflabel, 'number') and not(label)"> 201 <xsl:apply-templates select="." mode="intralabel.punctuation"/> 202 </xsl:if> 203 </xsl:template> 204 176 205 <xsl:template match="answer"> 177 206 <xsl:variable name="deflabel"> 178 <xsl:choose> 179 <xsl:when test="ancestor-or-self::*[@defaultlabel]"> 180 <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()] /@defaultlabel"/> 181 </xsl:when> 182 <xsl:otherwise> 183 <xsl:value-of select="$qanda.defaultlabel"/> 184 </xsl:otherwise> 185 </xsl:choose> 186 </xsl:variable> 187 188 <tr class="{local-name(.)}"> 189 <td align="left" valign="top"> 207 <xsl:apply-templates select="." mode="qanda.defaultlabel"/> 208 </xsl:variable> 209 210 <tr> 211 <xsl:apply-templates select="." mode="common.html.attributes"/> 212 <xsl:call-template name="id.attribute"/> 213 <td align="{$direction.align.start}" valign="top"> 190 214 <xsl:call-template name="anchor"/> 191 215 <xsl:variable name="answer.label"> … … 193 217 </xsl:variable> 194 218 <xsl:if test="string-length($answer.label) > 0"> 195 <p>< b>219 <p><strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform"> 196 220 <xsl:copy-of select="$answer.label"/> 197 </ b></p>221 </strong></p> 198 222 </xsl:if> 199 223 </td> 200 <td align=" left" valign="top">224 <td align="{$direction.align.start}" valign="top"> 201 225 <xsl:apply-templates select="*[local-name(.) != 'label' and local-name(.) != 'qandaentry']"/> 202 226 <!-- * handle nested answer/qandaentry instances --> … … 209 233 </xsl:template> 210 234 235 <xsl:template match="answer" mode="qanda.label"> 236 <xsl:apply-templates select="." mode="label.markup"/> 237 </xsl:template> 238 211 239 <xsl:template match="label"> 212 240 <xsl:apply-templates/> … … 239 267 </xsl:variable> 240 268 241 <xsl:apply-templates select="parent::qandadiv" mode="label.markup"/> 242 <xsl:value-of select="$autotoc.label.separator"/> 269 <xsl:variable name="div.label"> 270 <xsl:apply-templates select="parent::qandadiv" mode="label.markup"/> 271 </xsl:variable> 272 <xsl:if test="string-length($div.label) != 0"> 273 <xsl:copy-of select="$div.label"/> 274 <xsl:value-of select="$autotoc.label.separator"/> 275 </xsl:if> 243 276 <xsl:text> </xsl:text> 244 277 <a> … … 264 297 <xsl:template match="question" mode="qandatoc.mode"> 265 298 <xsl:variable name="firstch"> 266 <xsl:apply-templates select="(*[local-name(.)!='label'])[1]"/> 299 <!-- Use a titleabbrev or title if available --> 300 <xsl:choose> 301 <xsl:when test="../blockinfo/titleabbrev"> 302 <xsl:apply-templates select="../blockinfo/titleabbrev[1]/node()"/> 303 </xsl:when> 304 <xsl:when test="../blockinfo/title"> 305 <xsl:apply-templates select="../blockinfo/title[1]/node()"/> 306 </xsl:when> 307 <xsl:when test="../info/titleabbrev"> 308 <xsl:apply-templates select="../info/titleabbrev[1]/node()"/> 309 </xsl:when> 310 <xsl:when test="../titleabbrev"> 311 <xsl:apply-templates select="../titleabbrev[1]/node()"/> 312 </xsl:when> 313 <xsl:when test="../info/title"> 314 <xsl:apply-templates select="../info/title[1]/node()"/> 315 </xsl:when> 316 <xsl:when test="../title"> 317 <xsl:apply-templates select="../title[1]/node()"/> 318 </xsl:when> 319 <xsl:otherwise> 320 <xsl:apply-templates select="(*[local-name(.)!='label'])[1]/node()"/> 321 </xsl:otherwise> 322 </xsl:choose> 267 323 </xsl:variable> 268 324 <xsl:variable name="deflabel"> … … 279 335 <dt> 280 336 <xsl:apply-templates select="." mode="label.markup"/> 281 <xsl:if test=" $deflabel = 'number'and not(label)">337 <xsl:if test="contains($deflabel,'number') and not(label)"> 282 338 <xsl:apply-templates select="." mode="intralabel.punctuation"/> 283 339 </xsl:if> … … 310 366 <xsl:template name="process.qandaset"> 311 367 368 <xsl:variable name="deflabel"> 369 <xsl:apply-templates select="." mode="qanda.defaultlabel"/> 370 </xsl:variable> 371 312 372 <xsl:variable name="label-width"> 313 373 <xsl:call-template name="pi.dbhtml_label-width"/> … … 326 386 </xsl:variable> 327 387 328 <table border="0" summary="Q and A Set"> 388 <table border="{$table.border.off}"> 389 <xsl:if test="$css.decoration != 0"> 390 <xsl:attribute name="style">width: 100%;</xsl:attribute> 391 </xsl:if> 329 392 <xsl:if test="$table-summary != ''"> 330 393 <xsl:attribute name="summary"> … … 345 408 </xsl:if> 346 409 347 <col align="left"> 348 <xsl:attribute name="width"> 349 <xsl:choose> 350 <xsl:when test="$label-width != ''"> 351 <xsl:value-of select="$label-width"/> 352 </xsl:when> 353 <xsl:otherwise>1%</xsl:otherwise> 354 </xsl:choose> 355 </xsl:attribute> 356 </col> 410 <colgroup> 411 <col align="{$direction.align.start}"> 412 <xsl:attribute name="width"> 413 <xsl:choose> 414 <xsl:when test="$label-width != ''"> 415 <xsl:value-of select="$label-width"/> 416 </xsl:when> 417 <xsl:otherwise> 418 <xsl:text>1%</xsl:text> 419 </xsl:otherwise> 420 </xsl:choose> 421 </xsl:attribute> 422 </col> 423 <col/> 424 </colgroup> 357 425 <tbody> 358 426 <xsl:apply-templates select="qandaentry|qandadiv"/>
Note:
See TracChangeset
for help on using the changeset viewer.