~ubuntu-branches/ubuntu/wily/libjboss-remoting-java/wily

« back to all changes in this revision

Viewing changes to docs/guide/support/support/docbook-xsl/html/formal.xsl

  • Committer: Package Import Robot
  • Author(s): Torsten Werner
  • Date: 2011-09-09 14:01:03 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: package-import@ubuntu.com-20110909140103-hqokx61534tas9rg
Tags: 2.5.3.SP1-1
* Newer but not newest upstream release. Do not build samples.
* Change debian/watch to upstream's svn repo.
* Add patch to fix compile error caused by tomcat update.
  (Closes: #628303)
* Switch to source format 3.0.
* Switch to debhelper level 7.
* Remove useless Depends.
* Update Standards-Version: 3.9.2.
* Update README.source.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version='1.0'?>
 
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 
3
                version='1.0'>
 
4
 
 
5
<!-- ********************************************************************
 
6
     $Id: formal.xsl 1341 2006-08-02 16:35:13Z telrod $
 
7
     ********************************************************************
 
8
 
 
9
     This file is part of the XSL DocBook Stylesheet distribution.
 
10
     See ../README or http://nwalsh.com/docbook/xsl/ for copyright
 
11
     and other information.
 
12
 
 
13
     ******************************************************************** -->
 
14
 
 
15
<xsl:template name="formal.object">
 
16
  <xsl:param name="placement" select="'before'"/>
 
17
  <xsl:param name="class" select="local-name(.)"/>
 
18
 
 
19
  <div class="{$class}">
 
20
    <xsl:call-template name="anchor">
 
21
      <xsl:with-param name="conditional" select="0"/>
 
22
    </xsl:call-template>
 
23
 
 
24
    <xsl:choose>
 
25
      <xsl:when test="$placement = 'before'">
 
26
        <xsl:call-template name="formal.object.heading"/>
 
27
        <xsl:apply-templates/>
 
28
 
 
29
        <!-- HACK: This doesn't belong inside formal.object; it should be done by -->
 
30
        <!-- the table template, but I want the link to be inside the DIV, so... -->
 
31
        <xsl:if test="local-name(.) = 'table'">
 
32
          <xsl:call-template name="table.longdesc"/>
 
33
        </xsl:if>
 
34
 
 
35
        <xsl:if test="$spacing.paras != 0"><p/></xsl:if>
 
36
      </xsl:when>
 
37
      <xsl:otherwise>
 
38
        <xsl:if test="$spacing.paras != 0"><p/></xsl:if>
 
39
        <xsl:apply-templates/>
 
40
 
 
41
        <!-- HACK: This doesn't belong inside formal.object; it should be done by -->
 
42
        <!-- the table template, but I want the link to be inside the DIV, so... -->
 
43
        <xsl:if test="local-name(.) = 'table'">
 
44
          <xsl:call-template name="table.longdesc"/>
 
45
        </xsl:if>
 
46
 
 
47
        <xsl:call-template name="formal.object.heading"/>
 
48
      </xsl:otherwise>
 
49
    </xsl:choose>
 
50
  </div>
 
51
</xsl:template>
 
52
 
 
53
<xsl:template name="formal.object.heading">
 
54
  <xsl:param name="object" select="."/>
 
55
  <p class="title">
 
56
    <b>
 
57
      <xsl:apply-templates select="$object" mode="object.title.markup">
 
58
        <xsl:with-param name="allow-anchors" select="1"/>
 
59
      </xsl:apply-templates>
 
60
    </b>
 
61
  </p>
 
62
</xsl:template>
 
63
 
 
64
<xsl:template name="informal.object">
 
65
  <xsl:param name="class" select="local-name(.)"/>
 
66
 
 
67
  <div class="{$class}">
 
68
    <xsl:if test="$spacing.paras != 0"><p/></xsl:if>
 
69
    <xsl:call-template name="anchor"/>
 
70
    <xsl:apply-templates/>
 
71
 
 
72
    <!-- HACK: This doesn't belong inside formal.object; it should be done by -->
 
73
    <!-- the table template, but I want the link to be inside the DIV, so... -->
 
74
    <xsl:if test="local-name(.) = 'informaltable'">
 
75
      <xsl:call-template name="table.longdesc"/>
 
76
    </xsl:if>
 
77
 
 
78
    <xsl:if test="$spacing.paras != 0"><p/></xsl:if>
 
79
  </div>
 
80
</xsl:template>
 
81
 
 
82
<xsl:template name="semiformal.object">
 
83
  <xsl:param name="placement" select="'before'"/>
 
84
  <xsl:param name="class" select="local-name(.)"/>
 
85
 
 
86
  <xsl:choose>
 
87
    <xsl:when test="title">
 
88
      <xsl:call-template name="formal.object">
 
89
        <xsl:with-param name="placement" select="$placement"/>
 
90
        <xsl:with-param name="class" select="$class"/>
 
91
      </xsl:call-template>
 
92
    </xsl:when>
 
93
    <xsl:otherwise>
 
94
      <xsl:call-template name="informal.object">
 
95
        <xsl:with-param name="class" select="$class"/>
 
96
      </xsl:call-template>
 
97
    </xsl:otherwise>
 
98
  </xsl:choose>
 
99
</xsl:template>
 
100
 
 
101
<xsl:template match="figure">
 
102
  <xsl:variable name="param.placement"
 
103
                select="substring-after(normalize-space($formal.title.placement),
 
104
                                        concat(local-name(.), ' '))"/>
 
