~ubuntu-branches/ubuntu/trusty/yelp-xsl/trusty

« back to all changes in this revision

Viewing changes to xslt/docbook/html/db2html-classsynopsis.xsl

  • Committer: Bazaar Package Importer
  • Author(s): Michael Terry
  • Date: 2011-07-09 10:02:21 UTC
  • mto: (11.1.1 experimental) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: james.westby@ubuntu.com-20110709100221-27hsncxrd63leyx4
Tags: upstream-3.1.2
ImportĀ upstreamĀ versionĀ 3.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
20
20
                xmlns:db="http://docbook.org/ns/docbook"
21
21
                xmlns="http://www.w3.org/1999/xhtml"
 
22
                exclude-result-prefixes="db"
22
23
                version="1.0">
23
24
 
24
25
<!--!!==========================================================================
25
26
DocBook to HTML - Class Synopses
26
 
:Requires: db2html-inline db2html-xref gettext
 
27
:Requires: db2html-xref html
 
28
:Revision:version="1.0" date="2011-05-16" status="final"
27
29
 
28
 
REMARK: Describe this module.  Implmentation note: for C++, we expect the first
29
 
modifier to be the visibility
 
30
This module handles the DocBook #{classsynopsis} and related elements. The
 
31
contents of the class-modeling elements are processed in a mode depending on
 
32
the programming language to format the synopsis correctly.
30
33
-->
31
34
 
32
 
<xsl:variable name="cpp.tab" select="'&#160;&#160;&#160;&#160;'"/>
33
 
<xsl:variable name="python.tab" select="'&#160;&#160;&#160;&#160;'"/>
34
 
 
35
 
 
36
 
<!-- FIXME: document PI -->
 
35
<xsl:variable name="db2html.classsynopsis.tab"
 
36
              select="'&#x00A0;&#x00A0;&#x00A0;&#x00A0;'"/>
 
37
 
 
38
 
37
39
<!--@@==========================================================================
38
40
db2html.classsynopsis.language
39
 
The default programming language used to format #{classsynopsis} elements
 
41
The default programming language used to format #{classsynopsis} elements.
 
42
:Revision:version="1.0" date="2011-05-16" status="final"
40
43
 
41
 
REMARK: Describe this param
 
44
This parameter sets the default value for the #{language} attribute of elements
 
45
like #{classsynopsis}. Templates in this module will always use the #{language}
 
46
attribute if present. Otherwise, they fall back to this value. This parameter
 
47
can be set with the #{db2html.classsynopsis.language} processing instruction
 
48
at the root of a DocBook document.
42
49
-->
43
50
<xsl:param name="db2html.classsynopsis.language">
44
51
  <xsl:choose>
72
79
    </xsl:choose>
73
80
  </xsl:variable>
74
81
  <div>
75
 
    <xsl:choose>
76
 
      <xsl:when test="@lang | @xml:lang">
77
 
        <xsl:attribute name="dir">
78
 
          <xsl:call-template name="l10n.direction">
79
 
            <xsl:with-param name="lang" select="@lang | @xml:lang"/>
80
 
          </xsl:call-template>
81
 
        </xsl:attribute>
82
 
      </xsl:when>
83
 
      <xsl:otherwise>
84
 
        <xsl:attribute name="dir">
85
 
          <xsl:text>ltr</xsl:text>
86
 
        </xsl:attribute>
87
 
      </xsl:otherwise>
88
 
    </xsl:choose>
 
82
    <xsl:call-template name="html.lang.attrs"/>
89
83
    <xsl:attribute name="class">
90
84
      <xsl:text>synopsis </xsl:text>
91
85
      <xsl:value-of select="local-name(.)"/>
157
151
 
158
152
<!--%%==========================================================================
159
153
db2html.class.cpp.mode
 
154
Process a C++ synopsis.
 
155
:Revision:version="1.0" date="2011-05-16" status="final"
160
156
 
161
 
REMARK: Describe this mode
 
157
This mode is applied to child elements for synopsis elements for the C++
 
158
programming language. In C++ synopses, the first #{modifier} element for
 
