/usr/share/yelp-xsl/xslt/mallard/html/mal2html-list.xsl is in yelp-xsl 3.10.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 | <?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
<!--
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License
along with this program; see the file COPYING.LGPL. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:mal="http://projectmallard.org/1.0/"
xmlns:ui="http://projectmallard.org/ui/1.0/"
xmlns:uix="http://projectmallard.org/experimental/ui/"
xmlns:str="http://exslt.org/strings"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="mal ui uix str"
version="1.0">
<!--!!==========================================================================
Mallard to HTML - Lists
Handle Mallard list elements.
:Revision: version="1.0" date="2010-06-04" status="final"
This stylesheet contains templates for the #{list}, #{steps}, #{terms}, and
#{tree} elements in %{mal2html.block.mode}. It handles the parent list elements,
as well as any special processing for child #{item} elements.
-->
<!-- = list = -->
<xsl:template mode="mal2html.block.mode" match="mal:list">
<xsl:variable name="if"><xsl:call-template name="mal.if.test"/></xsl:variable><xsl:if test="$if != ''">
<xsl:variable name="style" select="concat(' ', @style, ' ')"/>
<xsl:variable name="el">
<xsl:choose>
<xsl:when test="not(@type) or (@type = 'none') or (@type = 'box')
or (@type = 'check') or (@type = 'circle') or (@type = 'diamond')
or (@type = 'disc') or (@type = 'hyphen') or (@type = 'square')">
<xsl:text>ul</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>ol</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<div>
<xsl:call-template name="html.lang.attrs"/>
<xsl:call-template name="html.class.attr">
<xsl:with-param name="class">
<xsl:text>list</xsl:text>
<xsl:if test="mal:title and (@ui:expanded or @uix:expanded)">
<xsl:text> ui-expander</xsl:text>
</xsl:if>
<xsl:if test="$if != 'true'">
<xsl:text> if-if </xsl:text>
<xsl:value-of select="$if"/>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="mal2html.ui.expander.data"/>
<div class="inner">
<xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
<div class="region">
<xsl:element name="{$el}" namespace="{$html.namespace}">
<xsl:attribute name="class">
<xsl:text>list</xsl:text>
<xsl:if test="contains($style, ' compact ')">
<xsl:text> compact</xsl:text>
</xsl:if>
</xsl:attribute>
<xsl:if test="@type">
<xsl:attribute name="style">
<xsl:value-of select="concat('list-style-type:', @type)"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="contains(concat(' ', @style, ' '), ' continues ')">
<xsl:attribute name="start">
<xsl:call-template name="mal.list.start"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="mal:item"/>
</xsl:element>
</div>
</div>
</div>
</xsl:if>
</xsl:template>
<!-- = list/item = -->
<xsl:template match="mal:list/mal:item">
<xsl:variable name="if"><xsl:call-template name="mal.if.test"/></xsl:variable><xsl:if test="$if != ''">
<li>
<xsl:call-template name="html.class.attr">
<xsl:with-param name="class">
<xsl:text>list</xsl:text>
<xsl:if test="$if != 'true'">
<xsl:text> if-if </xsl:text>
<xsl:value-of select="$if"/>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="mal2html.block.mode"/>
</li>
</xsl:if>
</xsl:template>
<!-- = steps = -->
<xsl:template mode="mal2html.block.mode" match="mal:steps">
<xsl:variable name="if"><xsl:call-template name="mal.if.test"/></xsl:variable><xsl:if test="$if != ''">
<div>
<xsl:call-template name="html.lang.attrs"/>
<xsl:call-template name="html.class.attr">
<xsl:with-param name="class">
<xsl:text>steps</xsl:text>
<xsl:if test="mal:title and (@ui:expanded or @uix:expanded)">
<xsl:text> ui-expander</xsl:text>
</xsl:if>
<xsl:if test="$if != 'true'">
<xsl:text> if-if </xsl:text>
<xsl:value-of select="$if"/>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="mal2html.ui.expander.data"/>
<div class="inner">
<xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
<div class="region">
<ol class="steps">
<xsl:if test="contains(concat(' ', @style, ' '), ' continues ')">
<xsl:attribute name="start">
<xsl:call-template name="mal.list.start"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="mal:item"/>
</ol>
</div>
</div>
</div>
</xsl:if>
</xsl:template>
<xsl:template name="mal.list.start">
<xsl:param name="node" select="."/>
<xsl:choose>
<xsl:when test="contains(concat(' ', $node/@style, ' '), ' continues ')">
<xsl:variable name="prevlist"
select="$node/preceding::*[name(.) = name($node)]
[not(@type) and not($node/@type) or (@type = $node/@type)][1]"/>
<xsl:choose>
<xsl:when test="count($prevlist) = 0">1</xsl:when>
<xsl:otherwise>
<xsl:variable name="prevlength" select="count($prevlist/mal:item)"/>
<xsl:variable name="prevstart">
<xsl:call-template name="mal.list.start">
<xsl:with-param name="node" select="$prevlist"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$prevstart + $prevlength"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- = steps/item = -->
<xsl:template match="mal:steps/mal:item">
<xsl:variable name="if"><xsl:call-template name="mal.if.test"/></xsl:variable><xsl:if test="$if != ''">
<li>
<xsl:call-template name="html.class.attr">
<xsl:with-param name="class">
<xsl:text>steps</xsl:text>
<xsl:if test="$if != 'true'">
<xsl:text> if-if </xsl:text>
<xsl:value-of select="$if"/>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="mal2html.block.mode"/>
</li>
</xsl:if>
</xsl:template>
<!-- = terms = -->
<xsl:template mode="mal2html.block.mode" match="mal:terms">
<xsl:variable name="if"><xsl:call-template name="mal.if.test"/></xsl:variable><xsl:if test="$if != ''">
<xsl:variable name="style" select="concat(' ', @style, ' ')"/>
<div>
<xsl:call-template name="html.lang.attrs"/>
<xsl:call-template name="html.class.attr">
<xsl:with-param name="class">
<xsl:text>terms</xsl:text>
<xsl:if test="mal:title and (@ui:expanded or @uix:expanded)">
<xsl:text> ui-expander</xsl:text>
</xsl:if>
<xsl:if test="$if != 'true'">
<xsl:text> if-if </xsl:text>
<xsl:value-of select="$if"/>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="mal2html.ui.expander.data"/>
<div class="inner">
<xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
<div class="region">
<dl class="terms">
<xsl:attribute name="class">
<xsl:text>terms</xsl:text>
<xsl:if test="contains($style, ' compact ')">
<xsl:text> compact</xsl:text>
</xsl:if>
</xsl:attribute>
<xsl:apply-templates select="mal:item"/>
</dl>
</div>
</div>
</div>
</xsl:if>
</xsl:template>
<!-- = terms/item = -->
<xsl:template match="mal:terms/mal:item">
<xsl:variable name="if"><xsl:call-template name="mal.if.test"/></xsl:variable><xsl:if test="$if != ''">
<xsl:for-each select="mal:title">
<dt>
<xsl:call-template name="html.class.attr">
<xsl:with-param name="class">
<xsl:text>terms</xsl:text>
<xsl:if test="$if != 'true'">
<xsl:text> if-if </xsl:text>
<xsl:value-of select="$if"/>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="html.lang.attrs">
<xsl:with-param name="parent" select=".."/>
</xsl:call-template>
<xsl:apply-templates mode="mal2html.inline.mode"/>
</dt>
</xsl:for-each>
<dd>
<xsl:call-template name="html.class.attr">
<xsl:with-param name="class">
<xsl:text>terms</xsl:text>
<xsl:if test="$if != 'true'">
<xsl:text> if-if </xsl:text>
<xsl:value-of select="$if"/>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="html.lang.attrs"/>
<xsl:apply-templates mode="mal2html.block.mode" select="*[not(self::mal:title)]"/>
</dd>
</xsl:if>
</xsl:template>
<!-- = tree = -->
<xsl:template mode="mal2html.block.mode" match="mal:tree">
<xsl:variable name="if"><xsl:call-template name="mal.if.test"/></xsl:variable><xsl:if test="$if != ''">
<xsl:variable name="lines" select="contains(concat(' ', @style, ' '), ' lines ')"/>
<div>
<xsl:call-template name="html.lang.attrs"/>
<xsl:call-template name="html.class.attr">
<xsl:with-param name="class">
<xsl:text>tree</xsl:text>
<xsl:if test="$lines">
<xsl:text> tree-lines</xsl:text>
</xsl:if>
<xsl:if test="mal:title and (@ui:expanded or @uix:expanded)">
<xsl:text> ui-expander</xsl:text>
</xsl:if>
<xsl:if test="$if != 'true'">
<xsl:text> if-if </xsl:text>
<xsl:value-of select="$if"/>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="mal2html.ui.expander.data"/>
<div class="inner">
<xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
<div class="region">
<ul class="tree">
<xsl:apply-templates mode="mal2html.tree.mode" select="mal:item">
<xsl:with-param name="lines" select="$lines"/>
</xsl:apply-templates>
</ul>
</div>
</div>
</div>
</xsl:if>
</xsl:template>
<!--%%==========================================================================
mal2html.tree.mode
Process an #{item} element inside a #{tree}.
:Revision: version="1.0" date="2010-06-04" status="final"
$lines: Whether to draw lines indicating hierarchy.
$prefix: The line markers used by the parent #{item}.
This mode is used for processing #{item} elements in #{tree} elements. It is
applied by the template for #{tree} and recursively calls itself. If the parent
#{tree} has the style hint #{"lines"}, the ${lines} parameter will be #{true}.
In this case, this template calculates a prefix based on its position and
neighboring #{item} elements, and passes that prefix to child elements.
-->
<xsl:template mode="mal2html.tree.mode" match="mal:item">
<xsl:param name="lines" select="false()"/>
<xsl:param name="prefix" select="''"/>
<xsl:variable name="if">
<xsl:choose>
<!-- We do the tests as we process children, to get lines right, and
only apply-templates to what we have to. So if this is a deep
item, don't spend the CPU cycles testing it again.
-->
<xsl:when test="parent::mal:item">
<xsl:text>true</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="mal.if.test"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$if != ''">
<li>
<xsl:call-template name="html.class.attr">
<xsl:with-param name="class">
<xsl:text>tree</xsl:text>
<xsl:if test="$if != 'true'">
<xsl:text> if-if </xsl:text>
<xsl:value-of select="$if"/>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="html.lang.attrs"/>
<div>
<xsl:if test="$lines">
<xsl:value-of select="$prefix"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:apply-templates mode="mal2html.inline.mode"
select="node()[not(self::mal:item)]"/>
</div>
<xsl:variable name="items">
<xsl:for-each select="mal:item">
<xsl:variable name="itemif">
<xsl:call-template name="mal.if.test"/>
</xsl:variable>
<xsl:if test="$itemif = 'true'">
<xsl:value-of select="concat(position(), ':')"/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:if test="$items != ''">
<ul class="tree">
<xsl:variable name="node" select="."/>
<xsl:for-each select="str:split($items, ':')">
<xsl:variable name="itempos" select="number(.)"/>
<xsl:variable name="item" select="$node/mal:item[position() = $itempos]"/>
<xsl:apply-templates mode="mal2html.tree.mode" select="$item">
<xsl:with-param name="lines" select="$lines"/>
<xsl:with-param name="prefix">
<xsl:if test="$lines">
<xsl:variable name="dir">
<xsl:call-template name="l10n.direction">
<xsl:with-param name="lang" select="$item/ancestor-or-self::*[@xml:lang][1]/@xml:lang"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="translate(translate(translate(translate(
$prefix,
'├', '│'),
'┤', '│'),
'└', ' '),
'┘', ' ')"/>
<xsl:text>    </xsl:text>
<xsl:choose>
<xsl:when test="position() != last()">
<xsl:choose>
<xsl:when test="$dir = 'rtl'">
<xsl:text>┤</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>├</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$dir = 'rtl'">
<xsl:text>┘</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>└</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:with-param>
</xsl:apply-templates>
</xsl:for-each>
</ul>
</xsl:if>
</li>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
|