105
 
 
106
  <xsl:variable name="placement">
 
107
    <xsl:choose>
 
108
      <xsl:when test="contains($param.placement, ' ')">
 
109
        <xsl:value-of select="substring-before($param.placement, ' ')"/>
 
110
      </xsl:when>
 
111
      <xsl:when test="$param.placement = ''">before</xsl:when>
 
112
      <xsl:otherwise>
 
113
        <xsl:value-of select="$param.placement"/>
 
114
      </xsl:otherwise>
 
115
    </xsl:choose>
 
116
  </xsl:variable>
 
117
 
 
118
  <xsl:choose>
 
119
    <xsl:when test="@float and @float != 0">
 
120
      <xsl:variable name="float">
 
121
        <xsl:choose>
 
122
          <xsl:when test="@float = 1">
 
123
            <xsl:value-of select="$default.float.class"/>
 
124
          </xsl:when>
 
125
          <xsl:otherwise>
 
126
            <xsl:value-of select="@float"/>
 
127
          </xsl:otherwise>
 
128
        </xsl:choose>
 
129
      </xsl:variable>
 
130
 
 
131
      <div class="figure-float">
 
132
        <xsl:if test="$float = 'left' or $float = 'right'">
 
133
          <xsl:attribute name="style">
 
134
            <xsl:text>float: </xsl:text>
 
135
            <xsl:value-of select="$float"/>
 
136
            <xsl:text>;</xsl:text>
 
137
          </xsl:attribute>
 
138
        </xsl:if>
 
139
        <xsl:call-template name="formal.object">
 
140
          <xsl:with-param name="placement" select="$placement"/>
 
141
        </xsl:call-template>
 
142
      </div>
 
143
    </xsl:when>
 
144
    <xsl:otherwise>
 
145
      <xsl:call-template name="formal.object">
 
146
        <xsl:with-param name="placement" select="$placement"/>
 
147
      </xsl:call-template>
 
148
    </xsl:otherwise>
 
149
  </xsl:choose>
 
150
</xsl:template>
 
151
 
 
152
<xsl:template match="table">
 
153
  <xsl:choose>
 
154
    <xsl:when test="tgroup|mediaobject|graphic">
 
155
      <xsl:call-template name="calsTable"/>
 
156
    </xsl:when>
 
157
    <xsl:otherwise>
 
158
      <xsl:copy>
 
159
        <xsl:copy-of select="@*"/>
 
160
        <xsl:call-template name="htmlTable"/>
 
161
      </xsl:copy>
 