159
methods is expected to mark the visibility, such as #{public} or #{private}.
162
160
-->
163
161
<xsl:template mode="db2html.class.cpp.mode" match="*">
164
162
  <xsl:apply-templates select="."/>
221
219
       }
222
220
  -->
223
221
  <xsl:call-template name="db2html.class.cpp.modifier"/>
224
 
  <xsl:value-of select="$cpp.tab"/>
 
222
  <xsl:value-of select="$db2html.classsynopsis.tab"/>
225
223
  <xsl:for-each select="modifier[position() != 1] | db:modifier[position() != 1]">
226
224
    <xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
227
225
    <xsl:text> </xsl:text>
263
261
       }
264
262
  -->
265
263
  <xsl:call-template name="db2html.class.cpp.modifier"/>
266
 
  <xsl:value-of select="$cpp.tab"/>
 
264
  <xsl:value-of select="$db2html.classsynopsis.tab"/>
267
265
  <xsl:for-each select="modifier[position() != 1] | db:modifier[position() != 1]">
268
266
    <xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
269
267
    <xsl:text> </xsl:text>
308
306
       }
309
307
  -->
310
308
  <xsl:call-template name="db2html.class.cpp.modifier"/>
311
 
  <xsl:value-of select="$cpp.tab"/>
 
309
  <xsl:value-of select="$db2html.classsynopsis.tab"/>
312
310
  <xsl:for-each select="modifier[position() != 1] | db:modifier[position() != 1]">
313
311
    <xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
314
312
    <xsl:text> </xsl:text>
355
353
       }
356
354
  -->
357
355
  <xsl:call-template name="db2html.class.cpp.modifier"/>
358
 
  <xsl:value-of select="$cpp.tab"/>
 
356
  <xsl:value-of select="$db2html.classsynopsis.tab"/>
359
357
  <!-- Parens for document order -->
360
358
  <xsl:for-each select="(methodname/preceding-sibling::modifier |
361
359
                         db:methodname/preceding-sibling::db:modifier)[position() != 1]">
387
385
 
388
386
<!--%%==========================================================================
389
387
db2html.class.python.mode
 
388
Process a Python synopsis.
 
389
:Revision:version="1.0" date="2011-05-16" status="final"
390
390
 
391
 
REMARK: Describe this mode
 
391
This mode is applied to child elements for synopsis elements for the Python
 
392
programming language.
392
393
-->
393
394
<xsl:template mode="db2html.class.python.mode" match="*">
394
395
  <xsl:apply-templates select="."/>
447
448
  -->
448
449
  <xsl:variable name="tab">
449
450
    <xsl:if test="../self::classsynopsis or ../self::db:classsynopsis">
450
 
      <xsl:value-of select="$python.tab"/>
 
451
      <xsl:value-of select="$db2html.classsynopsis.tab"/>
451
452
    </xsl:if>
452
453
  </xsl:variable>
453
454
  <xsl:for-each select="modifier | db:modifier">
501
502
  -->
502
503
  <xsl:variable name="tab">
503
504
    <xsl:if test="../self::classsynopsis or ../self::db:classsynopsis">
504
 
      <xsl:value-of select="$python.tab"/>
 
505
      <xsl:value-of select="$db2html.classsynopsis.tab"/>
505
506
    </xsl:if>
506
507
  </xsl:variable>
507
508
  <xsl:for-each select="modifier | db:modifier">
551
552
  -->
552
553
  <xsl:variable name="tab">
553
554
    <xsl:if test="../self::classsynopsis or ../self::db:classsynopsis">
554
 
      <xsl:value-of select="$python.tab"/>
 
555
      <xsl:value-of select="$db2html.classsynopsis.tab"/>
555
556
    </xsl:if>
556
557
  </xsl:variable>
557
558
  <xsl:for-each select="modifier | db:modifier">
608
609
  -->
609
610
  <xsl:variable name="tab">
610
611
    <xsl:if test="../self::classsynopsis or ../self::db:classsynopsis">
611
 
      <xsl:value-of select="$python.tab"/>
 
612
      <xsl:value-of select="$db2html.classsynopsis.tab"/>
612
613
    </xsl:if>
613
614
  </xsl:variable>
614
615
  <xsl:for-each select="modifier | db:modifier">