/usr/share/yelp-xsl/xslt/docbook/html/db2html-classsynopsis.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 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 | <?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:db="http://docbook.org/ns/docbook"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="db"
version="1.0">
<!--!!==========================================================================
DocBook to HTML - Class Synopses
:Requires: db2html-xref html
:Revision:version="1.0" date="2011-05-16" status="final"
This module handles the DocBook #{classsynopsis} and related elements. The
contents of the class-modeling elements are processed in a mode depending on
the programming language to format the synopsis correctly.
-->
<xsl:variable name="db2html.classsynopsis.tab"
select="'    '"/>
<!--@@==========================================================================
db2html.classsynopsis.language
The default programming language used to format #{classsynopsis} elements.
:Revision:version="1.0" date="2011-05-16" status="final"
This parameter sets the default value for the #{language} attribute of elements
like #{classsynopsis}. Templates in this module will always use the #{language}
attribute if present. Otherwise, they fall back to this value. This parameter
can be set with the #{db2html.classsynopsis.language} processing instruction
at the root of a DocBook document.
-->
<xsl:param name="db2html.classsynopsis.language">
<xsl:choose>
<xsl:when test="/processing-instruction('db2html.classsynopsis.language')">
<xsl:value-of
select="/processing-instruction('db2html.classsynopsis.language')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'cpp'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<!-- == Matched Templates == -->
<!-- = *synopsis = -->
<xsl:template match="
classsynopsis | constructorsynopsis | fieldsynopsis |
methodsynopsis | destructorsynopsis |
db:classsynopsis | db:constructorsynopsis | db:fieldsynopsis |
db:methodsynopsis | db:destructorsynopsis |">
<xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
<xsl:if test="$if != ''">
<xsl:variable name="language">
<xsl:choose>
<xsl:when test="@language">
<xsl:value-of select="@language"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$db2html.classsynopsis.language"/>
</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>synopsis </xsl:text>
<xsl:value-of select="local-name(.)"/>
</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="db2html.anchor"/>
<pre class="contents {local-name(.)} classsynopsis-{$language}">
<xsl:choose>
<xsl:when test="$language = 'cpp'">
<xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
</xsl:when>
<xsl:when test="$language = 'python'">
<xsl:apply-templates mode="db2html.class.python.mode" select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>No information about the language '</xsl:text>
<xsl:value-of select="$language"/>
<xsl:text>' for classsynopsis.</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</pre>
</div>
</xsl:if>
</xsl:template>
<!-- = classsynopsisinfo = -->
<xsl:template match="classsynopsisinfo | db:classsynopsisinfo">
<xsl:apply-templates/>
<!-- FIXME? -->
<xsl:text>
</xsl:text>
</xsl:template>
<!-- = methodparam = -->
<xsl:template match="methodparam | db:methodparam">
<span>
<xsl:call-template name="html.class.attr">
<xsl:with-param name="class" select="'methodparam'"/>
</xsl:call-template>
<xsl:for-each select="*">
<xsl:if test="position() != 1">
<xsl:text> </xsl:text>
</xsl:if>
<xsl:apply-templates select="."/>
</xsl:for-each>
</span>
</xsl:template>
<!--#* db2html.class.cpp.modifier -->
<xsl:template name="db2html.class.cpp.modifier">
<!-- For C++, we expect the first modifier to be the visibility -->
<xsl:variable name="prec" select="self::*[../self::classsynopsis]/preceding-sibling::constructorsynopsis |
self::*[../self::classsynopsis]/preceding-sibling::destructorsynopsis |
self::*[../self::classsynopsis]/preceding-sibling::fieldsynopsis |
self::*[../self::classsynopsis]/preceding-sibling::methodsynopsis |
self::*[../self::db:classsynopsis]/preceding-sibling::db:constructorsynopsis |
self::*[../self::db:classsynopsis]/preceding-sibling::db:destructorsynopsis |
self::*[../self::db:classsynopsis]/preceding-sibling::db:fieldsynopsis |
self::*[../self::db:classsynopsis]/preceding-sibling::db:methodsynopsis "/>
<xsl:choose>
<xsl:when test="not($prec[modifier][last()][modifier[1] = current()/modifier[1]]) and
not($prec[db:modifier][last()][db:modifier[1] = current()/db:modifier[1]])">
<xsl:if test="$prec"><xsl:text>
</xsl:text></xsl:if>
<xsl:apply-templates select="(modifier | db:modifier)[1]"/>
<xsl:text>:
</xsl:text>
</xsl:when>
<xsl:when test="$prec and (name($prec[last()]) != name(.))">
<xsl:text>
</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<!--%%==========================================================================
db2html.class.cpp.mode
Process a C++ synopsis.
:Revision:version="1.0" date="2011-05-16" status="final"
This mode is applied to child elements for synopsis elements for the C++
programming language. In C++ synopses, the first #{modifier} element for
methods is expected to mark the visibility, such as #{public} or #{private}.
-->
<xsl:template mode="db2html.class.cpp.mode" match="*">
<xsl:apply-templates select="."/>
</xsl:template>
<!-- = classsynopsis % db2html.class.cpp.mode = -->
<xsl:template mode="db2html.class.cpp.mode"
match="classsynopsis | db:classsynopsis">
<!-- classsynopsis = element classsynopsis {
attribute language { ... }?,
attribute class { ... }?,
ooclass+,
(classsynopsisinfo | constructorsynopsis |
destructorsynopsis | fieldsynopsis |
methodsynopsis )
}
-->
<xsl:if test="@class = 'class' or not(@class)">
<span class="ooclass">
<xsl:for-each select="ooclass[1]/modifier | db:ooclass[1]/db:modifier">
<xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
<xsl:text> </xsl:text>
</xsl:for-each>
<xsl:text>class </xsl:text>
<xsl:apply-templates mode="db2html.class.cpp.mode"
select="ooclass[1]/classname |
db:ooclass[1]/db:classname"/>
</span>
<xsl:if test="ooclass[2] or db:ooclass[2]">
<xsl:text> : </xsl:text>
<xsl:for-each select="ooclass[position() != 1] |
db:ooclass[position() != 1]">
<xsl:if test="position() != 1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
</xsl:for-each>
</xsl:if>
<xsl:text>
{
</xsl:text>
<xsl:apply-templates mode="db2html.class.cpp.mode"
select="
classsynopsisinfo |
constructorsynopsis | destructorsynopsis |
fieldsynopsis | methodsynopsis |
db:classsynopsisinfo |
db:constructorsynopsis | db:destructorsynopsis |
db:fieldsynopsis | db:methodsynopsis "/>
<xsl:text>}
</xsl:text>
</xsl:if>
</xsl:template>
<!-- = constructorsynopsis % db2html.class.cpp.mode = -->
<xsl:template mode="db2html.class.cpp.mode"
match="constructorsynopsis | db:constructorsynopsis">
<!-- constructorsynopsis = element constructorsynopsis {
attribute language { ... }?,
modifier+,
methodname?,
(methodparam+ | void?)
}
-->
<xsl:call-template name="db2html.class.cpp.modifier"/>
<xsl:value-of select="$db2html.classsynopsis.tab"/>
<xsl:for-each select="modifier[position() != 1] | db:modifier[position() != 1]">
<xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
<xsl:text> </xsl:text>
</xsl:for-each>
<xsl:choose>
<xsl:when test="methodname or db:methodname">
<xsl:apply-templates mode="db2html.class.cpp.mode"
select="methodname | db:methodname"/>
</xsl:when>
<xsl:when test="../self::classsynopsis[ooclass]">
<span class="methodname">
<xsl:value-of select="../ooclass/classname"/>
</span>
</xsl:when>
<xsl:when test="../self::db:classsynopsis[db:ooclass]">
<span class="methodname">
<xsl:value-of select="../db:ooclass/db:classname"/>
</span>
</xsl:when>
</xsl:choose>
<xsl:text>(</xsl:text>
<xsl:for-each select="methodparam | db:methodparam">
<xsl:if test="position() != 1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
</xsl:for-each>
<xsl:text>);
</xsl:text>
</xsl:template>
<!-- = destructorsynopsis % db2html.class.cpp.mode = -->
<xsl:template mode="db2html.class.cpp.mode"
match="destructorsynopsis | db:destructorsynopsis">
<!-- destructorsynopsis = element destructorsynopsis {
attribute language { ... }?,
modifier+,
methodname?,
(methodparam+ | void?)
}
-->
<xsl:call-template name="db2html.class.cpp.modifier"/>
<xsl:value-of select="$db2html.classsynopsis.tab"/>
<xsl:for-each select="modifier[position() != 1] | db:modifier[position() != 1]">
<xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
<xsl:text> </xsl:text>
</xsl:for-each>
<xsl:choose>
<xsl:when test="methodname">
<xsl:apply-templates mode="db2html.class.cpp.mode"
select="methodname | db:methodname"/>
</xsl:when>
<xsl:when test="../self::classsynopsis[ooclass]">
<span class="methodname">
<xsl:text>~</xsl:text>
<xsl:value-of select="../ooclass/classname"/>
</span>
</xsl:when>
<xsl:when test="../self::db:classsynopsis[db:ooclass]">
<span class="methodname">
<xsl:value-of select="../db:ooclass/db:classname"/>
</span>
</xsl:when>
</xsl:choose>
<xsl:text>(</xsl:text>
<xsl:for-each select="methodparam | db:methodparam">
<!-- FIXME: should we do each methodparam on its own line? -->
<xsl:if test="position() != 1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
</xsl:for-each>
<xsl:text>);
</xsl:text>
</xsl:template>
<!-- = fieldsynopsis % db2html.class.cpp.mode = -->
<xsl:template mode="db2html.class.cpp.mode"
match="fieldsynopsis | db:fieldsynopsis">
<!-- fieldsynopsis = element fieldsynopsis {
attribute language { ... }?,
modifier+,
type,
varname,
initializer?
}
-->
<xsl:call-template name="db2html.class.cpp.modifier"/>
<xsl:value-of select="$db2html.classsynopsis.tab"/>
<xsl:for-each select="modifier[position() != 1] | db:modifier[position() != 1]">
<xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
<xsl:text> </xsl:text>
</xsl:for-each>
<xsl:if test="type or db:type">
<xsl:apply-templates mode="db2html.class.cpp.mode" select="type | db:type"/>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:apply-templates mode="db2html.class.cpp.mode"
select="varname | db:varname"/>
<xsl:if test="initializer or db:initializer">
<xsl:text> = </xsl:text>
<xsl:apply-templates mode="db2html.class.cpp.mode"
select="initializer | db:initializer"/>
</xsl:if>
<xsl:text>;
</xsl:text>
</xsl:template>
<!-- = methodparam % db2html.class.cpp.mode = -->
<xsl:template mode="db2html.class.cpp.mode"
match="methodparam | db:methodparam">
<span>
<xsl:call-template name="html.class.attr">
<xsl:with-param name="class" select="'methodparam'"/>
</xsl:call-template>
<xsl:for-each select="*">
<xsl:if test="position() != 1">
<xsl:text> </xsl:text>
</xsl:if>
<xsl:if test="self::initializer or self::db:initializer">
<xsl:text>= </xsl:text>
</xsl:if>
<xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
</xsl:for-each>
</span>
</xsl:template>
<!-- = methodsynopsis % db2html.class.cpp.mode = -->
<xsl:template mode="db2html.class.cpp.mode"
match="methodsynopsis | db:methodsynopsis">
<!-- methodsynopsis = element methodsynopsis {
attribute language { ... }?,
modifier+,
(type | void),
methodname,
(methodparam+ | void?)
}
-->
<xsl:call-template name="db2html.class.cpp.modifier"/>
<xsl:value-of select="$db2html.classsynopsis.tab"/>
<!-- Parens for document order -->
<xsl:for-each select="(methodname/preceding-sibling::modifier |
db:methodname/preceding-sibling::db:modifier)[position() != 1]">
<xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
<xsl:text> </xsl:text>
</xsl:for-each>
<xsl:apply-templates mode="db2html.class.cpp.mode"
select="type | methodname/preceding-sibling::void |
db:type | db:methodname/preceding-sibling::db:void"/>
<xsl:text> </xsl:text>
<xsl:apply-templates mode="db2html.class.cpp.mode"
select="methodname | db:methodname"/>
<xsl:text>(</xsl:text>
<xsl:for-each select="methodparam | db:methodparam">
<xsl:if test="position() != 1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
</xsl:for-each>
<xsl:text>)</xsl:text>
<xsl:for-each select="methodname/following-sibling::modifier |
db:methodname/following-sibling::db:modifier">
<xsl:text> </xsl:text>
<xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
</xsl:for-each>
<xsl:text>;
</xsl:text>
</xsl:template>
<!--%%==========================================================================
db2html.class.python.mode
Process a Python synopsis.
:Revision:version="1.0" date="2011-05-16" status="final"
This mode is applied to child elements for synopsis elements for the Python
programming language.
-->
<xsl:template mode="db2html.class.python.mode" match="*">
<xsl:apply-templates select="."/>
</xsl:template>
<!-- = classsynopsis % db2html.class.python.mode = -->
<xsl:template mode="db2html.class.python.mode"
match="classsynopsis | db:classsynopsis">
<!-- classsynopsis = element classsynopsis {
attribute language { ... }?,
attribute class { ... }?,
ooclass+,
(classsynopsisinfo | constructorsynopsis |
destructorsynopsis | fieldsynopsis |
methodsynopsis )
}
-->
<xsl:if test="@class = 'class' or not(@class)">
<xsl:text>class </xsl:text>
<xsl:apply-templates mode="db2html.class.python.mode"
select="ooclass[1] | db:ooclass[1]"/>
<xsl:if test="ooclass[2] or db:ooclass[2]">
<xsl:text>(</xsl:text>
<xsl:for-each select="(ooclass | db:ooclass)[position() != 1]">
<xsl:if test="position() != 1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:apply-templates mode="db2html.class.python.mode" select="."/>
</xsl:for-each>
<xsl:text>)</xsl:text>
</xsl:if>
<xsl:text>:
</xsl:text>
<xsl:for-each select="classsynopsisinfo | constructorsynopsis |
destructorsynopsis | fieldsynopsis |
methodsynopsis |
db:classsynopsisinfo | db:constructorsynopsis |
db:destructorsynopsis | db:fieldsynopsis |
db:methodsynopsis ">
<xsl:apply-templates mode="db2html.class.python.mode" select="."/>
<xsl:if test="position() != last() and local-name(following-sibling::*[1]) != local-name(.)">
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:template>
<!-- = constructorsynopsis % db2html.class.python.mode = -->
<xsl:template mode="db2html.class.python.mode"
match="constructorsynopsis | db:constructorsynopsis">
<!-- constructorsynopsis = element constructorsynopsis {
attribute language { ... }?,
modifier+,
methodname?,
(methodparam+ | void?)
}
-->
<xsl:variable name="tab">
<xsl:if test="../self::classsynopsis or ../self::db:classsynopsis">
<xsl:value-of select="$db2html.classsynopsis.tab"/>
</xsl:if>
</xsl:variable>
<xsl:for-each select="modifier | db:modifier">
<xsl:value-of select="$tab"/>
<xsl:apply-templates mode="db2html.class.python.mode" select="."/>
<xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:value-of select="$tab"/>
<xsl:choose>
<xsl:when test="methodname">
<xsl:apply-templates mode="db2html.class.python.mode" select="methodname"/>
</xsl:when>
<xsl:when test="db:methodname">
<xsl:apply-templates mode="db2html.class.python.mode" select="db:methodname"/>
</xsl:when>
<xsl:when test="../self::classsynopsis[ooclass]">
<span class="methodname">
<xsl:value-of select="../ooclass/classname"/>
</span>
</xsl:when>
<xsl:when test="../self::db:classsynopsis[db:ooclass]">
<span class="methodname">
<xsl:value-of select="../db:ooclass/db:classname"/>
</span>
</xsl:when>
</xsl:choose>
<xsl:text>(</xsl:text>
<xsl:for-each select="methodparam | db:methodparam">
<xsl:if test="position() != 1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:apply-templates mode="db2html.class.python.mode" select="."/>
</xsl:for-each>
<xsl:text>)</xsl:text>
<xsl:if test="type or db:type">
<xsl:text> -> </xsl:text>
<xsl:apply-templates mode="db2html.class.python.mode" select="type | db:type"/>
</xsl:if>
<xsl:text>
</xsl:text>
</xsl:template>
<!-- = destructorsynopsis % db2html.class.python.mode = -->
<xsl:template mode="db2html.class.python.mode"
match="destructorsynopsis | db:destructorsynopsis">
<!-- destructorsynopsis = element destructorsynopsis {
attribute language { ... }?,
modifier+,
methodname?,
(methodparam+ | void?)
}
-->
<xsl:variable name="tab">
<xsl:if test="../self::classsynopsis or ../self::db:classsynopsis">
<xsl:value-of select="$db2html.classsynopsis.tab"/>
</xsl:if>
</xsl:variable>
<xsl:for-each select="modifier | db:modifier">
<xsl:value-of select="$tab"/>
<xsl:apply-templates mode="db2html.class.python.mode" select="."/>
<xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:value-of select="$tab"/>
<xsl:choose>
<xsl:when test="methodname">
<xsl:apply-templates mode="db2html.class.python.mode" select="methodname"/>
</xsl:when>
<xsl:when test="db:methodname">
<xsl:apply-templates mode="db2html.class.python.mode" select="db:methodname"/>
</xsl:when>
<xsl:otherwise>
<span class="methodname">
<xsl:text>__del__</xsl:text>
</span>
</xsl:otherwise>
</xsl:choose>
<xsl:text>(</xsl:text>
<xsl:for-each select="methodparam | db:methodparam">
<xsl:if test="position() != 1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:apply-templates mode="db2html.class.python.mode" select="."/>
</xsl:for-each>
<xsl:text>)</xsl:text>
<xsl:if test="type or db:type">
<xsl:text> -> </xsl:text>
<xsl:apply-templates mode="db2html.class.python.mode" select="type | db:type"/>
</xsl:if>
<xsl:text>
</xsl:text>
</xsl:template>
<!-- = fieldsynopsis % db2html.class.python.mode = -->
<xsl:template mode="db2html.class.python.mode"
match="fieldsynopsis | db:fieldsynopsis">
<!-- fieldsynopsis = element fieldsynopsis {
attribute language { ... }?,
modifier+,
type,
varname,
initializer?
}
-->
<xsl:variable name="tab">
<xsl:if test="../self::classsynopsis or ../self::db:classsynopsis">
<xsl:value-of select="$db2html.classsynopsis.tab"/>
</xsl:if>
</xsl:variable>
<xsl:for-each select="modifier | db:modifier">
<xsl:value-of select="$tab"/>
<xsl:apply-templates mode="db2html.class.python.mode" select="."/>
<xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:value-of select="$tab"/>
<xsl:apply-templates mode="db2html.class.python.mode"
select="varname | db:varname"/>
<xsl:if test="initializer or db:initializer">
<xsl:text>=</xsl:text>
<xsl:apply-templates mode="db2html.class.python.mode"
select="initializer | db:initializer"/>
</xsl:if>
<xsl:text>
</xsl:text>
</xsl:template>
<!-- = methodparam % db2html.class.python.mode = -->
<xsl:template mode="db2html.class.python.mode"
match="methodparam | db:methodparam">
<span class="methodparam">
<xsl:apply-templates mode="db2html.class.python.mode"
select="parameter | db:parameter"/>
<xsl:if test="modifier or type or db:modifier or db:type">
<xsl:text>: </xsl:text>
<xsl:apply-templates mode="db2html.class.python.mode"
select="(modifier | type | db:modifier | db:type)[1]"/>
<xsl:if test="initializer or db:initializer">
<xsl:text> </xsl:text>
</xsl:if>
</xsl:if>
<xsl:if test="initializer or db:initializer">
<xsl:text>=</xsl:text>
<xsl:if test="modifier or type or db:modifier or db:type">
<xsl:text> </xsl:text>
</xsl:if>
<xsl:apply-templates mode="db2html.class.python.mode"
select="initializer | db:initializer"/>
</xsl:if>
</span>
</xsl:template>
<!-- = methodsynopsis % db2html.class.python.mode = -->
<xsl:template mode="db2html.class.python.mode"
match="methodsynopsis | db:methodsynopsis">
<!-- methodsynopsis = element methodsynopsis {
attribute language { ... }?,
modifier+,
(type | void),
methodname,
(methodparam+ | void?)
}
-->
<xsl:variable name="tab">
<xsl:if test="../self::classsynopsis or ../self::db:classsynopsis">
<xsl:value-of select="$db2html.classsynopsis.tab"/>
</xsl:if>
</xsl:variable>
<xsl:for-each select="modifier | db:modifier">
<xsl:value-of select="$tab"/>
<xsl:apply-templates mode="db2html.class.python.mode" select="."/>
<xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:value-of select="$tab"/>
<xsl:text>def </xsl:text>
<xsl:apply-templates mode="db2html.class.python.mode"
select="methodname | db:methodname"/>
<xsl:text>(</xsl:text>
<xsl:for-each select="methodparam | db:methodparam">
<xsl:if test="position() != 1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:apply-templates mode="db2html.class.python.mode" select="."/>
</xsl:for-each>
<xsl:text>)</xsl:text>
<xsl:if test="type or db:type">
<xsl:text> -> </xsl:text>
<xsl:apply-templates mode="db2html.class.python.mode" select="type | db:type"/>
</xsl:if>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
|