162
    </xsl:otherwise>
 
163
  </xsl:choose>
 
164
</xsl:template>
 
165
 
 
166
<xsl:template name="calsTable">
 
167
  <xsl:if test="tgroup/tbody/tr
 
168
                |tgroup/thead/tr
 
169
                |tgroup/tfoot/tr">
 
170
    <xsl:message terminate="yes">Broken table: tr descendent of CALS Table.</xsl:message>
 
171
  </xsl:if>
 
172
 
 
173
  <xsl:variable name="param.placement"
 
174
                select="substring-after(normalize-space($formal.title.placement),
 
175
                                        concat(local-name(.), ' '))"/>
 
176
 
 
177
  <xsl:variable name="placement">
 
178
    <xsl:choose>
 
179
      <xsl:when test="contains($param.placement, ' ')">
 
180
        <xsl:value-of select="substring-before($param.placement, ' ')"/>
 
181
      </xsl:when>
 
182
      <xsl:when test="$param.placement = ''">before</xsl:when>
 
183
      <xsl:otherwise>
 
184
        <xsl:value-of select="$param.placement"/>
 
185
      </xsl:otherwise>
 
186
    </xsl:choose>
 
187
  </xsl:variable>
 
188
 
 
189
  <xsl:call-template name="formal.object">
 
190
    <xsl:with-param name="placement" select="$placement"/>
 
191
    <xsl:with-param name="class">
 
192
      <xsl:choose>
 
193
        <xsl:when test="@tabstyle">
 
194
          <!-- hack, this will only ever occur on table, not example -->
 
195
          <xsl:value-of select="@tabstyle"/>
 
196
        </xsl:when>
 
197
        <xsl:otherwise>
 
198
          <xsl:value-of select="local-name(.)"/>
 
199
        </xsl:otherwise>
 
200
      </xsl:choose>
 
201
    </xsl:with-param>
 
202
  </xsl:call-template>
 
203
</xsl:template>
 
204
 
 
205
<xsl:template name="htmlTable">
 
206
  <xsl:if test="tgroup/tbody/row
 
207
                |tgroup/thead/row
 
208
                |tgroup/tfoot/row">
 
209
    <xsl:message terminate="yes">Broken table: row descendent of HTML table.</xsl:message>
 
210
  </xsl:if>
 
211
 
 
212
  <xsl:apply-templates mode="htmlTable"/>
 
213
</xsl:template>
 
214
 
 
215
<xsl:template match="example">
 
216
  <xsl:variable name="param.placement"
 
217
                select="substring-after(normalize-space($formal.title.placement),
 
218
                                        concat(local-name(.), ' '))"/>
 
219
 
 
220
  <xsl:variable name="placement">
 
221
    <xsl:choose>
 
222
      <xsl:when test="contains($param.placement, ' ')">
 
223
        <xsl:value-of select="substring-before($param.placement, ' ')"/>
 
224
      </xsl:when>
 
225
      <xsl:when test="$param.placement = ''">before</xsl:when>
 
226
      <xsl:otherwise>
 
227
        <xsl:value-of select="$param.placement"/>
 
228
      </xsl:otherwise>
 
229
    </xsl:choose>
 
230
  </xsl:variable>
 
231
 
 
232
  <xsl:call-template name="formal.object">
 
233
    <xsl:with-param name="placement" select="$placement"/>
 
234
    <xsl:with-param name="class" select="local-name(.)"/>
 
235
  </xsl:call-template>
 
236
</xsl:template>
 
237
 
 
238
<xsl:template match="equation">
 
239
  <xsl:variable name="param.placement"
 
240
                select="substring-after(normalize-space($formal.title.placement),
 
241
                                        concat(local-name(.), ' '))"/>
 
242
 
 
243
  <xsl:variable name="placement">
 
244
    <xsl:choose>
 
245
      <xsl:when test="contains($param.placement, ' ')">
 
246
        <xsl:value-of select="substring-before($param.placement, ' ')"/>
 
247
      </xsl:when>
 
248
      <xsl:when test="$param.placement = ''">before</xsl:when>
 
249
      <xsl:otherwise>
 
250
        <xsl:value-of select="$param.placement"/>
 
251
      </xsl:otherwise>
 
252
    </xsl:choose>
 
253
  </xsl:variable>
 
254
 
 
255
  <xsl:call-template name="semiformal.object">
 
256
    <xsl:with-param name="placement" select="$placement"/>
 
257
  </xsl:call-template>
 
258
</xsl:template>
 
259
 
 
260
<xsl:template match="figure/title"></xsl:template>
 
261
<xsl:template match="figure/titleabbrev"></xsl:template>
 
262
<xsl:template match="table/title"></xsl:template>
 
263
<xsl:template match="table/titleabbrev"></xsl:template>
 
264
<xsl:template match="table/textobject"></xsl:template>
 
265
<xsl:template match="example/title"></xsl:template>
 
266
<xsl:template match="example/titleabbrev"></xsl:template>
 
267
<xsl:template match="equation/title"></xsl:template>
 
268
<xsl:template match="equation/titleabbrev"></xsl:template>
 
269
 
 
270
<xsl:template match="informalfigure">
 
271
  <xsl:call-template name="informal.object"/>
 
272
</xsl:template>
 
273
 
 
274
<xsl:template match="informalexample">
 
275
  <xsl:call-template name="informal.object"/>
 
276
</xsl:template>
 
277
 
 
278
<xsl:template match="informaltable">
 
279
  <xsl:choose>
 
280
    <xsl:when test="tgroup|mediaobject|graphic">
 
281
      <xsl:call-template name="informal.object">
 
282
        <xsl:with-param name="class">
 
283
          <xsl:choose>
 
284
            <xsl:when test="@tabstyle">
 
285
              <xsl:value-of select="@tabstyle"/>
 
286
            </xsl:when>
 
287
            <xsl:otherwise>
 
288
              <xsl:value-of select="local-name(.)"/>
 
289
            </xsl:otherwise>
 
290
          </xsl:choose>
 
291
        </xsl:with-param>
 
292
      </xsl:call-template>
 
293
    </xsl:when>
 
294
    <xsl:otherwise>
 
295
      <table>
 
296
        <xsl:copy-of select="@*"/>
 
297
        <xsl:call-template name="htmlTable"/>
 
298
      </table>
 
299
    </xsl:otherwise>
 
300
  </xsl:choose>
 
301
</xsl:template>
 
302
 
 
303
<xsl:template match="informaltable/textobject"></xsl:template>
 
304
 
 
305
<xsl:template name="table.longdesc">
 
306
  <!-- HACK: This doesn't belong inside formal.objectt; it should be done by -->
 
307
  <!-- the table template, but I want the link to be inside the DIV, so... -->
 
308
  <xsl:variable name="longdesc.uri">
 
309
    <xsl:call-template name="longdesc.uri">
 
310
      <xsl:with-param name="mediaobject" select="."/>
 
311
    </xsl:call-template>
 
312
  </xsl:variable>
 
313
 
 
314
  <xsl:variable name="irrelevant">
 
315
    <!-- write.longdesc returns the filename ... -->
 
316
    <xsl:call-template name="write.longdesc">
 
317
      <xsl:with-param name="mediaobject" select="."/>
 
318
    </xsl:call-template>
 
319
  </xsl:variable>
 
320
 
 
321
  <xsl:if test="$html.longdesc != 0 and $html.longdesc.link != 0
 
322
                and textobject[not(phrase)]">
 
323
    <xsl:call-template name="longdesc.link">
 
324
      <xsl:with-param name="longdesc.uri" select="$longdesc.uri"/>
 
325
    </xsl:call-template>
 
326
  </xsl:if>
 
327
</xsl:template>
 
328
 
 
329
<xsl:template match="informalequation">
 
330
  <xsl:call-template name="informal.object"/>
 
331
</xsl:template>
 
332
 
 
333
</xsl:stylesheet>