metanorma-cc 1.6.6 → 1.6.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,7 @@ module IsoDoc
13
13
  end
14
14
 
15
15
  def pdf_stylesheet(docxml)
16
- "csd.standard.xsl"
16
+ "cc.standard.xsl"
17
17
  end
18
18
  end
19
19
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
3
- VERSION = "1.6.6"
3
+ VERSION = "1.6.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.6
4
+ version: 1.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-08 00:00:00.000000000 Z
11
+ date: 2021-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -200,7 +200,7 @@ files:
200
200
  - lib/asciidoctor/cc/reqt.rng
201
201
  - lib/asciidoctor/cc/validate_section.rb
202
202
  - lib/isodoc/cc/base_convert.rb
203
- - lib/isodoc/cc/csd.standard.xsl
203
+ - lib/isodoc/cc/cc.standard.xsl
204
204
  - lib/isodoc/cc/html/_coverpage.css
205
205
  - lib/isodoc/cc/html/_coverpage.scss
206
206
  - lib/isodoc/cc/html/cc.css
@@ -1,4576 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:csd="https://www.metanorma.org/ns/csd" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:java="http://xml.apache.org/xalan/java" exclude-result-prefixes="java" version="1.0">
2
-
3
- <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
4
-
5
- <xsl:param name="svg_images"/>
6
- <xsl:variable name="images" select="document($svg_images)"/>
7
-
8
- <xsl:variable name="pageWidth" select="'210mm'"/>
9
- <xsl:variable name="pageHeight" select="'297mm'"/>
10
-
11
-
12
-
13
- <xsl:variable name="debug">false</xsl:variable>
14
-
15
- <xsl:variable name="copyright">
16
- <xsl:text>© The Calendaring and Scheduling Consortium, Inc. </xsl:text>
17
- <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:copyright/csd:from"/>
18
- <xsl:text> – All rights reserved</xsl:text>
19
- </xsl:variable>
20
-
21
- <xsl:variable name="header">
22
- <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:docidentifier[@type = 'csd']"/>
23
- <xsl:text>:</xsl:text>
24
- <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:copyright/csd:from"/>
25
- </xsl:variable>
26
-
27
- <xsl:variable name="contents">
28
- <contents>
29
- <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
30
- <xsl:call-template name="processMainSectionsDefault_Contents"/>
31
- </contents>
32
- </xsl:variable>
33
-
34
- <xsl:variable name="lang">
35
- <xsl:call-template name="getLang"/>
36
- </xsl:variable>
37
-
38
- <xsl:template match="/">
39
- <xsl:call-template name="namespaceCheck"/>
40
- <fo:root font-family="Source Sans Pro, STIX Two Math, Source Han Sans" font-size="10.5pt" xml:lang="{$lang}">
41
- <fo:layout-master-set>
42
- <!-- Cover page -->
43
- <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
44
- <fo:region-body margin-top="23.5mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
45
- <fo:region-before region-name="cover-page-header" extent="23.5mm"/>
46
- <fo:region-after extent="10mm"/>
47
- <fo:region-start extent="19mm"/>
48
- <fo:region-end extent="19mm"/>
49
- </fo:simple-page-master>
50
-
51
- <!-- Document pages -->
52
-
53
- <!-- Preface odd pages -->
54
- <fo:simple-page-master master-name="odd-preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
55
- <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
56
- <fo:region-before region-name="header-odd" extent="17mm"/>
57
- <fo:region-after region-name="footer-odd" extent="10mm"/>
58
- <fo:region-start region-name="left-region" extent="19mm"/>
59
- <fo:region-end region-name="right-region" extent="19mm"/>
60
- </fo:simple-page-master>
61
- <!-- Preface even pages -->
62
- <fo:simple-page-master master-name="even-preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
63
- <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
64
- <fo:region-before region-name="header-even" extent="17mm"/>
65
- <fo:region-after region-name="footer-even" extent="10mm"/>
66
- <fo:region-start region-name="left-region" extent="19mm"/>
67
- <fo:region-end region-name="right-region" extent="19mm"/>
68
- </fo:simple-page-master>
69
- <fo:simple-page-master master-name="blankpage" page-width="{$pageWidth}" page-height="{$pageHeight}">
70
- <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
71
- <fo:region-before region-name="header" extent="17mm"/>
72
- <fo:region-after region-name="footer" extent="10mm"/>
73
- <fo:region-start region-name="left" extent="19mm"/>
74
- <fo:region-end region-name="right" extent="19mm"/>
75
- </fo:simple-page-master>
76
- <fo:page-sequence-master master-name="preface">
77
- <fo:repeatable-page-master-alternatives>
78
- <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
79
- <fo:conditional-page-master-reference odd-or-even="even" master-reference="even-preface"/>
80
- <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd-preface"/>
81
- </fo:repeatable-page-master-alternatives>
82
- </fo:page-sequence-master>
83
-
84
- <!-- Document odd pages -->
85
- <fo:simple-page-master master-name="odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
86
- <fo:region-body margin-top="20.2mm" margin-bottom="20.3mm" margin-left="19mm" margin-right="19mm"/>
87
- <fo:region-before region-name="header-odd" extent="20.2mm"/>
88
- <fo:region-after region-name="footer-odd" extent="20.3mm"/>
89
- <fo:region-start region-name="left-region" extent="19mm"/>
90
- <fo:region-end region-name="right-region" extent="19mm"/>
91
- </fo:simple-page-master>
92
- <!-- Preface even pages -->
93
- <fo:simple-page-master master-name="even" page-width="{$pageWidth}" page-height="{$pageHeight}">
94
- <fo:region-body margin-top="20.2mm" margin-bottom="20.3mm" margin-left="19mm" margin-right="19mm"/>
95
- <fo:region-before region-name="header-even" extent="20.2mm"/>
96
- <fo:region-after region-name="footer-even" extent="20.3mm"/>
97
- <fo:region-start region-name="left-region" extent="19mm"/>
98
- <fo:region-end region-name="right-region" extent="19mm"/>
99
- </fo:simple-page-master>
100
- <fo:page-sequence-master master-name="document">
101
- <fo:repeatable-page-master-alternatives>
102
- <fo:conditional-page-master-reference master-reference="blankpage" blank-or-not-blank="blank"/>
103
- <fo:conditional-page-master-reference odd-or-even="even" master-reference="even"/>
104
- <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd"/>
105
- </fo:repeatable-page-master-alternatives>
106
- </fo:page-sequence-master>
107
-
108
- </fo:layout-master-set>
109
-
110
- <xsl:call-template name="addPDFUAmeta"/>
111
-
112
- <xsl:call-template name="addBookmarks">
113
- <xsl:with-param name="contents" select="$contents"/>
114
- </xsl:call-template>
115
-
116
- <!-- Cover Page -->
117
- <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
118
- <fo:static-content flow-name="xsl-footnote-separator">
119
- <fo:block>
120
- <fo:leader leader-pattern="rule" leader-length="30%"/>
121
- </fo:block>
122
- </fo:static-content>
123
- <fo:static-content flow-name="cover-page-header" font-size="10pt">
124
- <fo:block-container height="23.5mm" display-align="before">
125
- <fo:block padding-top="12.5mm">
126
- <xsl:value-of select="$copyright"/>
127
- </fo:block>
128
- </fo:block-container>
129
- </fo:static-content>
130
-
131
- <fo:flow flow-name="xsl-region-body">
132
-
133
- <fo:block text-align="right">
134
- <!-- CC/FDS 18011:2018 -->
135
- <fo:block font-size="14pt" font-weight="bold" margin-bottom="10pt">
136
- <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:docidentifier[@type = 'csd']"/><xsl:text> </xsl:text>
137
- </fo:block>
138
- <fo:block margin-bottom="12pt">
139
- <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:copyright/csd:owner/csd:organization/csd:name"/>
140
- <xsl:text> TC </xsl:text>
141
- <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:ext/csd:editorialgroup/csd:technical-committee"/>
142
- <xsl:text> </xsl:text>
143
- </fo:block>
144
- </fo:block>
145
- <fo:block font-size="24pt" font-weight="bold" text-align="center">
146
- <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:title[@language = 'en']"/>
147
- <xsl:value-of select="$linebreak"/>
148
- </fo:block>
149
- <fo:block> </fo:block>
150
- <fo:block margin-bottom="12pt"> </fo:block>
151
- <fo:block-container font-size="16pt" text-align="center" border="0.5pt solid black" margin-bottom="12pt" margin-left="-1mm" margin-right="-1mm">
152
- <fo:block-container margin-left="0mm" margin-right="0mm">
153
- <fo:block padding-top="1mm">
154
- <xsl:call-template name="capitalizeWords">
155
- <!-- ex: final-draft -->
156
- <xsl:with-param name="str" select="/csd:csd-standard/csd:bibdata/csd:status/csd:stage"/>
157
- </xsl:call-template>
158
- <xsl:text> </xsl:text>
159
- <xsl:call-template name="capitalizeWords">
160
- <!-- ex: standard -->
161
- <xsl:with-param name="str" select="/csd:csd-standard/csd:bibdata/csd:ext/csd:doctype"/>
162
- </xsl:call-template>
163
- </fo:block>
164
- </fo:block-container>
165
- </fo:block-container>
166
- <fo:block margin-bottom="10pt"> </fo:block>
167
- <fo:block-container font-size="10pt" border="0.5pt solid black" margin-bottom="12pt" margin-left="-1mm" margin-right="-1mm">
168
- <fo:block-container margin-left="0mm" margin-right="0mm">
169
- <fo:block text-align="center" font-weight="bold" padding-top="1mm" margin-bottom="6pt">Warning for drafts</fo:block>
170
- <fo:block margin-left="2mm" margin-right="2mm">
171
- <fo:block margin-bottom="6pt">This document is not a CalConnect Standard. It is distributed for review and comment, and is subject to change without notice and may not be referred to as a Standard. Recipients of this draft are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.</fo:block>
172
- <fo:block margin-bottom="10pt">Recipients of this draft are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.</fo:block>
173
- </fo:block>
174
- </fo:block-container>
175
- </fo:block-container>
176
- <fo:block text-align="center">
177
- <xsl:text>The Calendaring and Scheduling Consortium, Inc.  </xsl:text>
178
- <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:copyright/csd:from"/>
179
- </fo:block>
180
- </fo:flow>
181
- </fo:page-sequence>
182
- <!-- End Cover Page -->
183
-
184
-
185
- <!-- Copyright, Content, Foreword, etc. pages -->
186
- <fo:page-sequence master-reference="preface" initial-page-number="2" format="i" force-page-count="end-on-even">
187
- <fo:static-content flow-name="xsl-footnote-separator">
188
- <fo:block>
189
- <fo:leader leader-pattern="rule" leader-length="30%"/>
190
- </fo:block>
191
- </fo:static-content>
192
- <xsl:call-template name="insertHeaderFooter"/>
193
- <fo:flow flow-name="xsl-region-body">
194
-
195
- <xsl:if test="$debug = 'true'">
196
- <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
197
- DEBUG
198
- contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
199
- <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
200
- </xsl:if>
201
-
202
- <fo:block margin-bottom="15pt"> </fo:block>
203
- <fo:block margin-bottom="14pt">
204
- <xsl:text>© </xsl:text>
205
- <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:copyright/csd:from"/>
206
- <xsl:text> </xsl:text>
207
- <fo:inline>
208
- <xsl:apply-templates select="/csd:csd-standard/csd:boilerplate/csd:feedback-statement/csd:clause/csd:p[@id = 'boilerplate-name']"/>
209
- </fo:inline>
210
- </fo:block>
211
- <fo:block margin-bottom="12pt">
212
- <xsl:apply-templates select="/csd:csd-standard/csd:boilerplate/csd:legal-statement"/>
213
- </fo:block>
214
- <fo:block margin-bottom="12pt">
215
- <xsl:apply-templates select="/csd:csd-standard/csd:boilerplate/csd:feedback-statement/csd:clause/csd:p[@id = 'boilerplate-name']"/>
216
- </fo:block>
217
- <fo:block>
218
- <xsl:apply-templates select="/csd:csd-standard/csd:boilerplate/csd:feedback-statement/csd:clause/csd:p[@id = 'boilerplate-address']"/>
219
- </fo:block>
220
-
221
- <fo:block break-after="page"/>
222
-
223
- <fo:block-container font-weight="bold" line-height="115%">
224
- <xsl:variable name="title-toc">
225
- <xsl:call-template name="getTitle">
226
- <xsl:with-param name="name" select="'title-toc'"/>
227
- </xsl:call-template>
228
- </xsl:variable>
229
- <fo:block font-size="14pt" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
230
-
231
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
232
-
233
- <fo:block>
234
- <xsl:if test="@level = 1">
235
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
236
- </xsl:if>
237
-
238
-
239
- <fo:list-block>
240
- <xsl:attribute name="provisional-distance-between-starts">
241
- <xsl:choose>
242
- <!-- skip 0 section without subsections -->
243
- <xsl:when test="@section != ''">8mm</xsl:when> <!-- and not(@display-section = 'false') -->
244
- <xsl:otherwise>0mm</xsl:otherwise>
245
- </xsl:choose>
246
- </xsl:attribute>
247
- <fo:list-item>
248
- <fo:list-item-label end-indent="label-end()">
249
- <fo:block>
250
- <xsl:value-of select="@section"/>
251
- </fo:block>
252
- </fo:list-item-label>
253
- <fo:list-item-body start-indent="body-start()">
254
- <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
255
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
256
- <xsl:apply-templates select="title"/>
257
- <fo:inline keep-together.within-line="always">
258
- <fo:leader leader-pattern="dots"/>
259
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
260
- </fo:inline>
261
- </fo:basic-link>
262
- </fo:block>
263
- </fo:list-item-body>
264
- </fo:list-item>
265
- </fo:list-block>
266
- </fo:block>
267
- </xsl:for-each>
268
- </fo:block-container>
269
-
270
- <!-- Foreword, Introduction -->
271
- <xsl:call-template name="processPrefaceSectionsDefault"/>
272
-
273
- </fo:flow>
274
- </fo:page-sequence>
275
-
276
-
277
- <!-- Document Pages -->
278
- <fo:page-sequence master-reference="document" initial-page-number="1" format="1" force-page-count="no-force">
279
- <fo:static-content flow-name="xsl-footnote-separator">
280
- <fo:block>
281
- <fo:leader leader-pattern="rule" leader-length="30%"/>
282
- </fo:block>
283
- </fo:static-content>
284
- <xsl:call-template name="insertHeaderFooter"/>
285
- <fo:flow flow-name="xsl-region-body">
286
- <fo:block font-size="16pt" font-weight="bold" margin-bottom="17pt">
287
- <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:title[@language = 'en']"/>
288
- </fo:block>
289
- <fo:block>
290
- <xsl:call-template name="processMainSectionsDefault"/>
291
- </fo:block>
292
- </fo:flow>
293
- </fo:page-sequence>
294
-
295
- <!-- End Document Pages -->
296
-
297
- </fo:root>
298
- </xsl:template>
299
-
300
- <xsl:template match="node()">
301
- <xsl:apply-templates/>
302
- </xsl:template>
303
-
304
- <!-- ============================= -->
305
- <!-- CONTENTS -->
306
- <!-- ============================= -->
307
- <xsl:template match="node()" mode="contents">
308
- <xsl:apply-templates mode="contents"/>
309
- </xsl:template>
310
-
311
- <!-- element with title -->
312
- <xsl:template match="*[csd:title]" mode="contents">
313
- <xsl:variable name="level">
314
- <xsl:call-template name="getLevel">
315
- <xsl:with-param name="depth" select="csd:title/@depth"/>
316
- </xsl:call-template>
317
- </xsl:variable>
318
-
319
- <xsl:variable name="display">
320
- <xsl:choose>
321
- <xsl:when test="$level &gt; 2">false</xsl:when>
322
- <xsl:otherwise>true</xsl:otherwise>
323
- </xsl:choose>
324
- </xsl:variable>
325
-
326
- <xsl:variable name="skip">
327
- <xsl:choose>
328
- <xsl:when test="ancestor-or-self::csd:bibitem">true</xsl:when>
329
- <xsl:when test="ancestor-or-self::csd:term">true</xsl:when>
330
- <xsl:otherwise>false</xsl:otherwise>
331
- </xsl:choose>
332
- </xsl:variable>
333
-
334
- <xsl:if test="$skip = 'false'">
335
-
336
- <xsl:variable name="section">
337
- <xsl:call-template name="getSection"/>
338
- </xsl:variable>
339
-
340
- <xsl:variable name="title">
341
- <xsl:call-template name="getName"/>
342
- </xsl:variable>
343
-
344
- <item id="{@id}" level="{$level}" section="{$section}" display="{$display}">
345
- <title>
346
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
347
- </title>
348
- <xsl:apply-templates mode="contents"/>
349
- </item>
350
- </xsl:if>
351
-
352
- </xsl:template>
353
-
354
-
355
- <!-- ============================= -->
356
- <!-- ============================= -->
357
-
358
-
359
- <xsl:template match="csd:license-statement//csd:title">
360
- <fo:block text-align="center" font-weight="bold">
361
- <xsl:apply-templates/>
362
- </fo:block>
363
- </xsl:template>
364
-
365
- <xsl:template match="csd:license-statement//csd:p">
366
- <fo:block margin-left="1.5mm" margin-right="1.5mm">
367
- <xsl:if test="following-sibling::csd:p">
368
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
369
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
370
- </xsl:if>
371
- <xsl:apply-templates/>
372
- </fo:block>
373
- </xsl:template>
374
-
375
- <!-- <fo:block margin-bottom="12pt">© ISO 2019, Published in Switzerland.</fo:block>
376
- <fo:block font-size="10pt" margin-bottom="12pt">All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below or ISO’s member body in the country of the requester.</fo:block>
377
- <fo:block font-size="10pt" text-indent="7.1mm">
378
- <fo:block>ISO copyright office</fo:block>
379
- <fo:block>Ch. de Blandonnet 8 • CP 401</fo:block>
380
- <fo:block>CH-1214 Vernier, Geneva, Switzerland</fo:block>
381
- <fo:block>Tel. + 41 22 749 01 11</fo:block>
382
- <fo:block>Fax + 41 22 749 09 47</fo:block>
383
- <fo:block>copyright@iso.org</fo:block>
384
- <fo:block>www.iso.org</fo:block>
385
- </fo:block> -->
386
-
387
- <xsl:template match="csd:copyright-statement//csd:p">
388
- <fo:block>
389
- <xsl:if test="preceding-sibling::csd:p">
390
- <!-- <xsl:attribute name="font-size">10pt</xsl:attribute> -->
391
- </xsl:if>
392
- <xsl:if test="following-sibling::csd:p">
393
- <!-- <xsl:attribute name="margin-bottom">12pt</xsl:attribute> -->
394
- <xsl:attribute name="margin-bottom">3pt</xsl:attribute>
395
- </xsl:if>
396
- <xsl:if test="not(following-sibling::csd:p)">
397
- <!-- <xsl:attribute name="margin-left">7.1mm</xsl:attribute> -->
398
- <xsl:attribute name="margin-left">4mm</xsl:attribute>
399
- </xsl:if>
400
- <xsl:apply-templates/>
401
- </fo:block>
402
- </xsl:template>
403
-
404
-
405
-
406
- <xsl:template match="csd:title">
407
-
408
- <xsl:variable name="level">
409
- <xsl:call-template name="getLevel"/>
410
- </xsl:variable>
411
-
412
- <xsl:variable name="font-size">
413
- <xsl:choose>
414
- <xsl:when test="ancestor::csd:preface">13pt</xsl:when>
415
- <xsl:when test="$level = 1">13pt</xsl:when>
416
- <xsl:when test="$level = 2">12pt</xsl:when>
417
- <xsl:when test="$level &gt;= 3">11pt</xsl:when>
418
- <xsl:otherwise>16pt</xsl:otherwise>
419
- </xsl:choose>
420
- </xsl:variable>
421
-
422
- <xsl:variable name="element-name">
423
- <xsl:choose>
424
- <xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when>
425
- <xsl:otherwise>fo:block</xsl:otherwise>
426
- </xsl:choose>
427
- </xsl:variable>
428
-
429
- <xsl:variable name="color" select="'rgb(14, 26, 133)'"/>
430
-
431
- <xsl:element name="{$element-name}">
432
- <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
433
- <xsl:attribute name="font-weight">bold</xsl:attribute>
434
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
435
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
436
- <xsl:attribute name="color"><xsl:value-of select="$color"/></xsl:attribute>
437
- <xsl:if test="ancestor::csd:sections">
438
- <xsl:attribute name="margin-top">13.5pt</xsl:attribute>
439
- </xsl:if>
440
- <xsl:apply-templates/>
441
- </xsl:element>
442
- </xsl:template>
443
-
444
-
445
- <xsl:template match="csd:p">
446
- <xsl:param name="inline" select="'false'"/>
447
- <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/>
448
- <xsl:variable name="element-name">
449
- <xsl:choose>
450
- <xsl:when test="$inline = 'true'">fo:inline</xsl:when>
451
- <xsl:when test="../@inline-header = 'true' and $previous-element = 'title'">fo:inline</xsl:when> <!-- first paragraph after inline title -->
452
- <xsl:when test="local-name(..) = 'admonition'">fo:inline</xsl:when>
453
- <xsl:when test="@id = 'boilerplate-name'">fo:inline</xsl:when>
454
- <xsl:otherwise>fo:block</xsl:otherwise>
455
- </xsl:choose>
456
- </xsl:variable>
457
- <xsl:element name="{$element-name}">
458
- <xsl:attribute name="text-align">
459
- <xsl:choose>
460
- <!-- <xsl:when test="ancestor::csd:preface">justify</xsl:when> -->
461
- <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
462
- <xsl:otherwise>left</xsl:otherwise><!-- justify -->
463
- </xsl:choose>
464
- </xsl:attribute>
465
- <xsl:attribute name="margin-bottom">
466
- <xsl:choose>
467
- <xsl:when test="ancestor::csd:li">0pt</xsl:when>
468
- <xsl:otherwise>12pt</xsl:otherwise>
469
- </xsl:choose>
470
- </xsl:attribute>
471
- <xsl:attribute name="line-height">115%</xsl:attribute>
472
- <xsl:apply-templates/>
473
- </xsl:element>
474
- <xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')">
475
- <fo:block margin-bottom="12pt">
476
- <xsl:if test="ancestor::csd:annex">
477
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
478
- </xsl:if>
479
- <xsl:value-of select="$linebreak"/>
480
- </fo:block>
481
- </xsl:if>
482
- <xsl:if test="$inline = 'true'">
483
- <fo:block> </fo:block>
484
- </xsl:if>
485
- </xsl:template>
486
-
487
- <!--
488
- <fn reference="1">
489
- <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
490
- </fn>
491
- -->
492
- <xsl:template match="csd:p/csd:fn">
493
- <fo:footnote>
494
- <xsl:variable name="number">
495
- <xsl:number level="any" count="csd:p/csd:fn"/>
496
- </xsl:variable>
497
- <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super">
498
- <fo:basic-link internal-destination="footnote_{@reference}" fox:alt-text="footnote {@reference}">
499
- <!-- <xsl:value-of select="@reference"/> -->
500
- <xsl:value-of select="$number + count(//csd:bibitem/csd:note)"/><!-- <xsl:text>)</xsl:text> -->
501
- </fo:basic-link>
502
- </fo:inline>
503
- <fo:footnote-body>
504
- <fo:block font-size="10pt" margin-bottom="12pt">
505
- <fo:inline id="footnote_{@reference}" keep-with-next.within-line="always" font-size="60%" vertical-align="super"> <!-- baseline-shift="30%" padding-right="3mm" font-size="60%" alignment-baseline="hanging" -->
506
- <xsl:value-of select="$number + count(//csd:bibitem/csd:note)"/><!-- <xsl:text>)</xsl:text> -->
507
- </fo:inline>
508
- <xsl:for-each select="csd:p">
509
- <xsl:apply-templates/>
510
- </xsl:for-each>
511
- </fo:block>
512
- </fo:footnote-body>
513
- </fo:footnote>
514
- </xsl:template>
515
-
516
- <xsl:template match="csd:p/csd:fn/csd:p">
517
- <xsl:apply-templates/>
518
- </xsl:template>
519
-
520
-
521
- <xsl:template match="csd:bibitem">
522
- <fo:block id="{@id}" margin-bottom="6pt"> <!-- 12 pt -->
523
- <xsl:if test=".//csd:fn">
524
- <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
525
- </xsl:if>
526
- <!-- csd:docidentifier -->
527
- <xsl:if test="csd:docidentifier">
528
- <xsl:choose>
529
- <xsl:when test="csd:docidentifier/@type = 'metanorma'"/>
530
- <xsl:otherwise>
531
- <xsl:value-of select="csd:docidentifier"/>
532
- </xsl:otherwise>
533
- </xsl:choose>
534
- </xsl:if>
535
- <xsl:apply-templates select="csd:note"/>
536
- <xsl:if test="csd:docidentifier">, </xsl:if>
537
- <fo:inline font-style="italic">
538
- <xsl:choose>
539
- <xsl:when test="csd:title[@type = 'main' and @language = 'en']">
540
- <xsl:value-of select="csd:title[@type = 'main' and @language = 'en']"/>
541
- </xsl:when>
542
- <xsl:otherwise>
543
- <xsl:value-of select="csd:title"/>
544
- </xsl:otherwise>
545
- </xsl:choose>
546
- </fo:inline>
547
- </fo:block>
548
- </xsl:template>
549
-
550
-
551
- <xsl:template match="csd:bibitem/csd:note" priority="2">
552
- <fo:footnote>
553
- <xsl:variable name="number">
554
- <xsl:choose>
555
- <xsl:when test="ancestor::csd:references[preceding-sibling::csd:references]">
556
- <xsl:number level="any" count="csd:references[preceding-sibling::csd:references]//csd:bibitem/csd:note"/>
557
- </xsl:when>
558
- <xsl:otherwise>
559
- <xsl:number level="any" count="csd:bibitem/csd:note"/>
560
- </xsl:otherwise>
561
- </xsl:choose>
562
- </xsl:variable>
563
- <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super"> <!-- 60% baseline-shift="35%" -->
564
- <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
565
- <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
566
- </fo:basic-link>
567
- </fo:inline>
568
- <fo:footnote-body>
569
- <fo:block font-size="10pt" margin-bottom="12pt" start-indent="0pt">
570
- <fo:inline id="{generate-id()}" keep-with-next.within-line="always" font-size="60%" vertical-align="super"><!-- baseline-shift="30%" padding-right="9mm" alignment-baseline="hanging" -->
571
- <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
572
- </fo:inline>
573
- <xsl:apply-templates/>
574
- </fo:block>
575
- </fo:footnote-body>
576
- </fo:footnote>
577
- </xsl:template>
578
-
579
-
580
-
581
- <xsl:template match="csd:ul | csd:ol" mode="ul_ol">
582
- <fo:list-block provisional-distance-between-starts="6.5mm" margin-bottom="12pt">
583
- <xsl:if test="ancestor::csd:ol">
584
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
585
- </xsl:if>
586
- <xsl:apply-templates/>
587
- </fo:list-block>
588
- </xsl:template>
589
-
590
- <xsl:template match="csd:li">
591
- <fo:list-item>
592
- <fo:list-item-label end-indent="label-end()">
593
- <fo:block>
594
- <xsl:choose>
595
- <xsl:when test="local-name(..) = 'ul'">—</xsl:when> <!-- dash -->
596
- <xsl:otherwise> <!-- for ordered lists -->
597
- <xsl:choose>
598
- <xsl:when test="../@type = 'arabic'">
599
- <xsl:number format="a)" lang="en"/>
600
- </xsl:when>
601
- <xsl:when test="../@type = 'alphabet'">
602
- <xsl:number format="1)"/>
603
- </xsl:when>
604
- <xsl:otherwise>
605
- <xsl:number format="1."/>
606
- </xsl:otherwise>
607
- </xsl:choose>
608
- </xsl:otherwise>
609
- </xsl:choose>
610
- </fo:block>
611
- </fo:list-item-label>
612
- <fo:list-item-body start-indent="body-start()">
613
- <fo:block>
614
- <xsl:apply-templates/>
615
- </fo:block>
616
- </fo:list-item-body>
617
- </fo:list-item>
618
- </xsl:template>
619
-
620
-
621
- <xsl:template match="csd:preferred">
622
- <xsl:variable name="level">
623
- <xsl:call-template name="getLevel"/>
624
- </xsl:variable>
625
- <xsl:variable name="font-size">
626
- <xsl:choose>
627
- <xsl:when test="$level &gt;= 3">11pt</xsl:when>
628
- <xsl:otherwise>12pt</xsl:otherwise>
629
- </xsl:choose>
630
- </xsl:variable>
631
- <fo:block font-size="{$font-size}" line-height="1.1">
632
- <fo:block font-weight="bold" keep-with-next="always">
633
- <xsl:apply-templates select="ancestor::csd:term/csd:name" mode="presentation"/>
634
- </fo:block>
635
- <fo:block font-weight="bold" keep-with-next="always">
636
- <xsl:apply-templates/>
637
- </fo:block>
638
- </fo:block>
639
- </xsl:template>
640
-
641
-
642
-
643
-
644
- <!-- <xsl:template match="csd:references[@id = '_bibliography']"> -->
645
- <xsl:template match="csd:references[not(@normative='true')]">
646
- <fo:block break-after="page"/>
647
- <fo:block id="{@id}">
648
- <xsl:apply-templates/>
649
- </fo:block>
650
- </xsl:template>
651
-
652
-
653
- <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
654
- <!-- <xsl:template match="csd:references[@id = '_bibliography']/csd:bibitem"> -->
655
- <xsl:template match="csd:references[not(@normative='true')]/csd:bibitem">
656
- <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="12mm">
657
- <fo:list-item>
658
- <fo:list-item-label end-indent="label-end()">
659
- <fo:block>
660
- <fo:inline id="{@id}">
661
- <xsl:number format="[1]"/>
662
- </fo:inline>
663
- </fo:block>
664
- </fo:list-item-label>
665
- <fo:list-item-body start-indent="body-start()">
666
- <fo:block>
667
- <xsl:if test="csd:docidentifier">
668
- <xsl:choose>
669
- <xsl:when test="csd:docidentifier/@type = 'metanorma'"/>
670
- <xsl:otherwise><fo:inline><xsl:value-of select="csd:docidentifier"/><xsl:apply-templates select="csd:note"/>, </fo:inline></xsl:otherwise>
671
- </xsl:choose>
672
-
673
- </xsl:if>
674
- <xsl:choose>
675
- <xsl:when test="csd:title[@type = 'main' and @language = 'en']">
676
- <xsl:apply-templates select="csd:title[@type = 'main' and @language = 'en']"/>
677
- </xsl:when>
678
- <xsl:otherwise>
679
- <xsl:apply-templates select="csd:title"/>
680
- </xsl:otherwise>
681
- </xsl:choose>
682
- <xsl:apply-templates select="csd:formattedref"/>
683
- </fo:block>
684
- </fo:list-item-body>
685
- </fo:list-item>
686
- </fo:list-block>
687
- </xsl:template>
688
-
689
- <!-- <xsl:template match="csd:references[@id = '_bibliography']/csd:bibitem" mode="contents"/> -->
690
- <xsl:template match="csd:references[not(@normative='true')]/csd:bibitem" mode="contents"/>
691
-
692
- <!-- <xsl:template match="csd:references[@id = '_bibliography']/csd:bibitem/csd:title"> -->
693
- <xsl:template match="csd:references[not(@normative='true')]/csd:bibitem/csd:title">
694
- <fo:inline font-style="italic">
695
- <xsl:apply-templates/>
696
- </fo:inline>
697
- </xsl:template>
698
-
699
-
700
- <xsl:template match="csd:xref" priority="2">
701
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">
702
- <xsl:if test="not(starts-with(text(), 'Figure') or starts-with(text(), 'Table'))">
703
- <xsl:attribute name="color">blue</xsl:attribute>
704
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
705
- </xsl:if>
706
- <xsl:apply-templates/>
707
- </fo:basic-link>
708
- </xsl:template>
709
-
710
-
711
-
712
- <xsl:template match="csd:admonition">
713
- <fo:block margin-bottom="12pt" font-weight="bold"> <!-- text-align="center" -->
714
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/>
715
- <xsl:text> — </xsl:text>
716
- <xsl:apply-templates/>
717
- </fo:block>
718
- </xsl:template>
719
-
720
-
721
-
722
- <xsl:template match="csd:formula/csd:stem">
723
- <fo:block margin-top="6pt" margin-bottom="12pt">
724
- <fo:table table-layout="fixed" width="100%">
725
- <fo:table-column column-width="95%"/>
726
- <fo:table-column column-width="5%"/>
727
- <fo:table-body>
728
- <fo:table-row>
729
- <fo:table-cell display-align="center">
730
- <fo:block text-align="left" margin-left="5mm">
731
- <xsl:apply-templates/>
732
- </fo:block>
733
- </fo:table-cell>
734
- <fo:table-cell display-align="center">
735
- <fo:block text-align="right">
736
- <xsl:apply-templates select="../csd:name" mode="presentation"/>
737
- </fo:block>
738
- </fo:table-cell>
739
- </fo:table-row>
740
- </fo:table-body>
741
- </fo:table>
742
- </fo:block>
743
- </xsl:template>
744
-
745
-
746
-
747
- <xsl:template name="insertHeaderFooter">
748
- <fo:static-content flow-name="header-even">
749
- <fo:block-container height="17mm" display-align="before">
750
- <fo:block padding-top="12.5mm">
751
- <xsl:value-of select="$header"/>
752
- </fo:block>
753
- </fo:block-container>
754
- </fo:static-content>
755
- <fo:static-content flow-name="footer-even">
756
- <fo:block-container font-size="10pt" height="100%" display-align="after">
757
- <fo:table table-layout="fixed" width="100%">
758
- <fo:table-column column-width="10%"/>
759
- <fo:table-column column-width="90%"/>
760
- <fo:table-body>
761
- <fo:table-row>
762
- <fo:table-cell>
763
- <fo:block padding-bottom="5mm"><fo:page-number/></fo:block>
764
- </fo:table-cell>
765
- <fo:table-cell padding-right="2mm">
766
- <fo:block padding-bottom="5mm" text-align="right"><xsl:value-of select="$copyright"/></fo:block>
767
- </fo:table-cell>
768
- </fo:table-row>
769
- </fo:table-body>
770
- </fo:table>
771
- </fo:block-container>
772
- </fo:static-content>
773
- <fo:static-content flow-name="header-odd">
774
- <fo:block-container height="17mm" display-align="before">
775
- <fo:block text-align="right" padding-top="12.5mm">
776
- <xsl:value-of select="$header"/>
777
- </fo:block>
778
- </fo:block-container>
779
- </fo:static-content>
780
- <fo:static-content flow-name="footer-odd">
781
- <fo:block-container font-size="10pt" height="100%" display-align="after">
782
- <fo:table table-layout="fixed" width="100%">
783
- <fo:table-column column-width="90%"/>
784
- <fo:table-column column-width="10%"/>
785
- <fo:table-body>
786
- <fo:table-row>
787
- <fo:table-cell>
788
- <fo:block padding-bottom="5mm"><xsl:value-of select="$copyright"/></fo:block>
789
- </fo:table-cell>
790
- <fo:table-cell padding-right="2mm">
791
- <fo:block padding-bottom="5mm" text-align="right"><fo:page-number/></fo:block>
792
- </fo:table-cell>
793
- </fo:table-row>
794
- </fo:table-body>
795
- </fo:table>
796
- </fo:block-container>
797
- </fo:static-content>
798
- </xsl:template>
799
-
800
-
801
- <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
802
-
803
- <title-annex lang="en">Annex </title-annex>
804
- <title-annex lang="fr">Annexe </title-annex>
805
-
806
- <title-annex lang="zh">Annex </title-annex>
807
-
808
-
809
-
810
- <title-edition lang="en">
811
-
812
- <xsl:text>Edition </xsl:text>
813
-
814
-
815
- </title-edition>
816
-
817
- <title-edition lang="fr">
818
-
819
- <xsl:text>Édition </xsl:text>
820
-
821
- </title-edition>
822
-
823
-
824
- <title-toc lang="en">
825
-
826
- <xsl:text>Contents</xsl:text>
827
-
828
-
829
-
830
- </title-toc>
831
- <title-toc lang="fr">
832
-
833
- <xsl:text>Sommaire</xsl:text>
834
-
835
-
836
- </title-toc>
837
-
838
- <title-toc lang="zh">Contents</title-toc>
839
-
840
-
841
-
842
- <title-page lang="en">Page</title-page>
843
- <title-page lang="fr">Page</title-page>
844
-
845
- <title-key lang="en">Key</title-key>
846
- <title-key lang="fr">Légende</title-key>
847
-
848
- <title-where lang="en">where</title-where>
849
- <title-where lang="fr">où</title-where>
850
-
851
- <title-descriptors lang="en">Descriptors</title-descriptors>
852
-
853
- <title-part lang="en">
854
-
855
-
856
-
857
- </title-part>
858
- <title-part lang="fr">
859
-
860
-
861
-
862
- </title-part>
863
- <title-part lang="zh">第 # 部分:</title-part>
864
-
865
- <title-subpart lang="en">
866
-
867
- </title-subpart>
868
- <title-subpart lang="fr">
869
-
870
- </title-subpart>
871
-
872
- <title-modified lang="en">modified</title-modified>
873
- <title-modified lang="fr">modifiée</title-modified>
874
-
875
- <title-modified lang="zh">modified</title-modified>
876
-
877
-
878
-
879
- <title-source lang="en">
880
-
881
- <xsl:text>SOURCE</xsl:text>
882
-
883
-
884
- </title-source>
885
-
886
- <title-keywords lang="en">Keywords</title-keywords>
887
-
888
- <title-deprecated lang="en">DEPRECATED</title-deprecated>
889
- <title-deprecated lang="fr">DEPRECATED</title-deprecated>
890
-
891
- <title-list-tables lang="en">List of Tables</title-list-tables>
892
-
893
- <title-list-figures lang="en">List of Figures</title-list-figures>
894
-
895
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
896
-
897
- <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
898
-
899
- <title-abstract lang="en">Abstract</title-abstract>
900
-
901
- <title-summary lang="en">Summary</title-summary>
902
-
903
- <title-in lang="en">in </title-in>
904
-
905
- <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
906
- <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
907
-
908
- <title-completion-date lang="en">Completion date for this manuscript</title-completion-date>
909
- <title-completion-date lang="zh">本稿完成日期</title-completion-date>
910
-
911
- <title-issuance-date lang="en">Issuance Date: #</title-issuance-date>
912
- <title-issuance-date lang="zh"># 发布</title-issuance-date>
913
-
914
- <title-implementation-date lang="en">Implementation Date: #</title-implementation-date>
915
- <title-implementation-date lang="zh"># 实施</title-implementation-date>
916
-
917
- <title-obligation-normative lang="en">normative</title-obligation-normative>
918
- <title-obligation-normative lang="zh">规范性附录</title-obligation-normative>
919
-
920
- <title-caution lang="en">CAUTION</title-caution>
921
- <title-caution lang="zh">注意</title-caution>
922
-
923
- <title-warning lang="en">WARNING</title-warning>
924
- <title-warning lang="zh">警告</title-warning>
925
-
926
- <title-amendment lang="en">AMENDMENT</title-amendment>
927
-
928
- <title-continued lang="en">(continued)</title-continued>
929
- <title-continued lang="fr">(continué)</title-continued>
930
-
931
- </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
932
- <xsl:param name="name"/>
933
- <xsl:param name="lang"/>
934
- <xsl:variable name="lang_">
935
- <xsl:choose>
936
- <xsl:when test="$lang != ''">
937
- <xsl:value-of select="$lang"/>
938
- </xsl:when>
939
- <xsl:otherwise>
940
- <xsl:call-template name="getLang"/>
941
- </xsl:otherwise>
942
- </xsl:choose>
943
- </xsl:variable>
944
- <xsl:variable name="language" select="normalize-space($lang_)"/>
945
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
946
- <xsl:choose>
947
- <xsl:when test="normalize-space($title_) != ''">
948
- <xsl:value-of select="$title_"/>
949
- </xsl:when>
950
- <xsl:otherwise>
951
- <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
952
- </xsl:otherwise>
953
- </xsl:choose>
954
- </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="root-style">
955
-
956
- </xsl:attribute-set><xsl:attribute-set name="link-style">
957
-
958
- <xsl:attribute name="color">blue</xsl:attribute>
959
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
960
-
961
-
962
-
963
- </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
964
- <xsl:attribute name="white-space">pre</xsl:attribute>
965
- <xsl:attribute name="wrap-option">wrap</xsl:attribute>
966
-
967
-
968
-
969
- <xsl:attribute name="font-family">Source Code Pro</xsl:attribute>
970
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
971
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
972
-
973
-
974
-
975
-
976
-
977
-
978
-
979
- </xsl:attribute-set><xsl:attribute-set name="permission-style">
980
-
981
- </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
982
-
983
- </xsl:attribute-set><xsl:attribute-set name="permission-label-style">
984
-
985
- </xsl:attribute-set><xsl:attribute-set name="requirement-style">
986
-
987
- </xsl:attribute-set><xsl:attribute-set name="requirement-name-style">
988
-
989
- </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
990
-
991
- </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
992
- </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
993
- </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
994
-
995
-
996
- </xsl:attribute-set><xsl:attribute-set name="recommendation-name-style">
997
-
998
-
999
- </xsl:attribute-set><xsl:attribute-set name="recommendation-label-style">
1000
-
1001
- </xsl:attribute-set><xsl:attribute-set name="termexample-style">
1002
-
1003
-
1004
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1005
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1006
-
1007
-
1008
-
1009
-
1010
-
1011
-
1012
- </xsl:attribute-set><xsl:attribute-set name="example-style">
1013
-
1014
-
1015
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1016
-
1017
-
1018
-
1019
-
1020
-
1021
-
1022
-
1023
-
1024
-
1025
-
1026
- </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1027
-
1028
-
1029
- <xsl:attribute name="margin-left">12.5mm</xsl:attribute>
1030
-
1031
-
1032
- </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1033
-
1034
-
1035
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1036
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1037
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
1038
-
1039
-
1040
-
1041
-
1042
-
1043
-
1044
-
1045
-
1046
-
1047
-
1048
-
1049
-
1050
-
1051
-
1052
-
1053
-
1054
-
1055
- </xsl:attribute-set><xsl:attribute-set name="example-p-style">
1056
-
1057
-
1058
- <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
1059
-
1060
-
1061
-
1062
-
1063
-
1064
-
1065
-
1066
-
1067
-
1068
-
1069
-
1070
-
1071
- </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
1072
-
1073
- <xsl:attribute name="padding-right">10mm</xsl:attribute>
1074
-
1075
-
1076
-
1077
-
1078
- </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1079
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
1080
-
1081
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1082
- <xsl:attribute name="text-align">center</xsl:attribute>
1083
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1084
-
1085
-
1086
-
1087
-
1088
-
1089
-
1090
-
1091
-
1092
-
1093
-
1094
-
1095
-
1096
- </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1097
-
1098
- <xsl:attribute name="font-size">12pt</xsl:attribute>
1099
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1100
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
1101
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1102
-
1103
-
1104
-
1105
- </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
1106
-
1107
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1108
- <xsl:attribute name="margin-top">8pt</xsl:attribute>
1109
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1110
-
1111
-
1112
-
1113
- </xsl:attribute-set><xsl:attribute-set name="xref-style">
1114
-
1115
-
1116
-
1117
- </xsl:attribute-set><xsl:attribute-set name="eref-style">
1118
-
1119
-
1120
- <xsl:attribute name="color">blue</xsl:attribute>
1121
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1122
-
1123
-
1124
-
1125
- </xsl:attribute-set><xsl:attribute-set name="note-style">
1126
-
1127
-
1128
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1129
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1130
-
1131
-
1132
-
1133
-
1134
-
1135
-
1136
-
1137
-
1138
-
1139
-
1140
-
1141
-
1142
-
1143
- </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
1144
-
1145
-
1146
- <xsl:attribute name="padding-right">6mm</xsl:attribute>
1147
-
1148
-
1149
-
1150
-
1151
-
1152
-
1153
-
1154
-
1155
-
1156
-
1157
-
1158
- </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1159
-
1160
-
1161
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1162
-
1163
-
1164
-
1165
-
1166
-
1167
-
1168
-
1169
-
1170
-
1171
-
1172
-
1173
-
1174
- </xsl:attribute-set><xsl:attribute-set name="termnote-style">
1175
-
1176
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1177
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1178
-
1179
-
1180
-
1181
-
1182
-
1183
- </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1184
-
1185
-
1186
- </xsl:attribute-set><xsl:attribute-set name="quote-style">
1187
-
1188
-
1189
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
1190
- <xsl:attribute name="margin-left">12mm</xsl:attribute>
1191
- <xsl:attribute name="margin-right">12mm</xsl:attribute>
1192
-
1193
-
1194
-
1195
-
1196
-
1197
-
1198
- </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1199
-
1200
-
1201
- <xsl:attribute name="text-align">right</xsl:attribute>
1202
-
1203
-
1204
- </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1205
-
1206
-
1207
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1208
- <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1209
-
1210
-
1211
-
1212
-
1213
- </xsl:attribute-set><xsl:attribute-set name="origin-style">
1214
-
1215
-
1216
-
1217
- </xsl:attribute-set><xsl:attribute-set name="term-style">
1218
-
1219
- </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1220
-
1221
-
1222
-
1223
-
1224
-
1225
-
1226
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1227
- <xsl:attribute name="text-align">center</xsl:attribute>
1228
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
1229
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1230
- <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1231
-
1232
-
1233
-
1234
-
1235
-
1236
-
1237
-
1238
-
1239
-
1240
-
1241
-
1242
-
1243
-
1244
- </xsl:attribute-set><xsl:attribute-set name="formula-style">
1245
-
1246
- </xsl:attribute-set><xsl:attribute-set name="image-style">
1247
- <xsl:attribute name="text-align">center</xsl:attribute>
1248
-
1249
-
1250
-
1251
-
1252
-
1253
- </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1254
-
1255
- </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1256
-
1257
- <xsl:attribute name="width">100%</xsl:attribute>
1258
- <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
1259
- <xsl:attribute name="scaling">uniform</xsl:attribute>
1260
-
1261
-
1262
-
1263
-
1264
-
1265
- </xsl:attribute-set><xsl:attribute-set name="tt-style">
1266
-
1267
- <xsl:attribute name="font-family">Source Code Pro</xsl:attribute>
1268
-
1269
-
1270
-
1271
- </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1272
- <xsl:attribute name="font-size">11pt</xsl:attribute>
1273
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1274
- <xsl:attribute name="text-align">center</xsl:attribute>
1275
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1276
- <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1277
-
1278
- </xsl:attribute-set><xsl:attribute-set name="domain-style">
1279
-
1280
- </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1281
-
1282
-
1283
- </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1284
-
1285
- </xsl:attribute-set><xsl:attribute-set name="definition-style">
1286
-
1287
-
1288
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1289
-
1290
- </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
1291
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1292
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1293
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1294
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1295
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1296
- </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1297
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1298
-
1299
- <!-- Normative references -->
1300
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1301
- <!-- Terms and definitions -->
1302
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
1303
- <!-- Another main sections -->
1304
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
1305
- <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1306
- <!-- Bibliography -->
1307
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1308
- </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1309
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1310
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1311
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1312
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1313
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1314
- </xsl:template><xsl:template name="processMainSectionsDefault">
1315
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1316
-
1317
- <!-- Normative references -->
1318
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
1319
- <!-- Terms and definitions -->
1320
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]"/>
1321
- <!-- Another main sections -->
1322
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]"/>
1323
- <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1324
- <!-- Bibliography -->
1325
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1326
- </xsl:template><xsl:template match="text()">
1327
- <xsl:value-of select="."/>
1328
- </xsl:template><xsl:template match="*[local-name()='br']">
1329
- <xsl:value-of select="$linebreak"/>
1330
- </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1331
- <!-- <xsl:call-template name="add-zero-spaces"/> -->
1332
- <xsl:call-template name="add-zero-spaces-java"/>
1333
- </xsl:template><xsl:template match="*[local-name()='table']" name="table">
1334
-
1335
- <xsl:variable name="table">
1336
-
1337
- <xsl:variable name="simple-table">
1338
- <xsl:call-template name="getSimpleTable"/>
1339
- </xsl:variable>
1340
-
1341
-
1342
-
1343
-
1344
-
1345
- <!-- <xsl:if test="$namespace = 'bipm'">
1346
- <fo:block>&#xA0;</fo:block>
1347
- </xsl:if> -->
1348
-
1349
- <!-- $namespace = 'iso' or -->
1350
-
1351
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1352
-
1353
-
1354
-
1355
- <xsl:call-template name="fn_name_display"/>
1356
-
1357
-
1358
-
1359
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1360
-
1361
- <!-- <xsl:variable name="cols-count">
1362
- <xsl:choose>
1363
- <xsl:when test="*[local-name()='thead']">
1364
- <xsl:call-template name="calculate-columns-numbers">
1365
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1366
- </xsl:call-template>
1367
- </xsl:when>
1368
- <xsl:otherwise>
1369
- <xsl:call-template name="calculate-columns-numbers">
1370
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1371
- </xsl:call-template>
1372
- </xsl:otherwise>
1373
- </xsl:choose>
1374
- </xsl:variable> -->
1375
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1376
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1377
-
1378
-
1379
-
1380
- <xsl:variable name="colwidths">
1381
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1382
- <xsl:call-template name="calculate-column-widths">
1383
- <xsl:with-param name="cols-count" select="$cols-count"/>
1384
- <xsl:with-param name="table" select="$simple-table"/>
1385
- </xsl:call-template>
1386
- </xsl:if>
1387
- </xsl:variable>
1388
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1389
-
1390
- <!-- <xsl:variable name="colwidths2">
1391
- <xsl:call-template name="calculate-column-widths">
1392
- <xsl:with-param name="cols-count" select="$cols-count"/>
1393
- </xsl:call-template>
1394
- </xsl:variable> -->
1395
-
1396
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1397
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
1398
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1399
-
1400
- <xsl:variable name="margin-left">
1401
- <xsl:choose>
1402
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1403
- <xsl:otherwise>0</xsl:otherwise>
1404
- </xsl:choose>
1405
- </xsl:variable>
1406
-
1407
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1408
-
1409
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1410
-
1411
-
1412
-
1413
-
1414
-
1415
-
1416
-
1417
-
1418
-
1419
-
1420
-
1421
-
1422
-
1423
-
1424
- <xsl:variable name="table_width">
1425
- <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1426
- 100%
1427
-
1428
-
1429
- </xsl:variable>
1430
-
1431
- <xsl:variable name="table_attributes">
1432
- <attribute name="table-layout">fixed</attribute>
1433
- <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
1434
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1435
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1436
-
1437
-
1438
-
1439
-
1440
-
1441
-
1442
-
1443
-
1444
-
1445
-
1446
- </xsl:variable>
1447
-
1448
-
1449
- <fo:table id="{@id}" table-omit-footer-at-break="true">
1450
-
1451
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1452
- <xsl:attribute name="{@name}">
1453
- <xsl:value-of select="."/>
1454
- </xsl:attribute>
1455
- </xsl:for-each>
1456
-
1457
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1458
- <xsl:if test="$isNoteOrFnExist = 'true'">
1459
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1460
- </xsl:if>
1461
-
1462
- <xsl:choose>
1463
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1464
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1465
- <fo:table-column column-width="{@width}"/>
1466
- </xsl:for-each>
1467
- </xsl:when>
1468
- <xsl:otherwise>
1469
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1470
- <xsl:choose>
1471
- <xsl:when test=". = 1 or . = 0">
1472
- <fo:table-column column-width="proportional-column-width(2)"/>
1473
- </xsl:when>
1474
- <xsl:otherwise>
1475
- <fo:table-column column-width="proportional-column-width({.})"/>
1476
- </xsl:otherwise>
1477
- </xsl:choose>
1478
- </xsl:for-each>
1479
- </xsl:otherwise>
1480
- </xsl:choose>
1481
-
1482
- <xsl:choose>
1483
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1484
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1485
- </xsl:when>
1486
- <xsl:otherwise>
1487
- <xsl:apply-templates/>
1488
- </xsl:otherwise>
1489
- </xsl:choose>
1490
-
1491
- </fo:table>
1492
-
1493
- <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1494
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1495
- <xsl:call-template name="insertTableFooterInSeparateTable">
1496
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
1497
- <xsl:with-param name="colwidths" select="$colwidths"/>
1498
- <xsl:with-param name="colgroup" select="$colgroup"/>
1499
- </xsl:call-template>
1500
- </xsl:for-each>
1501
-
1502
- <!-- insert footer as table -->
1503
- <!-- <fo:table>
1504
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1505
- <xsl:attribute name="{@name}">
1506
- <xsl:value-of select="."/>
1507
- </xsl:attribute>
1508
- </xsl:for-each>
1509
-
1510
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1511
- <xsl:choose>
1512
- <xsl:when test=". = 1 or . = 0">
1513
- <fo:table-column column-width="proportional-column-width(2)"/>
1514
- </xsl:when>
1515
- <xsl:otherwise>
1516
- <fo:table-column column-width="proportional-column-width({.})"/>
1517
- </xsl:otherwise>
1518
- </xsl:choose>
1519
- </xsl:for-each>
1520
- </fo:table>-->
1521
-
1522
-
1523
-
1524
-
1525
-
1526
- </fo:block-container>
1527
- </xsl:variable>
1528
-
1529
-
1530
-
1531
- <xsl:choose>
1532
- <xsl:when test="@width">
1533
-
1534
- <!-- centered table when table name is centered (see table-name-style) -->
1535
-
1536
- <fo:table table-layout="fixed" width="100%">
1537
- <fo:table-column column-width="proportional-column-width(1)"/>
1538
- <fo:table-column column-width="{@width}"/>
1539
- <fo:table-column column-width="proportional-column-width(1)"/>
1540
- <fo:table-body>
1541
- <fo:table-row>
1542
- <fo:table-cell column-number="2">
1543
- <fo:block><xsl:copy-of select="$table"/></fo:block>
1544
- </fo:table-cell>
1545
- </fo:table-row>
1546
- </fo:table-body>
1547
- </fo:table>
1548
-
1549
-
1550
-
1551
-
1552
- </xsl:when>
1553
- <xsl:otherwise>
1554
- <xsl:copy-of select="$table"/>
1555
- </xsl:otherwise>
1556
- </xsl:choose>
1557
-
1558
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1559
- <xsl:if test="normalize-space() != ''">
1560
- <fo:block xsl:use-attribute-sets="table-name-style">
1561
-
1562
-
1563
- <xsl:apply-templates/>
1564
- </fo:block>
1565
- </xsl:if>
1566
- </xsl:template><xsl:template name="calculate-columns-numbers">
1567
- <xsl:param name="table-row"/>
1568
- <xsl:variable name="columns-count" select="count($table-row/*)"/>
1569
- <xsl:variable name="sum-colspans" select="sum($table-row/*/@colspan)"/>
1570
- <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
1571
- <xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
1572
- </xsl:template><xsl:template name="calculate-column-widths">
1573
- <xsl:param name="table"/>
1574
- <xsl:param name="cols-count"/>
1575
- <xsl:param name="curr-col" select="1"/>
1576
- <xsl:param name="width" select="0"/>
1577
-
1578
- <xsl:if test="$curr-col &lt;= $cols-count">
1579
- <xsl:variable name="widths">
1580
- <xsl:choose>
1581
- <xsl:when test="not($table)"><!-- this branch is not using in production, for debug only -->
1582
- <xsl:for-each select="*[local-name()='thead']//*[local-name()='tr']">
1583
- <xsl:variable name="words">
1584
- <xsl:call-template name="tokenize">
1585
- <xsl:with-param name="text" select="translate(*[local-name()='th'][$curr-col],'- —:', ' ')"/>
1586
- </xsl:call-template>
1587
- </xsl:variable>
1588
- <xsl:variable name="max_length">
1589
- <xsl:call-template name="max_length">
1590
- <xsl:with-param name="words" select="xalan:nodeset($words)"/>
1591
- </xsl:call-template>
1592
- </xsl:variable>
1593
- <width>
1594
- <xsl:value-of select="$max_length"/>
1595
- </width>
1596
- </xsl:for-each>
1597
- <xsl:for-each select="*[local-name()='tbody']//*[local-name()='tr']">
1598
- <xsl:variable name="words">
1599
- <xsl:call-template name="tokenize">
1600
- <xsl:with-param name="text" select="translate(*[local-name()='td'][$curr-col],'- —:', ' ')"/>
1601
- </xsl:call-template>
1602
- </xsl:variable>
1603
- <xsl:variable name="max_length">
1604
- <xsl:call-template name="max_length">
1605
- <xsl:with-param name="words" select="xalan:nodeset($words)"/>
1606
- </xsl:call-template>
1607
- </xsl:variable>
1608
- <width>
1609
- <xsl:value-of select="$max_length"/>
1610
- </width>
1611
-
1612
- </xsl:for-each>
1613
- </xsl:when>
1614
- <xsl:otherwise>
1615
- <xsl:for-each select="xalan:nodeset($table)//tr">
1616
- <xsl:variable name="td_text">
1617
- <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1618
-
1619
- <!-- <xsl:if test="$namespace = 'bipm'">
1620
- <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1621
- <word><xsl:value-of select="normalize-space(.)"/></word>
1622
- </xsl:for-each>
1623
- </xsl:if> -->
1624
-
1625
- </xsl:variable>
1626
- <xsl:variable name="words">
1627
- <xsl:variable name="string_with_added_zerospaces">
1628
- <xsl:call-template name="add-zero-spaces-java">
1629
- <xsl:with-param name="text" select="$td_text"/>
1630
- </xsl:call-template>
1631
- </xsl:variable>
1632
- <xsl:call-template name="tokenize">
1633
- <!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> -->
1634
- <!-- 2009 thinspace -->
1635
- <!-- <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/> -->
1636
- <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​', ' '))"/>
1637
- </xsl:call-template>
1638
- </xsl:variable>
1639
- <xsl:variable name="max_length">
1640
- <xsl:call-template name="max_length">
1641
- <xsl:with-param name="words" select="xalan:nodeset($words)"/>
1642
- </xsl:call-template>
1643
- </xsl:variable>
1644
- <width>
1645
- <xsl:variable name="divider">
1646
- <xsl:choose>
1647
- <xsl:when test="td[$curr-col]/@divide">
1648
- <xsl:value-of select="td[$curr-col]/@divide"/>
1649
- </xsl:when>
1650
- <xsl:otherwise>1</xsl:otherwise>
1651
- </xsl:choose>
1652
- </xsl:variable>
1653
- <xsl:value-of select="$max_length div $divider"/>
1654
- </width>
1655
-
1656
- </xsl:for-each>
1657
-
1658
- </xsl:otherwise>
1659
- </xsl:choose>
1660
- </xsl:variable>
1661
-
1662
-
1663
- <column>
1664
- <xsl:for-each select="xalan:nodeset($widths)//width">
1665
- <xsl:sort select="." data-type="number" order="descending"/>
1666
- <xsl:if test="position()=1">
1667
- <xsl:value-of select="."/>
1668
- </xsl:if>
1669
- </xsl:for-each>
1670
- </column>
1671
- <xsl:call-template name="calculate-column-widths">
1672
- <xsl:with-param name="cols-count" select="$cols-count"/>
1673
- <xsl:with-param name="curr-col" select="$curr-col +1"/>
1674
- <xsl:with-param name="table" select="$table"/>
1675
- </xsl:call-template>
1676
- </xsl:if>
1677
- </xsl:template><xsl:template match="text()" mode="td_text">
1678
- <xsl:variable name="zero-space">​</xsl:variable>
1679
- <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text>
1680
- </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
1681
- <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1682
- </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1683
- <xsl:value-of select="@target"/>
1684
- </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1685
- <xsl:variable name="math_text" select="normalize-space(.)"/>
1686
- <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1687
- </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1688
- <xsl:param name="cols-count"/>
1689
- <!-- font-weight="bold" -->
1690
- <fo:table-header>
1691
-
1692
- <xsl:apply-templates/>
1693
- </fo:table-header>
1694
- </xsl:template><xsl:template name="table-header-title">
1695
- <xsl:param name="cols-count"/>
1696
- <!-- row for title -->
1697
- <fo:table-row>
1698
- <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
1699
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1700
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1701
- <xsl:call-template name="fn_name_display"/>
1702
- </xsl:for-each>
1703
- <fo:block text-align="right" font-style="italic">
1704
- <xsl:text> </xsl:text>
1705
- <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1706
- </fo:block>
1707
- </fo:table-cell>
1708
- </fo:table-row>
1709
- </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
1710
- <fo:table-body>
1711
- <xsl:apply-templates/>
1712
- </fo:table-body>
1713
- </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1714
- <xsl:apply-templates/>
1715
- </xsl:template><xsl:template name="insertTableFooter">
1716
- <xsl:param name="cols-count"/>
1717
- <xsl:if test="../*[local-name()='tfoot']">
1718
- <fo:table-footer>
1719
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1720
- </fo:table-footer>
1721
- </xsl:if>
1722
- </xsl:template><xsl:template name="insertTableFooter2">
1723
- <xsl:param name="cols-count"/>
1724
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1725
- <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
1726
-
1727
- <fo:table-footer>
1728
-
1729
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1730
-
1731
- <!-- if there are note(s) or fn(s) then create footer row -->
1732
- <xsl:if test="$isNoteOrFnExist = 'true'">
1733
-
1734
-
1735
-
1736
- <fo:table-row>
1737
- <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
1738
-
1739
-
1740
-
1741
- <!-- fn will be processed inside 'note' processing -->
1742
-
1743
-
1744
-
1745
-
1746
-
1747
-
1748
- <!-- except gb -->
1749
-
1750
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1751
-
1752
-
1753
- <!-- show Note under table in preface (ex. abstract) sections -->
1754
- <!-- empty, because notes show at page side in main sections -->
1755
- <!-- <xsl:if test="$namespace = 'bipm'">
1756
- <xsl:choose>
1757
- <xsl:when test="ancestor::*[local-name()='preface']">
1758
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1759
- </xsl:when>
1760
- <xsl:otherwise>
1761
- <fo:block/>
1762
- </xsl:otherwise>
1763
- </xsl:choose>
1764
- </xsl:if> -->
1765
-
1766
-
1767
- <!-- horizontal row separator -->
1768
-
1769
-
1770
- <!-- fn processing -->
1771
- <xsl:call-template name="fn_display"/>
1772
-
1773
- </fo:table-cell>
1774
- </fo:table-row>
1775
-
1776
- </xsl:if>
1777
- </fo:table-footer>
1778
-
1779
- </xsl:if>
1780
- </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1781
- <xsl:param name="table_attributes"/>
1782
- <xsl:param name="colwidths"/>
1783
- <xsl:param name="colgroup"/>
1784
-
1785
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1786
-
1787
- <xsl:if test="$isNoteOrFnExist = 'true'">
1788
-
1789
- <xsl:variable name="cols-count">
1790
- <xsl:choose>
1791
- <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1792
- <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
1793
- </xsl:when>
1794
- <xsl:otherwise>
1795
- <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
1796
- </xsl:otherwise>
1797
- </xsl:choose>
1798
- </xsl:variable>
1799
-
1800
- <fo:table keep-with-previous="always">
1801
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1802
- <xsl:choose>
1803
- <xsl:when test="@name = 'border-top'">
1804
- <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
1805
- </xsl:when>
1806
- <xsl:when test="@name = 'border'">
1807
- <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1808
- <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
1809
- </xsl:when>
1810
- <xsl:otherwise>
1811
- <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1812
- </xsl:otherwise>
1813
- </xsl:choose>
1814
- </xsl:for-each>
1815
-
1816
- <xsl:choose>
1817
- <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1818
- <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
1819
- <fo:table-column column-width="{@width}"/>
1820
- </xsl:for-each>
1821
- </xsl:when>
1822
- <xsl:otherwise>
1823
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1824
- <xsl:choose>
1825
- <xsl:when test=". = 1 or . = 0">
1826
- <fo:table-column column-width="proportional-column-width(2)"/>
1827
- </xsl:when>
1828
- <xsl:otherwise>
1829
- <fo:table-column column-width="proportional-column-width({.})"/>
1830
- </xsl:otherwise>
1831
- </xsl:choose>
1832
- </xsl:for-each>
1833
- </xsl:otherwise>
1834
- </xsl:choose>
1835
-
1836
- <fo:table-body>
1837
- <fo:table-row>
1838
- <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
1839
-
1840
-
1841
-
1842
- <!-- fn will be processed inside 'note' processing -->
1843
-
1844
-
1845
-
1846
-
1847
-
1848
-
1849
-
1850
- <!-- except gb -->
1851
-
1852
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1853
-
1854
-
1855
- <!-- <xsl:if test="$namespace = 'bipm'">
1856
- <xsl:choose>
1857
- <xsl:when test="ancestor::*[local-name()='preface']">
1858
- show Note under table in preface (ex. abstract) sections
1859
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1860
- </xsl:when>
1861
- <xsl:otherwise>
1862
- empty, because notes show at page side in main sections
1863
- <fo:block/>
1864
- </xsl:otherwise>
1865
- </xsl:choose>
1866
- </xsl:if> -->
1867
-
1868
-
1869
- <!-- horizontal row separator -->
1870
-
1871
-
1872
- <!-- fn processing -->
1873
- <xsl:call-template name="fn_display"/>
1874
-
1875
- </fo:table-cell>
1876
- </fo:table-row>
1877
- </fo:table-body>
1878
-
1879
- </fo:table>
1880
- </xsl:if>
1881
- </xsl:template><xsl:template match="*[local-name()='tbody']">
1882
-
1883
- <xsl:variable name="cols-count">
1884
- <xsl:choose>
1885
- <xsl:when test="../*[local-name()='thead']">
1886
- <xsl:call-template name="calculate-columns-numbers">
1887
- <xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/>
1888
- </xsl:call-template>
1889
- </xsl:when>
1890
- <xsl:otherwise>
1891
- <xsl:call-template name="calculate-columns-numbers">
1892
- <xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/>
1893
- </xsl:call-template>
1894
- </xsl:otherwise>
1895
- </xsl:choose>
1896
- </xsl:variable>
1897
-
1898
-
1899
-
1900
- <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
1901
- <xsl:with-param name="cols-count" select="$cols-count"/>
1902
- </xsl:apply-templates>
1903
-
1904
- <xsl:call-template name="insertTableFooter">
1905
- <xsl:with-param name="cols-count" select="$cols-count"/>
1906
- </xsl:call-template>
1907
-
1908
- <fo:table-body>
1909
-
1910
-
1911
- <xsl:apply-templates/>
1912
- <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
1913
-
1914
- </fo:table-body>
1915
-
1916
- </xsl:template><xsl:template match="*[local-name()='tr']">
1917
- <xsl:variable name="parent-name" select="local-name(..)"/>
1918
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
1919
- <fo:table-row min-height="4mm">
1920
- <xsl:if test="$parent-name = 'thead'">
1921
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1922
-
1923
-
1924
-
1925
-
1926
-
1927
- </xsl:if>
1928
- <xsl:if test="$parent-name = 'tfoot'">
1929
-
1930
-
1931
- </xsl:if>
1932
-
1933
-
1934
-
1935
-
1936
- <!-- <xsl:if test="$namespace = 'bipm'">
1937
- <xsl:attribute name="height">8mm</xsl:attribute>
1938
- </xsl:if> -->
1939
-
1940
- <xsl:apply-templates/>
1941
- </fo:table-row>
1942
- </xsl:template><xsl:template match="*[local-name()='th']">
1943
- <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
1944
- <xsl:attribute name="text-align">
1945
- <xsl:choose>
1946
- <xsl:when test="@align">
1947
- <xsl:value-of select="@align"/>
1948
- </xsl:when>
1949
- <xsl:otherwise>center</xsl:otherwise>
1950
- </xsl:choose>
1951
- </xsl:attribute>
1952
-
1953
-
1954
-
1955
-
1956
-
1957
-
1958
-
1959
-
1960
-
1961
-
1962
-
1963
- <xsl:if test="@colspan">
1964
- <xsl:attribute name="number-columns-spanned">
1965
- <xsl:value-of select="@colspan"/>
1966
- </xsl:attribute>
1967
- </xsl:if>
1968
- <xsl:if test="@rowspan">
1969
- <xsl:attribute name="number-rows-spanned">
1970
- <xsl:value-of select="@rowspan"/>
1971
- </xsl:attribute>
1972
- </xsl:if>
1973
- <xsl:call-template name="display-align"/>
1974
- <fo:block>
1975
- <xsl:apply-templates/>
1976
- </fo:block>
1977
- </fo:table-cell>
1978
- </xsl:template><xsl:template name="display-align">
1979
- <xsl:if test="@valign">
1980
- <xsl:attribute name="display-align">
1981
- <xsl:choose>
1982
- <xsl:when test="@valign = 'top'">before</xsl:when>
1983
- <xsl:when test="@valign = 'middle'">center</xsl:when>
1984
- <xsl:when test="@valign = 'bottom'">after</xsl:when>
1985
- <xsl:otherwise>before</xsl:otherwise>
1986
- </xsl:choose>
1987
- </xsl:attribute>
1988
- </xsl:if>
1989
- </xsl:template><xsl:template match="*[local-name()='td']">
1990
- <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
1991
- <xsl:attribute name="text-align">
1992
- <xsl:choose>
1993
- <xsl:when test="@align">
1994
- <xsl:value-of select="@align"/>
1995
- </xsl:when>
1996
- <xsl:otherwise>left</xsl:otherwise>
1997
- </xsl:choose>
1998
- </xsl:attribute>
1999
-
2000
-
2001
-
2002
-
2003
-
2004
-
2005
-
2006
-
2007
-
2008
-
2009
-
2010
- <xsl:if test="@colspan">
2011
- <xsl:attribute name="number-columns-spanned">
2012
- <xsl:value-of select="@colspan"/>
2013
- </xsl:attribute>
2014
- </xsl:if>
2015
- <xsl:if test="@rowspan">
2016
- <xsl:attribute name="number-rows-spanned">
2017
- <xsl:value-of select="@rowspan"/>
2018
- </xsl:attribute>
2019
- </xsl:if>
2020
- <xsl:call-template name="display-align"/>
2021
- <fo:block>
2022
-
2023
- <xsl:apply-templates/>
2024
- </fo:block>
2025
- </fo:table-cell>
2026
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
2027
-
2028
-
2029
- <fo:block font-size="10pt" margin-bottom="12pt">
2030
-
2031
-
2032
-
2033
-
2034
-
2035
-
2036
- <fo:inline padding-right="2mm">
2037
-
2038
-
2039
-
2040
-
2041
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2042
-
2043
- </fo:inline>
2044
-
2045
- <xsl:apply-templates mode="process"/>
2046
- </fo:block>
2047
-
2048
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
2049
- <xsl:apply-templates/>
2050
- </xsl:template><xsl:template name="fn_display">
2051
- <xsl:variable name="references">
2052
- <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
2053
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2054
-
2055
-
2056
- <xsl:apply-templates/>
2057
- </fn>
2058
- </xsl:for-each>
2059
- </xsl:variable>
2060
- <xsl:for-each select="xalan:nodeset($references)//fn">
2061
- <xsl:variable name="reference" select="@reference"/>
2062
- <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
2063
- <fo:block margin-bottom="12pt">
2064
-
2065
-
2066
-
2067
-
2068
-
2069
- <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
2070
-
2071
- <xsl:attribute name="vertical-align">super</xsl:attribute>
2072
-
2073
-
2074
-
2075
-
2076
-
2077
-
2078
-
2079
- <xsl:value-of select="@reference"/>
2080
-
2081
-
2082
- </fo:inline>
2083
- <fo:inline>
2084
-
2085
- <!-- <xsl:apply-templates /> -->
2086
- <xsl:copy-of select="./node()"/>
2087
- </fo:inline>
2088
- </fo:block>
2089
- </xsl:if>
2090
- </xsl:for-each>
2091
- </xsl:template><xsl:template name="fn_name_display">
2092
- <!-- <xsl:variable name="references">
2093
- <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
2094
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2095
- <xsl:apply-templates />
2096
- </fn>
2097
- </xsl:for-each>
2098
- </xsl:variable>
2099
- $references=<xsl:copy-of select="$references"/> -->
2100
- <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
2101
- <xsl:variable name="reference" select="@reference"/>
2102
- <fo:block id="{@reference}_{ancestor::*[@id][1]/@id}"><xsl:value-of select="@reference"/></fo:block>
2103
- <fo:block margin-bottom="12pt">
2104
- <xsl:apply-templates/>
2105
- </fo:block>
2106
- </xsl:for-each>
2107
- </xsl:template><xsl:template name="fn_display_figure">
2108
- <xsl:variable name="key_iso">
2109
- <!-- and (not(@class) or @class !='pseudocode') -->
2110
- </xsl:variable>
2111
- <xsl:variable name="references">
2112
- <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]">
2113
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2114
- <xsl:apply-templates/>
2115
- </fn>
2116
- </xsl:for-each>
2117
- </xsl:variable>
2118
-
2119
- <!-- current hierarchy is 'figure' element -->
2120
- <xsl:variable name="following_dl_colwidths">
2121
- <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2122
- <xsl:variable name="html-table">
2123
- <xsl:variable name="doc_ns">
2124
-
2125
- </xsl:variable>
2126
- <xsl:variable name="ns">
2127
- <xsl:choose>
2128
- <xsl:when test="normalize-space($doc_ns) != ''">
2129
- <xsl:value-of select="normalize-space($doc_ns)"/>
2130
- </xsl:when>
2131
- <xsl:otherwise>
2132
- <xsl:value-of select="substring-before(name(/*), '-')"/>
2133
- </xsl:otherwise>
2134
- </xsl:choose>
2135
- </xsl:variable>
2136
- <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2137
- <xsl:element name="{$ns}:table">
2138
- <xsl:for-each select="*[local-name() = 'dl'][1]">
2139
- <tbody>
2140
- <xsl:apply-templates mode="dl"/>
2141
- </tbody>
2142
- </xsl:for-each>
2143
- </xsl:element>
2144
- </xsl:variable>
2145
-
2146
- <xsl:call-template name="calculate-column-widths">
2147
- <xsl:with-param name="cols-count" select="2"/>
2148
- <xsl:with-param name="table" select="$html-table"/>
2149
- </xsl:call-template>
2150
-
2151
- </xsl:if>
2152
- </xsl:variable>
2153
-
2154
-
2155
- <xsl:variable name="maxlength_dt">
2156
- <xsl:for-each select="*[local-name() = 'dl'][1]">
2157
- <xsl:call-template name="getMaxLength_dt"/>
2158
- </xsl:for-each>
2159
- </xsl:variable>
2160
-
2161
- <xsl:if test="xalan:nodeset($references)//fn">
2162
- <fo:block>
2163
- <fo:table width="95%" table-layout="fixed">
2164
- <xsl:if test="normalize-space($key_iso) = 'true'">
2165
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2166
-
2167
- </xsl:if>
2168
- <xsl:choose>
2169
- <!-- if there 'dl', then set same columns width -->
2170
- <xsl:when test="xalan:nodeset($following_dl_colwidths)//column">
2171
- <xsl:call-template name="setColumnWidth_dl">
2172
- <xsl:with-param name="colwidths" select="$following_dl_colwidths"/>
2173
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2174
- </xsl:call-template>
2175
- </xsl:when>
2176
- <xsl:otherwise>
2177
- <fo:table-column column-width="15%"/>
2178
- <fo:table-column column-width="85%"/>
2179
- </xsl:otherwise>
2180
- </xsl:choose>
2181
- <fo:table-body>
2182
- <xsl:for-each select="xalan:nodeset($references)//fn">
2183
- <xsl:variable name="reference" select="@reference"/>
2184
- <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
2185
- <fo:table-row>
2186
- <fo:table-cell>
2187
- <fo:block>
2188
- <fo:inline font-size="80%" padding-right="5mm" vertical-align="super" id="{@id}">
2189
-
2190
- <xsl:value-of select="@reference"/>
2191
- </fo:inline>
2192
- </fo:block>
2193
- </fo:table-cell>
2194
- <fo:table-cell>
2195
- <fo:block text-align="justify" margin-bottom="12pt">
2196
-
2197
- <xsl:if test="normalize-space($key_iso) = 'true'">
2198
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
2199
- </xsl:if>
2200
-
2201
- <!-- <xsl:apply-templates /> -->
2202
- <xsl:copy-of select="./node()"/>
2203
- </fo:block>
2204
- </fo:table-cell>
2205
- </fo:table-row>
2206
- </xsl:if>
2207
- </xsl:for-each>
2208
- </fo:table-body>
2209
- </fo:table>
2210
- </fo:block>
2211
- </xsl:if>
2212
-
2213
- </xsl:template><xsl:template match="*[local-name()='fn']">
2214
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2215
- <fo:inline font-size="80%" keep-with-previous.within-line="always">
2216
-
2217
-
2218
-
2219
-
2220
-
2221
-
2222
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2223
-
2224
-
2225
- <xsl:value-of select="@reference"/>
2226
-
2227
- </fo:basic-link>
2228
- </fo:inline>
2229
- </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
2230
- <fo:inline>
2231
- <xsl:apply-templates/>
2232
- </fo:inline>
2233
- </xsl:template><xsl:template match="*[local-name()='dl']">
2234
- <fo:block-container>
2235
-
2236
- <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2237
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2238
- </xsl:if>
2239
-
2240
-
2241
- <xsl:if test="parent::*[local-name() = 'note']">
2242
- <xsl:attribute name="margin-left">
2243
- <xsl:choose>
2244
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2245
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2246
- </xsl:choose>
2247
- </xsl:attribute>
2248
-
2249
- </xsl:if>
2250
- <fo:block-container>
2251
-
2252
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2253
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2254
-
2255
-
2256
- <xsl:variable name="parent" select="local-name(..)"/>
2257
-
2258
- <xsl:variable name="key_iso">
2259
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
2260
- </xsl:variable>
2261
-
2262
- <xsl:choose>
2263
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2264
-
2265
-
2266
- <fo:block margin-bottom="12pt" text-align="left">
2267
-
2268
- <xsl:variable name="title-where">
2269
-
2270
-
2271
- <xsl:call-template name="getTitle">
2272
- <xsl:with-param name="name" select="'title-where'"/>
2273
- </xsl:call-template>
2274
-
2275
- </xsl:variable>
2276
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2277
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
2278
- <xsl:text/>
2279
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2280
- </fo:block>
2281
-
2282
- </xsl:when>
2283
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2284
- <fo:block margin-bottom="12pt" text-align="left">
2285
-
2286
-
2287
-
2288
-
2289
- <xsl:variable name="title-where">
2290
-
2291
-
2292
- <xsl:call-template name="getTitle">
2293
- <xsl:with-param name="name" select="'title-where'"/>
2294
- </xsl:call-template>
2295
-
2296
- </xsl:variable>
2297
- <xsl:value-of select="$title-where"/>
2298
- </fo:block>
2299
- </xsl:when>
2300
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2301
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2302
-
2303
-
2304
-
2305
- <xsl:variable name="title-key">
2306
-
2307
-
2308
- <xsl:call-template name="getTitle">
2309
- <xsl:with-param name="name" select="'title-key'"/>
2310
- </xsl:call-template>
2311
-
2312
- </xsl:variable>
2313
- <xsl:value-of select="$title-key"/>
2314
- </fo:block>
2315
- </xsl:when>
2316
- </xsl:choose>
2317
-
2318
- <!-- a few components -->
2319
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2320
- <fo:block>
2321
-
2322
-
2323
-
2324
-
2325
- <fo:block>
2326
-
2327
-
2328
-
2329
-
2330
- <fo:table width="95%" table-layout="fixed">
2331
-
2332
- <xsl:choose>
2333
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2334
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2335
- </xsl:when>
2336
- <xsl:when test="normalize-space($key_iso) = 'true'">
2337
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2338
-
2339
- </xsl:when>
2340
- </xsl:choose>
2341
- <!-- create virtual html table for dl/[dt and dd] -->
2342
- <xsl:variable name="html-table">
2343
- <xsl:variable name="doc_ns">
2344
-
2345
- </xsl:variable>
2346
- <xsl:variable name="ns">
2347
- <xsl:choose>
2348
- <xsl:when test="normalize-space($doc_ns) != ''">
2349
- <xsl:value-of select="normalize-space($doc_ns)"/>
2350
- </xsl:when>
2351
- <xsl:otherwise>
2352
- <xsl:value-of select="substring-before(name(/*), '-')"/>
2353
- </xsl:otherwise>
2354
- </xsl:choose>
2355
- </xsl:variable>
2356
- <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2357
- <xsl:element name="{$ns}:table">
2358
- <tbody>
2359
- <xsl:apply-templates mode="dl"/>
2360
- </tbody>
2361
- </xsl:element>
2362
- </xsl:variable>
2363
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
2364
- <xsl:variable name="colwidths">
2365
- <xsl:call-template name="calculate-column-widths">
2366
- <xsl:with-param name="cols-count" select="2"/>
2367
- <xsl:with-param name="table" select="$html-table"/>
2368
- </xsl:call-template>
2369
- </xsl:variable>
2370
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2371
- <xsl:variable name="maxlength_dt">
2372
- <xsl:call-template name="getMaxLength_dt"/>
2373
- </xsl:variable>
2374
- <xsl:call-template name="setColumnWidth_dl">
2375
- <xsl:with-param name="colwidths" select="$colwidths"/>
2376
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2377
- </xsl:call-template>
2378
- <fo:table-body>
2379
- <xsl:apply-templates>
2380
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2381
- </xsl:apply-templates>
2382
- </fo:table-body>
2383
- </fo:table>
2384
- </fo:block>
2385
- </fo:block>
2386
- </xsl:if>
2387
- </fo:block-container>
2388
- </fo:block-container>
2389
- </xsl:template><xsl:template name="setColumnWidth_dl">
2390
- <xsl:param name="colwidths"/>
2391
- <xsl:param name="maxlength_dt"/>
2392
- <xsl:choose>
2393
- <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
2394
- <fo:table-column column-width="50%"/>
2395
- <fo:table-column column-width="50%"/>
2396
- </xsl:when>
2397
- <xsl:otherwise>
2398
- <xsl:choose>
2399
- <!-- to set width check most wide chars like `W` -->
2400
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
2401
- <fo:table-column column-width="7%"/>
2402
- <fo:table-column column-width="93%"/>
2403
- </xsl:when>
2404
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
2405
- <fo:table-column column-width="15%"/>
2406
- <fo:table-column column-width="85%"/>
2407
- </xsl:when>
2408
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
2409
- <fo:table-column column-width="20%"/>
2410
- <fo:table-column column-width="80%"/>
2411
- </xsl:when>
2412
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
2413
- <fo:table-column column-width="25%"/>
2414
- <fo:table-column column-width="75%"/>
2415
- </xsl:when>
2416
- <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
2417
- <fo:table-column column-width="60%"/>
2418
- <fo:table-column column-width="40%"/>
2419
- </xsl:when> -->
2420
- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.3">
2421
- <fo:table-column column-width="50%"/>
2422
- <fo:table-column column-width="50%"/>
2423
- </xsl:when>
2424
- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 0.5">
2425
- <fo:table-column column-width="40%"/>
2426
- <fo:table-column column-width="60%"/>
2427
- </xsl:when>
2428
- <xsl:otherwise>
2429
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2430
- <xsl:choose>
2431
- <xsl:when test=". = 1 or . = 0">
2432
- <fo:table-column column-width="proportional-column-width(2)"/>
2433
- </xsl:when>
2434
- <xsl:otherwise>
2435
- <fo:table-column column-width="proportional-column-width({.})"/>
2436
- </xsl:otherwise>
2437
- </xsl:choose>
2438
- </xsl:for-each>
2439
- </xsl:otherwise>
2440
- </xsl:choose>
2441
- <!-- <fo:table-column column-width="15%"/>
2442
- <fo:table-column column-width="85%"/> -->
2443
- </xsl:otherwise>
2444
- </xsl:choose>
2445
- </xsl:template><xsl:template name="getMaxLength_dt">
2446
- <xsl:variable name="lengths">
2447
- <xsl:for-each select="*[local-name()='dt']">
2448
- <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
2449
- <xsl:variable name="attributes">
2450
- <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
2451
- <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
2452
- </xsl:variable>
2453
- <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
2454
- </xsl:for-each>
2455
- </xsl:variable>
2456
- <xsl:variable name="maxLength">
2457
- <!-- <xsl:for-each select="*[local-name()='dt']">
2458
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2459
- <xsl:if test="position() = 1">
2460
- <xsl:value-of select="string-length(normalize-space(.))"/>
2461
- </xsl:if>
2462
- </xsl:for-each> -->
2463
- <xsl:for-each select="xalan:nodeset($lengths)/length">
2464
- <xsl:sort select="." data-type="number" order="descending"/>
2465
- <xsl:if test="position() = 1">
2466
- <xsl:value-of select="."/>
2467
- </xsl:if>
2468
- </xsl:for-each>
2469
- </xsl:variable>
2470
- <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
2471
- <xsl:value-of select="$maxLength"/>
2472
- </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2473
- <xsl:param name="key_iso"/>
2474
-
2475
- <!-- <tr>
2476
- <td>NOTE</td>
2477
- <td>
2478
- <xsl:apply-templates />
2479
- </td>
2480
- </tr>
2481
- -->
2482
- <fo:table-row>
2483
- <fo:table-cell>
2484
- <fo:block margin-top="6pt">
2485
- <xsl:if test="normalize-space($key_iso) = 'true'">
2486
- <xsl:attribute name="margin-top">0</xsl:attribute>
2487
- </xsl:if>
2488
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2489
- </fo:block>
2490
- </fo:table-cell>
2491
- <fo:table-cell>
2492
- <fo:block>
2493
- <xsl:apply-templates/>
2494
- </fo:block>
2495
- </fo:table-cell>
2496
- </fo:table-row>
2497
- </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl">
2498
- <tr>
2499
- <td>
2500
- <xsl:apply-templates/>
2501
- </td>
2502
- <td>
2503
-
2504
-
2505
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2506
-
2507
- </td>
2508
- </tr>
2509
-
2510
- </xsl:template><xsl:template match="*[local-name()='dt']">
2511
- <xsl:param name="key_iso"/>
2512
-
2513
- <fo:table-row>
2514
-
2515
- <fo:table-cell>
2516
-
2517
- <fo:block margin-top="6pt">
2518
-
2519
-
2520
- <xsl:if test="normalize-space($key_iso) = 'true'">
2521
- <xsl:attribute name="margin-top">0</xsl:attribute>
2522
-
2523
- </xsl:if>
2524
-
2525
-
2526
- <xsl:attribute name="margin-left">7mm</xsl:attribute>
2527
-
2528
-
2529
-
2530
-
2531
-
2532
- <xsl:apply-templates/>
2533
- <!-- <xsl:if test="$namespace = 'gb'">
2534
- <xsl:if test="ancestor::*[local-name()='formula']">
2535
- <xsl:text>—</xsl:text>
2536
- </xsl:if>
2537
- </xsl:if> -->
2538
- </fo:block>
2539
- </fo:table-cell>
2540
- <fo:table-cell>
2541
- <fo:block>
2542
-
2543
- <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2544
- <xsl:if test="local-name(*[1]) != 'stem'">
2545
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2546
- </xsl:if>
2547
- </xsl:if> -->
2548
-
2549
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2550
-
2551
- </fo:block>
2552
- </fo:table-cell>
2553
- </fo:table-row>
2554
- <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2555
- <xsl:if test="local-name(*[1]) = 'stem'">
2556
- <fo:table-row>
2557
- <fo:table-cell>
2558
- <fo:block margin-top="6pt">
2559
- <xsl:if test="normalize-space($key_iso) = 'true'">
2560
- <xsl:attribute name="margin-top">0</xsl:attribute>
2561
- </xsl:if>
2562
- <xsl:text>&#xA0;</xsl:text>
2563
- </fo:block>
2564
- </fo:table-cell>
2565
- <fo:table-cell>
2566
- <fo:block>
2567
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2568
- </fo:block>
2569
- </fo:table-cell>
2570
- </fo:table-row>
2571
- </xsl:if>
2572
- </xsl:if> -->
2573
- </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2574
- <xsl:apply-templates/>
2575
- </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
2576
- <xsl:apply-templates/>
2577
- </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
2578
- <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
2579
- </xsl:template><xsl:template match="*[local-name()='em']">
2580
- <fo:inline font-style="italic">
2581
- <xsl:apply-templates/>
2582
- </fo:inline>
2583
- </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2584
- <fo:inline font-weight="bold">
2585
-
2586
- <xsl:apply-templates/>
2587
- </fo:inline>
2588
- </xsl:template><xsl:template match="*[local-name()='sup']">
2589
- <fo:inline font-size="80%" vertical-align="super">
2590
- <xsl:apply-templates/>
2591
- </fo:inline>
2592
- </xsl:template><xsl:template match="*[local-name()='sub']">
2593
- <fo:inline font-size="80%" vertical-align="sub">
2594
- <xsl:apply-templates/>
2595
- </fo:inline>
2596
- </xsl:template><xsl:template match="*[local-name()='tt']">
2597
- <fo:inline xsl:use-attribute-sets="tt-style">
2598
- <xsl:variable name="_font-size">
2599
-
2600
- 10
2601
-
2602
-
2603
-
2604
-
2605
-
2606
-
2607
-
2608
-
2609
-
2610
-
2611
-
2612
-
2613
-
2614
- </xsl:variable>
2615
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
2616
- <xsl:if test="$font-size != ''">
2617
- <xsl:attribute name="font-size">
2618
- <xsl:choose>
2619
- <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
2620
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
2621
- </xsl:choose>
2622
- </xsl:attribute>
2623
- </xsl:if>
2624
- <xsl:apply-templates/>
2625
- </fo:inline>
2626
- </xsl:template><xsl:template match="*[local-name()='underline']">
2627
- <fo:inline text-decoration="underline">
2628
- <xsl:apply-templates/>
2629
- </fo:inline>
2630
- </xsl:template><xsl:template match="*[local-name()='del']">
2631
- <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2632
- <xsl:apply-templates/>
2633
- </fo:inline>
2634
- </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
2635
- <xsl:variable name="text" select="normalize-space(.)"/>
2636
- <fo:inline font-size="75%">
2637
- <xsl:if test="string-length($text) &gt; 0">
2638
- <xsl:call-template name="recursiveSmallCaps">
2639
- <xsl:with-param name="text" select="$text"/>
2640
- </xsl:call-template>
2641
- </xsl:if>
2642
- </fo:inline>
2643
- </xsl:template><xsl:template name="recursiveSmallCaps">
2644
- <xsl:param name="text"/>
2645
- <xsl:variable name="char" select="substring($text,1,1)"/>
2646
- <!-- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/> -->
2647
- <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
2648
- <xsl:choose>
2649
- <xsl:when test="$char=$upperCase">
2650
- <fo:inline font-size="{100 div 0.75}%">
2651
- <xsl:value-of select="$upperCase"/>
2652
- </fo:inline>
2653
- </xsl:when>
2654
- <xsl:otherwise>
2655
- <xsl:value-of select="$upperCase"/>
2656
- </xsl:otherwise>
2657
- </xsl:choose>
2658
- <xsl:if test="string-length($text) &gt; 1">
2659
- <xsl:call-template name="recursiveSmallCaps">
2660
- <xsl:with-param name="text" select="substring($text,2)"/>
2661
- </xsl:call-template>
2662
- </xsl:if>
2663
- </xsl:template><xsl:template name="tokenize">
2664
- <xsl:param name="text"/>
2665
- <xsl:param name="separator" select="' '"/>
2666
- <xsl:choose>
2667
- <xsl:when test="not(contains($text, $separator))">
2668
- <word>
2669
- <xsl:variable name="str_no_en_chars" select="normalize-space(translate($text, $en_chars, ''))"/>
2670
- <xsl:variable name="len_str_no_en_chars" select="string-length($str_no_en_chars)"/>
2671
- <xsl:variable name="len_str_tmp" select="string-length(normalize-space($text))"/>
2672
- <xsl:variable name="len_str">
2673
- <xsl:choose>
2674
- <xsl:when test="normalize-space(translate($text, $upper, '')) = ''"> <!-- english word in CAPITAL letters -->
2675
- <xsl:value-of select="$len_str_tmp * 1.5"/>
2676
- </xsl:when>
2677
- <xsl:otherwise>
2678
- <xsl:value-of select="$len_str_tmp"/>
2679
- </xsl:otherwise>
2680
- </xsl:choose>
2681
- </xsl:variable>
2682
-
2683
- <!-- <xsl:if test="$len_str_no_en_chars div $len_str &gt; 0.8">
2684
- <xsl:message>
2685
- div=<xsl:value-of select="$len_str_no_en_chars div $len_str"/>
2686
- len_str=<xsl:value-of select="$len_str"/>
2687
- len_str_no_en_chars=<xsl:value-of select="$len_str_no_en_chars"/>
2688
- </xsl:message>
2689
- </xsl:if> -->
2690
- <!-- <len_str_no_en_chars><xsl:value-of select="$len_str_no_en_chars"/></len_str_no_en_chars>
2691
- <len_str><xsl:value-of select="$len_str"/></len_str> -->
2692
- <xsl:choose>
2693
- <xsl:when test="$len_str_no_en_chars div $len_str &gt; 0.8"> <!-- means non-english string -->
2694
- <xsl:value-of select="$len_str - $len_str_no_en_chars"/>
2695
- </xsl:when>
2696
- <xsl:otherwise>
2697
- <xsl:value-of select="$len_str"/>
2698
- </xsl:otherwise>
2699
- </xsl:choose>
2700
- </word>
2701
- </xsl:when>
2702
- <xsl:otherwise>
2703
- <word>
2704
- <xsl:value-of select="string-length(normalize-space(substring-before($text, $separator)))"/>
2705
- </word>
2706
- <xsl:call-template name="tokenize">
2707
- <xsl:with-param name="text" select="substring-after($text, $separator)"/>
2708
- </xsl:call-template>
2709
- </xsl:otherwise>
2710
- </xsl:choose>
2711
- </xsl:template><xsl:template name="max_length">
2712
- <xsl:param name="words"/>
2713
- <xsl:for-each select="$words//word">
2714
- <xsl:sort select="." data-type="number" order="descending"/>
2715
- <xsl:if test="position()=1">
2716
- <xsl:value-of select="."/>
2717
- </xsl:if>
2718
- </xsl:for-each>
2719
- </xsl:template><xsl:template name="add-zero-spaces-java">
2720
- <xsl:param name="text" select="."/>
2721
- <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2722
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
2723
- </xsl:template><xsl:template name="add-zero-spaces-link-java">
2724
- <xsl:param name="text" select="."/>
2725
- <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2726
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
2727
- </xsl:template><xsl:template name="add-zero-spaces">
2728
- <xsl:param name="text" select="."/>
2729
- <xsl:variable name="zero-space-after-chars">-</xsl:variable>
2730
- <xsl:variable name="zero-space-after-dot">.</xsl:variable>
2731
- <xsl:variable name="zero-space-after-colon">:</xsl:variable>
2732
- <xsl:variable name="zero-space-after-equal">=</xsl:variable>
2733
- <xsl:variable name="zero-space-after-underscore">_</xsl:variable>
2734
- <xsl:variable name="zero-space">​</xsl:variable>
2735
- <xsl:choose>
2736
- <xsl:when test="contains($text, $zero-space-after-chars)">
2737
- <xsl:value-of select="substring-before($text, $zero-space-after-chars)"/>
2738
- <xsl:value-of select="$zero-space-after-chars"/>
2739
- <xsl:value-of select="$zero-space"/>
2740
- <xsl:call-template name="add-zero-spaces">
2741
- <xsl:with-param name="text" select="substring-after($text, $zero-space-after-chars)"/>
2742
- </xsl:call-template>
2743
- </xsl:when>
2744
- <xsl:when test="contains($text, $zero-space-after-dot)">
2745
- <xsl:value-of select="substring-before($text, $zero-space-after-dot)"/>
2746
- <xsl:value-of select="$zero-space-after-dot"/>
2747
- <xsl:value-of select="$zero-space"/>
2748
- <xsl:call-template name="add-zero-spaces">
2749
- <xsl:with-param name="text" select="substring-after($text, $zero-space-after-dot)"/>
2750
- </xsl:call-template>
2751
- </xsl:when>
2752
- <xsl:when test="contains($text, $zero-space-after-colon)">
2753
- <xsl:value-of select="substring-before($text, $zero-space-after-colon)"/>
2754
- <xsl:value-of select="$zero-space-after-colon"/>
2755
- <xsl:value-of select="$zero-space"/>
2756
- <xsl:call-template name="add-zero-spaces">
2757
- <xsl:with-param name="text" select="substring-after($text, $zero-space-after-colon)"/>
2758
- </xsl:call-template>
2759
- </xsl:when>
2760
- <xsl:when test="contains($text, $zero-space-after-equal)">
2761
- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
2762
- <xsl:value-of select="$zero-space-after-equal"/>
2763
- <xsl:value-of select="$zero-space"/>
2764
- <xsl:call-template name="add-zero-spaces">
2765
- <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
2766
- </xsl:call-template>
2767
- </xsl:when>
2768
- <xsl:when test="contains($text, $zero-space-after-underscore)">
2769
- <xsl:value-of select="substring-before($text, $zero-space-after-underscore)"/>
2770
- <xsl:value-of select="$zero-space-after-underscore"/>
2771
- <xsl:value-of select="$zero-space"/>
2772
- <xsl:call-template name="add-zero-spaces">
2773
- <xsl:with-param name="text" select="substring-after($text, $zero-space-after-underscore)"/>
2774
- </xsl:call-template>
2775
- </xsl:when>
2776
- <xsl:otherwise>
2777
- <xsl:value-of select="$text"/>
2778
- </xsl:otherwise>
2779
- </xsl:choose>
2780
- </xsl:template><xsl:template name="add-zero-spaces-equal">
2781
- <xsl:param name="text" select="."/>
2782
- <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
2783
- <xsl:variable name="zero-space-after-equal">=</xsl:variable>
2784
- <xsl:variable name="zero-space">​</xsl:variable>
2785
- <xsl:choose>
2786
- <xsl:when test="contains($text, $zero-space-after-equals)">
2787
- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
2788
- <xsl:value-of select="$zero-space-after-equals"/>
2789
- <xsl:value-of select="$zero-space"/>
2790
- <xsl:call-template name="add-zero-spaces-equal">
2791
- <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equals)"/>
2792
- </xsl:call-template>
2793
- </xsl:when>
2794
- <xsl:when test="contains($text, $zero-space-after-equal)">
2795
- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
2796
- <xsl:value-of select="$zero-space-after-equal"/>
2797
- <xsl:value-of select="$zero-space"/>
2798
- <xsl:call-template name="add-zero-spaces-equal">
2799
- <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
2800
- </xsl:call-template>
2801
- </xsl:when>
2802
- <xsl:otherwise>
2803
- <xsl:value-of select="$text"/>
2804
- </xsl:otherwise>
2805
- </xsl:choose>
2806
- </xsl:template><xsl:template name="getSimpleTable">
2807
- <xsl:variable name="simple-table">
2808
-
2809
- <!-- Step 1. colspan processing -->
2810
- <xsl:variable name="simple-table-colspan">
2811
- <tbody>
2812
- <xsl:apply-templates mode="simple-table-colspan"/>
2813
- </tbody>
2814
- </xsl:variable>
2815
-
2816
- <!-- Step 2. rowspan processing -->
2817
- <xsl:variable name="simple-table-rowspan">
2818
- <xsl:apply-templates select="xalan:nodeset($simple-table-colspan)" mode="simple-table-rowspan"/>
2819
- </xsl:variable>
2820
-
2821
- <xsl:copy-of select="xalan:nodeset($simple-table-rowspan)"/>
2822
-
2823
- <!-- <xsl:choose>
2824
- <xsl:when test="current()//*[local-name()='th'][@colspan] or current()//*[local-name()='td'][@colspan] ">
2825
-
2826
- </xsl:when>
2827
- <xsl:otherwise>
2828
- <xsl:copy-of select="current()"/>
2829
- </xsl:otherwise>
2830
- </xsl:choose> -->
2831
- </xsl:variable>
2832
- <xsl:copy-of select="$simple-table"/>
2833
- </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
2834
- <xsl:apply-templates mode="simple-table-colspan"/>
2835
- </xsl:template><xsl:template match="*[local-name()='fn']" mode="simple-table-colspan"/><xsl:template match="*[local-name()='th'] | *[local-name()='td']" mode="simple-table-colspan">
2836
- <xsl:choose>
2837
- <xsl:when test="@colspan">
2838
- <xsl:variable name="td">
2839
- <xsl:element name="td">
2840
- <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
2841
- <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
2842
- <xsl:apply-templates mode="simple-table-colspan"/>
2843
- </xsl:element>
2844
- </xsl:variable>
2845
- <xsl:call-template name="repeatNode">
2846
- <xsl:with-param name="count" select="@colspan"/>
2847
- <xsl:with-param name="node" select="$td"/>
2848
- </xsl:call-template>
2849
- </xsl:when>
2850
- <xsl:otherwise>
2851
- <xsl:element name="td">
2852
- <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
2853
- <xsl:apply-templates mode="simple-table-colspan"/>
2854
- </xsl:element>
2855
- </xsl:otherwise>
2856
- </xsl:choose>
2857
- </xsl:template><xsl:template match="@colspan" mode="simple-table-colspan"/><xsl:template match="*[local-name()='tr']" mode="simple-table-colspan">
2858
- <xsl:element name="tr">
2859
- <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
2860
- <xsl:apply-templates mode="simple-table-colspan"/>
2861
- </xsl:element>
2862
- </xsl:template><xsl:template match="@*|node()" mode="simple-table-colspan">
2863
- <xsl:copy>
2864
- <xsl:apply-templates select="@*|node()" mode="simple-table-colspan"/>
2865
- </xsl:copy>
2866
- </xsl:template><xsl:template name="repeatNode">
2867
- <xsl:param name="count"/>
2868
- <xsl:param name="node"/>
2869
-
2870
- <xsl:if test="$count &gt; 0">
2871
- <xsl:call-template name="repeatNode">
2872
- <xsl:with-param name="count" select="$count - 1"/>
2873
- <xsl:with-param name="node" select="$node"/>
2874
- </xsl:call-template>
2875
- <xsl:copy-of select="$node"/>
2876
- </xsl:if>
2877
- </xsl:template><xsl:template match="@*|node()" mode="simple-table-rowspan">
2878
- <xsl:copy>
2879
- <xsl:apply-templates select="@*|node()" mode="simple-table-rowspan"/>
2880
- </xsl:copy>
2881
- </xsl:template><xsl:template match="tbody" mode="simple-table-rowspan">
2882
- <xsl:copy>
2883
- <xsl:copy-of select="tr[1]"/>
2884
- <xsl:apply-templates select="tr[2]" mode="simple-table-rowspan">
2885
- <xsl:with-param name="previousRow" select="tr[1]"/>
2886
- </xsl:apply-templates>
2887
- </xsl:copy>
2888
- </xsl:template><xsl:template match="tr" mode="simple-table-rowspan">
2889
- <xsl:param name="previousRow"/>
2890
- <xsl:variable name="currentRow" select="."/>
2891
-
2892
- <xsl:variable name="normalizedTDs">
2893
- <xsl:for-each select="xalan:nodeset($previousRow)//td">
2894
- <xsl:choose>
2895
- <xsl:when test="@rowspan &gt; 1">
2896
- <xsl:copy>
2897
- <xsl:attribute name="rowspan">
2898
- <xsl:value-of select="@rowspan - 1"/>
2899
- </xsl:attribute>
2900
- <xsl:copy-of select="@*[not(name() = 'rowspan')]"/>
2901
- <xsl:copy-of select="node()"/>
2902
- </xsl:copy>
2903
- </xsl:when>
2904
- <xsl:otherwise>
2905
- <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
2906
- </xsl:otherwise>
2907
- </xsl:choose>
2908
- </xsl:for-each>
2909
- </xsl:variable>
2910
-
2911
- <xsl:variable name="newRow">
2912
- <xsl:copy>
2913
- <xsl:copy-of select="$currentRow/@*"/>
2914
- <xsl:copy-of select="xalan:nodeset($normalizedTDs)"/>
2915
- </xsl:copy>
2916
- </xsl:variable>
2917
- <xsl:copy-of select="$newRow"/>
2918
-
2919
- <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
2920
- <xsl:with-param name="previousRow" select="$newRow"/>
2921
- </xsl:apply-templates>
2922
- </xsl:template><xsl:template name="getLang">
2923
- <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
2924
- <xsl:variable name="language">
2925
- <xsl:choose>
2926
- <xsl:when test="$language_current != ''">
2927
- <xsl:value-of select="$language_current"/>
2928
- </xsl:when>
2929
- <xsl:otherwise>
2930
- <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2931
- </xsl:otherwise>
2932
- </xsl:choose>
2933
- </xsl:variable>
2934
-
2935
- <xsl:choose>
2936
- <xsl:when test="$language = 'English'">en</xsl:when>
2937
- <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
2938
- </xsl:choose>
2939
- </xsl:template><xsl:template name="capitalizeWords">
2940
- <xsl:param name="str"/>
2941
- <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
2942
- <xsl:choose>
2943
- <xsl:when test="contains($str2, ' ')">
2944
- <xsl:variable name="substr" select="substring-before($str2, ' ')"/>
2945
- <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
2946
- <xsl:value-of select="substring($substr, 2)"/> -->
2947
- <xsl:call-template name="capitalize">
2948
- <xsl:with-param name="str" select="$substr"/>
2949
- </xsl:call-template>
2950
- <xsl:text> </xsl:text>
2951
- <xsl:call-template name="capitalizeWords">
2952
- <xsl:with-param name="str" select="substring-after($str2, ' ')"/>
2953
- </xsl:call-template>
2954
- </xsl:when>
2955
- <xsl:otherwise>
2956
- <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
2957
- <xsl:value-of select="substring($str2, 2)"/> -->
2958
- <xsl:call-template name="capitalize">
2959
- <xsl:with-param name="str" select="$str2"/>
2960
- </xsl:call-template>
2961
- </xsl:otherwise>
2962
- </xsl:choose>
2963
- </xsl:template><xsl:template name="capitalize">
2964
- <xsl:param name="str"/>
2965
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2966
- <xsl:value-of select="substring($str, 2)"/>
2967
- </xsl:template><xsl:template match="mathml:math">
2968
- <fo:inline font-family="STIX Two Math"> <!-- -->
2969
-
2970
- <xsl:variable name="mathml">
2971
- <xsl:apply-templates select="." mode="mathml"/>
2972
- </xsl:variable>
2973
- <fo:instream-foreign-object fox:alt-text="Math">
2974
- <!-- <xsl:copy-of select="."/> -->
2975
- <xsl:copy-of select="xalan:nodeset($mathml)"/>
2976
- </fo:instream-foreign-object>
2977
- </fo:inline>
2978
- </xsl:template><xsl:template match="@*|node()" mode="mathml">
2979
- <xsl:copy>
2980
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
2981
- </xsl:copy>
2982
- </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
2983
- <xsl:copy>
2984
- <!-- replace start and end spaces to non-break space -->
2985
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
2986
- </xsl:copy>
2987
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
2988
- <xsl:copy>
2989
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
2990
- </xsl:copy>
2991
- <mathml:mspace width="0.5ex"/>
2992
- </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2993
- <xsl:variable name="target">
2994
- <xsl:choose>
2995
- <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
2996
- <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
2997
- </xsl:when>
2998
- <xsl:otherwise>
2999
- <xsl:value-of select="normalize-space(@target)"/>
3000
- </xsl:otherwise>
3001
- </xsl:choose>
3002
- </xsl:variable>
3003
- <fo:inline xsl:use-attribute-sets="link-style">
3004
-
3005
- <xsl:choose>
3006
- <xsl:when test="$target = ''">
3007
- <xsl:apply-templates/>
3008
- </xsl:when>
3009
- <xsl:otherwise>
3010
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3011
- <xsl:choose>
3012
- <xsl:when test="normalize-space(.) = ''">
3013
- <!-- <xsl:value-of select="$target"/> -->
3014
- <xsl:call-template name="add-zero-spaces-link-java">
3015
- <xsl:with-param name="text" select="$target"/>
3016
- </xsl:call-template>
3017
- </xsl:when>
3018
- <xsl:otherwise>
3019
- <xsl:apply-templates/>
3020
- </xsl:otherwise>
3021
- </xsl:choose>
3022
- </fo:basic-link>
3023
- </xsl:otherwise>
3024
- </xsl:choose>
3025
- </fo:inline>
3026
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
3027
- <fo:inline id="{@id}"/>
3028
- </xsl:template><xsl:template match="*[local-name()='appendix']">
3029
- <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3030
- <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
3031
- </fo:block>
3032
- <xsl:apply-templates/>
3033
- </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3034
- <fo:inline><xsl:apply-templates/></fo:inline>
3035
- </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
3036
- <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
3037
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3038
- </fo:block>
3039
- <xsl:apply-templates/>
3040
- </xsl:template><xsl:template match="*[local-name() = 'callout']">
3041
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
3042
- </xsl:template><xsl:template match="*[local-name() = 'annotation']">
3043
- <xsl:variable name="annotation-id" select="@id"/>
3044
- <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
3045
- <fo:block id="{$annotation-id}" white-space="nowrap">
3046
- <fo:inline>
3047
- <xsl:apply-templates>
3048
- <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
3049
- </xsl:apply-templates>
3050
- </fo:inline>
3051
- </fo:block>
3052
- </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
3053
- <xsl:param name="callout"/>
3054
- <fo:inline id="{@id}">
3055
- <!-- for first p in annotation, put <x> -->
3056
- <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
3057
- <xsl:apply-templates/>
3058
- </fo:inline>
3059
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
3060
- <xsl:variable name="title-modified">
3061
-
3062
-
3063
- <xsl:call-template name="getTitle">
3064
- <xsl:with-param name="name" select="'title-modified'"/>
3065
- </xsl:call-template>
3066
-
3067
- </xsl:variable>
3068
-
3069
- <xsl:choose>
3070
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3071
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3072
- </xsl:choose>
3073
- <xsl:apply-templates/>
3074
- </xsl:template><xsl:template match="*[local-name() = 'xref']">
3075
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
3076
-
3077
- <xsl:apply-templates/>
3078
- </fo:basic-link>
3079
- </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
3080
- <fo:block-container margin-left="0mm">
3081
- <xsl:if test="parent::*[local-name() = 'note']">
3082
- <xsl:attribute name="margin-left">
3083
- <xsl:choose>
3084
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3085
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3086
- </xsl:choose>
3087
- </xsl:attribute>
3088
-
3089
- </xsl:if>
3090
- <fo:block-container margin-left="0mm">
3091
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
3092
- <xsl:apply-templates/>
3093
- </fo:block>
3094
- </fo:block-container>
3095
- </fo:block-container>
3096
- </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
3097
- <fo:inline>
3098
- <xsl:apply-templates/>
3099
- </fo:inline>
3100
- </xsl:template><xsl:template match="*[local-name() = 'admitted']/*[local-name() = 'stem']">
3101
- <fo:inline>
3102
- <xsl:apply-templates/>
3103
- </fo:inline>
3104
- </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation">
3105
- <xsl:if test="normalize-space() != ''">
3106
- <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
3107
- </xsl:if>
3108
- </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
3109
-
3110
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
3111
-
3112
-
3113
-
3114
-
3115
- <fo:block-container margin-left="0mm">
3116
-
3117
-
3118
-
3119
-
3120
-
3121
-
3122
-
3123
-
3124
- <fo:block>
3125
-
3126
-
3127
-
3128
-
3129
-
3130
-
3131
- <fo:inline xsl:use-attribute-sets="note-name-style">
3132
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3133
- </fo:inline>
3134
- <xsl:apply-templates/>
3135
- </fo:block>
3136
-
3137
-
3138
- </fo:block-container>
3139
- </fo:block-container>
3140
-
3141
- </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
3142
- <xsl:variable name="num"><xsl:number/></xsl:variable>
3143
- <xsl:choose>
3144
- <xsl:when test="$num = 1">
3145
- <fo:inline xsl:use-attribute-sets="note-p-style">
3146
- <xsl:apply-templates/>
3147
- </fo:inline>
3148
- </xsl:when>
3149
- <xsl:otherwise>
3150
- <fo:block xsl:use-attribute-sets="note-p-style">
3151
- <xsl:apply-templates/>
3152
- </fo:block>
3153
- </xsl:otherwise>
3154
- </xsl:choose>
3155
- </xsl:template><xsl:template match="*[local-name() = 'termnote']">
3156
- <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
3157
- <fo:inline xsl:use-attribute-sets="termnote-name-style">
3158
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3159
- </fo:inline>
3160
- <xsl:apply-templates/>
3161
- </fo:block>
3162
- </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name'] | *[local-name() = 'termnote']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']" mode="presentation">
3163
- <xsl:param name="sfx"/>
3164
- <xsl:variable name="suffix">
3165
- <xsl:choose>
3166
- <xsl:when test="$sfx != ''">
3167
- <xsl:value-of select="$sfx"/>
3168
- </xsl:when>
3169
- <xsl:otherwise>
3170
-
3171
-
3172
- </xsl:otherwise>
3173
- </xsl:choose>
3174
- </xsl:variable>
3175
- <xsl:if test="normalize-space() != ''">
3176
- <xsl:apply-templates/>
3177
- <xsl:value-of select="$suffix"/>
3178
- </xsl:if>
3179
- </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation">
3180
- <xsl:param name="sfx"/>
3181
- <xsl:variable name="suffix">
3182
- <xsl:choose>
3183
- <xsl:when test="$sfx != ''">
3184
- <xsl:value-of select="$sfx"/>
3185
- </xsl:when>
3186
- <xsl:otherwise>
3187
-
3188
-
3189
- </xsl:otherwise>
3190
- </xsl:choose>
3191
- </xsl:variable>
3192
- <xsl:if test="normalize-space() != ''">
3193
- <xsl:apply-templates/>
3194
- <xsl:value-of select="$suffix"/>
3195
- </xsl:if>
3196
- </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
3197
- <fo:inline><xsl:apply-templates/></fo:inline>
3198
- </xsl:template><xsl:template match="*[local-name() = 'terms']">
3199
- <fo:block id="{@id}">
3200
- <xsl:apply-templates/>
3201
- </fo:block>
3202
- </xsl:template><xsl:template match="*[local-name() = 'term']">
3203
- <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
3204
-
3205
-
3206
-
3207
- <xsl:apply-templates/>
3208
- </fo:block>
3209
- </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
3210
- <xsl:if test="normalize-space() != ''">
3211
- <fo:inline>
3212
- <xsl:apply-templates/>
3213
- <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
3214
- <xsl:text>.</xsl:text>
3215
- </xsl:if> -->
3216
- </fo:inline>
3217
- </xsl:if>
3218
- </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
3219
- <fo:block-container id="{@id}">
3220
-
3221
- <fo:block>
3222
- <xsl:apply-templates/>
3223
- </fo:block>
3224
- <xsl:call-template name="fn_display_figure"/>
3225
- <xsl:for-each select="*[local-name() = 'note']">
3226
- <xsl:call-template name="note"/>
3227
- </xsl:for-each>
3228
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3229
- </fo:block-container>
3230
- </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
3231
- <fo:block id="{@id}">
3232
- <xsl:apply-templates/>
3233
- </fo:block>
3234
- </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
3235
- <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
3236
- <xsl:apply-templates/>
3237
- </fo:block>
3238
- </xsl:template><xsl:template match="*[local-name() = 'image']">
3239
- <fo:block xsl:use-attribute-sets="image-style">
3240
-
3241
-
3242
- <xsl:variable name="src">
3243
- <xsl:choose>
3244
- <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3245
- <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3246
- </xsl:when>
3247
- <xsl:otherwise>
3248
- <xsl:value-of select="@src"/>
3249
- </xsl:otherwise>
3250
- </xsl:choose>
3251
- </xsl:variable>
3252
-
3253
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3254
- </fo:block>
3255
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
3256
- <xsl:apply-templates mode="contents"/>
3257
- <xsl:text> </xsl:text>
3258
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
3259
- <xsl:apply-templates mode="bookmarks"/>
3260
- <xsl:text> </xsl:text>
3261
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
3262
- <xsl:value-of select="."/>
3263
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
3264
- <xsl:value-of select="."/>
3265
- </xsl:template><xsl:template match="node()" mode="contents">
3266
- <xsl:apply-templates mode="contents"/>
3267
- </xsl:template><xsl:template match="node()" mode="bookmarks">
3268
- <xsl:apply-templates mode="bookmarks"/>
3269
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3270
- <xsl:apply-templates select="."/>
3271
- </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3272
- <xsl:apply-templates mode="bookmarks"/>
3273
- </xsl:template><xsl:template name="addBookmarks">
3274
- <xsl:param name="contents"/>
3275
- <xsl:if test="xalan:nodeset($contents)//item">
3276
- <fo:bookmark-tree>
3277
- <xsl:choose>
3278
- <xsl:when test="xalan:nodeset($contents)/doc">
3279
- <xsl:choose>
3280
- <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3281
- <xsl:for-each select="xalan:nodeset($contents)/doc">
3282
- <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3283
- <fo:bookmark-title>
3284
- <xsl:variable name="bookmark-title_">
3285
- <xsl:call-template name="getLangVersion">
3286
- <xsl:with-param name="lang" select="@lang"/>
3287
- <xsl:with-param name="doctype" select="@doctype"/>
3288
- <xsl:with-param name="title" select="@title-part"/>
3289
- </xsl:call-template>
3290
- </xsl:variable>
3291
- <xsl:choose>
3292
- <xsl:when test="normalize-space($bookmark-title_) != ''">
3293
- <xsl:value-of select="normalize-space($bookmark-title_)"/>
3294
- </xsl:when>
3295
- <xsl:otherwise>
3296
- <xsl:choose>
3297
- <xsl:when test="@lang = 'en'">English</xsl:when>
3298
- <xsl:when test="@lang = 'fr'">Français</xsl:when>
3299
- <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3300
- <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3301
- </xsl:choose>
3302
- </xsl:otherwise>
3303
- </xsl:choose>
3304
- </fo:bookmark-title>
3305
- <xsl:apply-templates select="contents/item" mode="bookmark"/>
3306
-
3307
- <xsl:call-template name="insertFigureBookmarks">
3308
- <xsl:with-param name="contents" select="contents"/>
3309
- </xsl:call-template>
3310
-
3311
- <xsl:call-template name="insertTableBookmarks">
3312
- <xsl:with-param name="contents" select="contents"/>
3313
- <xsl:with-param name="lang" select="@lang"/>
3314
- </xsl:call-template>
3315
-
3316
- </fo:bookmark>
3317
-
3318
- </xsl:for-each>
3319
- </xsl:when>
3320
- <xsl:otherwise>
3321
- <xsl:for-each select="xalan:nodeset($contents)/doc">
3322
-
3323
- <xsl:apply-templates select="contents/item" mode="bookmark"/>
3324
-
3325
- <xsl:call-template name="insertFigureBookmarks">
3326
- <xsl:with-param name="contents" select="contents"/>
3327
- </xsl:call-template>
3328
-
3329
- <xsl:call-template name="insertTableBookmarks">
3330
- <xsl:with-param name="contents" select="contents"/>
3331
- <xsl:with-param name="lang" select="@lang"/>
3332
- </xsl:call-template>
3333
-
3334
- </xsl:for-each>
3335
- </xsl:otherwise>
3336
- </xsl:choose>
3337
- </xsl:when>
3338
- <xsl:otherwise>
3339
- <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
3340
- </xsl:otherwise>
3341
- </xsl:choose>
3342
-
3343
-
3344
-
3345
-
3346
-
3347
-
3348
-
3349
-
3350
- </fo:bookmark-tree>
3351
- </xsl:if>
3352
- </xsl:template><xsl:template name="insertFigureBookmarks">
3353
- <xsl:param name="contents"/>
3354
- <xsl:if test="xalan:nodeset($contents)/figure">
3355
- <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
3356
- <fo:bookmark-title>Figures</fo:bookmark-title>
3357
- <xsl:for-each select="xalan:nodeset($contents)/figure">
3358
- <fo:bookmark internal-destination="{@id}">
3359
- <fo:bookmark-title>
3360
- <xsl:value-of select="normalize-space(title)"/>
3361
- </fo:bookmark-title>
3362
- </fo:bookmark>
3363
- </xsl:for-each>
3364
- </fo:bookmark>
3365
- </xsl:if>
3366
- </xsl:template><xsl:template name="insertTableBookmarks">
3367
- <xsl:param name="contents"/>
3368
- <xsl:param name="lang"/>
3369
- <xsl:if test="xalan:nodeset($contents)/table">
3370
- <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
3371
- <fo:bookmark-title>
3372
- <xsl:choose>
3373
- <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
3374
- <xsl:otherwise>Tables</xsl:otherwise>
3375
- </xsl:choose>
3376
- </fo:bookmark-title>
3377
- <xsl:for-each select="xalan:nodeset($contents)/table">
3378
- <fo:bookmark internal-destination="{@id}">
3379
- <fo:bookmark-title>
3380
- <xsl:value-of select="normalize-space(title)"/>
3381
- </fo:bookmark-title>
3382
- </fo:bookmark>
3383
- </xsl:for-each>
3384
- </fo:bookmark>
3385
- </xsl:if>
3386
- </xsl:template><xsl:template name="getLangVersion">
3387
- <xsl:param name="lang"/>
3388
- <xsl:param name="doctype" select="''"/>
3389
- <xsl:param name="title" select="''"/>
3390
- <xsl:choose>
3391
- <xsl:when test="$lang = 'en'">
3392
-
3393
-
3394
- </xsl:when>
3395
- <xsl:when test="$lang = 'fr'">
3396
-
3397
-
3398
- </xsl:when>
3399
- <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3400
- <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3401
- </xsl:choose>
3402
- </xsl:template><xsl:template match="item" mode="bookmark">
3403
- <fo:bookmark internal-destination="{@id}" starting-state="hide">
3404
- <fo:bookmark-title>
3405
- <xsl:if test="@section != ''">
3406
- <xsl:value-of select="@section"/>
3407
- <xsl:text> </xsl:text>
3408
- </xsl:if>
3409
- <xsl:value-of select="normalize-space(title)"/>
3410
- </fo:bookmark-title>
3411
- <xsl:apply-templates mode="bookmark"/>
3412
- </fo:bookmark>
3413
- </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3414
- <xsl:if test="normalize-space() != ''">
3415
- <fo:block xsl:use-attribute-sets="figure-name-style">
3416
-
3417
- <xsl:apply-templates/>
3418
- </fo:block>
3419
- </xsl:if>
3420
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/><xsl:template match="*[local-name() = 'title']" mode="contents_item">
3421
- <xsl:apply-templates mode="contents_item"/>
3422
- <!-- <xsl:text> </xsl:text> -->
3423
- </xsl:template><xsl:template name="getSection">
3424
- <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3425
- <!--
3426
- <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
3427
- <xsl:value-of select="."/>
3428
- </xsl:for-each>
3429
- -->
3430
-
3431
- </xsl:template><xsl:template name="getName">
3432
- <xsl:choose>
3433
- <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
3434
- <xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/>
3435
- </xsl:when>
3436
- <xsl:otherwise>
3437
- <xsl:copy-of select="*[local-name() = 'title']/node()"/>
3438
- </xsl:otherwise>
3439
- </xsl:choose>
3440
- </xsl:template><xsl:template name="insertTitleAsListItem">
3441
- <xsl:param name="provisional-distance-between-starts" select="'9.5mm'"/>
3442
- <xsl:variable name="section">
3443
- <xsl:for-each select="..">
3444
- <xsl:call-template name="getSection"/>
3445
- </xsl:for-each>
3446
- </xsl:variable>
3447
- <fo:list-block provisional-distance-between-starts="{$provisional-distance-between-starts}">
3448
- <fo:list-item>
3449
- <fo:list-item-label end-indent="label-end()">
3450
- <fo:block>
3451
- <xsl:value-of select="$section"/>
3452
- </fo:block>
3453
- </fo:list-item-label>
3454
- <fo:list-item-body start-indent="body-start()">
3455
- <fo:block>
3456
- <xsl:choose>
3457
- <xsl:when test="*[local-name() = 'tab']">
3458
- <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
3459
- </xsl:when>
3460
- <xsl:otherwise>
3461
- <xsl:apply-templates/>
3462
- </xsl:otherwise>
3463
- </xsl:choose>
3464
- </fo:block>
3465
- </fo:list-item-body>
3466
- </fo:list-item>
3467
- </fo:list-block>
3468
- </xsl:template><xsl:template name="extractTitle">
3469
- <xsl:choose>
3470
- <xsl:when test="*[local-name() = 'tab']">
3471
- <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
3472
- </xsl:when>
3473
- <xsl:otherwise>
3474
- <xsl:apply-templates/>
3475
- </xsl:otherwise>
3476
- </xsl:choose>
3477
- </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
3478
- <xsl:text> </xsl:text>
3479
- </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
3480
- <xsl:copy>
3481
- <xsl:apply-templates mode="contents_item"/>
3482
- </xsl:copy>
3483
- </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
3484
- <xsl:copy>
3485
- <xsl:apply-templates mode="contents_item"/>
3486
- </xsl:copy>
3487
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
3488
- <xsl:copy-of select="."/>
3489
- </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3490
- <xsl:text> </xsl:text>
3491
- </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3492
-
3493
- <fo:block-container margin-left="0mm">
3494
- <xsl:if test="parent::*[local-name() = 'note']">
3495
- <xsl:attribute name="margin-left">
3496
- <xsl:choose>
3497
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3498
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3499
- </xsl:choose>
3500
- </xsl:attribute>
3501
-
3502
- </xsl:if>
3503
- <fo:block-container margin-left="0mm">
3504
-
3505
- <fo:block xsl:use-attribute-sets="sourcecode-style">
3506
- <xsl:variable name="_font-size">
3507
-
3508
- 10
3509
-
3510
-
3511
-
3512
-
3513
-
3514
-
3515
-
3516
-
3517
-
3518
-
3519
-
3520
-
3521
-
3522
- </xsl:variable>
3523
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3524
- <xsl:if test="$font-size != ''">
3525
- <xsl:attribute name="font-size">
3526
- <xsl:choose>
3527
- <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3528
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3529
- </xsl:choose>
3530
- </xsl:attribute>
3531
- </xsl:if>
3532
- <xsl:apply-templates/>
3533
- </fo:block>
3534
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3535
-
3536
- </fo:block-container>
3537
- </fo:block-container>
3538
- </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
3539
- <xsl:variable name="text">
3540
- <xsl:call-template name="add-zero-spaces-equal"/>
3541
- </xsl:variable>
3542
- <xsl:call-template name="add-zero-spaces-java">
3543
- <xsl:with-param name="text" select="$text"/>
3544
- </xsl:call-template>
3545
- </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
3546
- <xsl:if test="normalize-space() != ''">
3547
- <fo:block xsl:use-attribute-sets="sourcecode-name-style">
3548
- <xsl:apply-templates/>
3549
- </fo:block>
3550
- </xsl:if>
3551
- </xsl:template><xsl:template match="*[local-name() = 'permission']">
3552
- <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
3553
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3554
- <xsl:apply-templates/>
3555
- </fo:block>
3556
- </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation">
3557
- <xsl:if test="normalize-space() != ''">
3558
- <fo:block xsl:use-attribute-sets="permission-name-style">
3559
- <xsl:apply-templates/>
3560
-
3561
- </fo:block>
3562
- </xsl:if>
3563
- </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'label']">
3564
- <fo:block xsl:use-attribute-sets="permission-label-style">
3565
- <xsl:apply-templates/>
3566
- </fo:block>
3567
- </xsl:template><xsl:template match="*[local-name() = 'requirement']">
3568
- <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
3569
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3570
- <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/>
3571
- <xsl:apply-templates select="@obligation" mode="presentation"/>
3572
- <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/>
3573
- <xsl:apply-templates/>
3574
- </fo:block>
3575
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation">
3576
- <xsl:if test="normalize-space() != ''">
3577
- <fo:block xsl:use-attribute-sets="requirement-name-style">
3578
-
3579
- <xsl:apply-templates/>
3580
-
3581
- </fo:block>
3582
- </xsl:if>
3583
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation">
3584
- <fo:block xsl:use-attribute-sets="requirement-label-style">
3585
- <xsl:apply-templates/>
3586
- </fo:block>
3587
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation">
3588
- <fo:block>
3589
- <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
3590
- </fo:block>
3591
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
3592
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
3593
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
3594
- </fo:block>
3595
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
3596
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
3597
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
3598
- </fo:block>
3599
- </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
3600
- <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
3601
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3602
- <xsl:apply-templates/>
3603
- </fo:block>
3604
- </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation">
3605
- <xsl:if test="normalize-space() != ''">
3606
- <fo:block xsl:use-attribute-sets="recommendation-name-style">
3607
- <xsl:apply-templates/>
3608
-
3609
- </fo:block>
3610
- </xsl:if>
3611
- </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'label']">
3612
- <fo:block xsl:use-attribute-sets="recommendation-label-style">
3613
- <xsl:apply-templates/>
3614
- </fo:block>
3615
- </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3616
- <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
3617
- <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3618
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3619
- </xsl:if>
3620
- <fo:block-container margin-left="0mm" margin-right="0mm">
3621
- <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
3622
- <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3623
- <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
3624
- </xsl:if>
3625
- <xsl:variable name="simple-table">
3626
- <xsl:call-template name="getSimpleTable"/>
3627
- </xsl:variable>
3628
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
3629
- <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
3630
- <!-- <fo:table-column column-width="35mm"/>
3631
- <fo:table-column column-width="115mm"/> -->
3632
- <fo:table-column column-width="30%"/>
3633
- <fo:table-column column-width="70%"/>
3634
- </xsl:if>
3635
- <xsl:apply-templates mode="requirement"/>
3636
- </fo:table>
3637
- <!-- fn processing -->
3638
- <xsl:if test=".//*[local-name() = 'fn']">
3639
- <xsl:for-each select="*[local-name() = 'tbody']">
3640
- <fo:block font-size="90%" border-bottom="1pt solid black">
3641
- <xsl:call-template name="fn_display"/>
3642
- </fo:block>
3643
- </xsl:for-each>
3644
- </xsl:if>
3645
- </fo:block-container>
3646
- </fo:block-container>
3647
- </xsl:template><xsl:template match="*[local-name()='thead']" mode="requirement">
3648
- <fo:table-header>
3649
- <xsl:apply-templates mode="requirement"/>
3650
- </fo:table-header>
3651
- </xsl:template><xsl:template match="*[local-name()='tbody']" mode="requirement">
3652
- <fo:table-body>
3653
- <xsl:apply-templates mode="requirement"/>
3654
- </fo:table-body>
3655
- </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
3656
- <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
3657
- <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
3658
- <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
3659
- <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
3660
- </xsl:if>
3661
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
3662
- <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
3663
- </xsl:if>
3664
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
3665
- <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
3666
- </xsl:if>
3667
- <xsl:apply-templates mode="requirement"/>
3668
- </fo:table-row>
3669
- </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
3670
- <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3671
- <xsl:attribute name="text-align">
3672
- <xsl:choose>
3673
- <xsl:when test="@align">
3674
- <xsl:value-of select="@align"/>
3675
- </xsl:when>
3676
- <xsl:otherwise>left</xsl:otherwise>
3677
- </xsl:choose>
3678
- </xsl:attribute>
3679
- <xsl:if test="@colspan">
3680
- <xsl:attribute name="number-columns-spanned">
3681
- <xsl:value-of select="@colspan"/>
3682
- </xsl:attribute>
3683
- </xsl:if>
3684
- <xsl:if test="@rowspan">
3685
- <xsl:attribute name="number-rows-spanned">
3686
- <xsl:value-of select="@rowspan"/>
3687
- </xsl:attribute>
3688
- </xsl:if>
3689
- <xsl:call-template name="display-align"/>
3690
-
3691
- <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3692
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3693
- <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
3694
- </xsl:if>
3695
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
3696
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3697
- <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3698
- </xsl:if> -->
3699
-
3700
- <fo:block>
3701
- <xsl:apply-templates/>
3702
- </fo:block>
3703
- </fo:table-cell>
3704
- </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
3705
- <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3706
- <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3707
- <xsl:attribute name="padding">0mm</xsl:attribute>
3708
- <xsl:attribute name="padding-left">0mm</xsl:attribute>
3709
- </xsl:if>
3710
- <xsl:attribute name="text-align">
3711
- <xsl:choose>
3712
- <xsl:when test="@align">
3713
- <xsl:value-of select="@align"/>
3714
- </xsl:when>
3715
- <xsl:otherwise>left</xsl:otherwise>
3716
- </xsl:choose>
3717
- </xsl:attribute>
3718
- <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
3719
- <xsl:attribute name="font-weight">bold</xsl:attribute>
3720
- </xsl:if>
3721
- <xsl:if test="@colspan">
3722
- <xsl:attribute name="number-columns-spanned">
3723
- <xsl:value-of select="@colspan"/>
3724
- </xsl:attribute>
3725
- </xsl:if>
3726
- <xsl:if test="@rowspan">
3727
- <xsl:attribute name="number-rows-spanned">
3728
- <xsl:value-of select="@rowspan"/>
3729
- </xsl:attribute>
3730
- </xsl:if>
3731
- <xsl:call-template name="display-align"/>
3732
-
3733
- <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3734
- <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
3735
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3736
- <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
3737
- <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3738
- </xsl:if>
3739
- </xsl:if> -->
3740
- <!-- 2nd line and below -->
3741
-
3742
- <fo:block>
3743
- <xsl:apply-templates/>
3744
- </fo:block>
3745
- </fo:table-cell>
3746
- </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
3747
- <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
3748
- <xsl:apply-templates/>
3749
- </fo:block>
3750
- </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
3751
- <fo:block> <!-- margin-bottom="10pt" -->
3752
- <xsl:apply-templates/>
3753
- </fo:block>
3754
- </xsl:template><xsl:template match="*[local-name() = 'termexample']">
3755
- <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
3756
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3757
- <xsl:apply-templates/>
3758
- </fo:block>
3759
- </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation">
3760
- <xsl:if test="normalize-space() != ''">
3761
- <fo:inline xsl:use-attribute-sets="termexample-name-style">
3762
- <xsl:apply-templates/>
3763
- </fo:inline>
3764
- </xsl:if>
3765
- </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
3766
- <fo:inline><xsl:apply-templates/></fo:inline>
3767
- </xsl:template><xsl:template match="*[local-name() = 'example']">
3768
- <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
3769
-
3770
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3771
-
3772
- <xsl:variable name="element">
3773
- block
3774
-
3775
- <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
3776
- </xsl:variable>
3777
-
3778
- <xsl:choose>
3779
- <xsl:when test="contains(normalize-space($element), 'block')">
3780
- <fo:block xsl:use-attribute-sets="example-body-style">
3781
- <xsl:apply-templates/>
3782
- </fo:block>
3783
- </xsl:when>
3784
- <xsl:otherwise>
3785
- <fo:inline>
3786
- <xsl:apply-templates/>
3787
- </fo:inline>
3788
- </xsl:otherwise>
3789
- </xsl:choose>
3790
-
3791
- </fo:block>
3792
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
3793
-
3794
- <xsl:variable name="element">
3795
- block
3796
-
3797
- </xsl:variable>
3798
- <xsl:choose>
3799
- <xsl:when test="ancestor::*[local-name() = 'appendix']">
3800
- <fo:inline>
3801
- <xsl:apply-templates/>
3802
- </fo:inline>
3803
- </xsl:when>
3804
- <xsl:when test="normalize-space($element) = 'block'">
3805
- <fo:block xsl:use-attribute-sets="example-name-style">
3806
- <xsl:apply-templates/>
3807
- </fo:block>
3808
- </xsl:when>
3809
- <xsl:otherwise>
3810
- <fo:inline xsl:use-attribute-sets="example-name-style">
3811
- <xsl:apply-templates/>
3812
- </fo:inline>
3813
- </xsl:otherwise>
3814
- </xsl:choose>
3815
-
3816
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3817
-
3818
- <xsl:variable name="element">
3819
- block
3820
-
3821
- </xsl:variable>
3822
- <xsl:choose>
3823
- <xsl:when test="normalize-space($element) = 'block'">
3824
- <fo:block xsl:use-attribute-sets="example-p-style">
3825
-
3826
- <xsl:apply-templates/>
3827
- </fo:block>
3828
- </xsl:when>
3829
- <xsl:otherwise>
3830
- <fo:inline xsl:use-attribute-sets="example-p-style">
3831
- <xsl:apply-templates/>
3832
- </fo:inline>
3833
- </xsl:otherwise>
3834
- </xsl:choose>
3835
- </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3836
- <fo:block xsl:use-attribute-sets="termsource-style">
3837
- <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3838
- <xsl:variable name="termsource_text">
3839
- <xsl:apply-templates/>
3840
- </xsl:variable>
3841
-
3842
- <xsl:choose>
3843
- <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3844
- <xsl:apply-templates/>
3845
- </xsl:when>
3846
- <xsl:otherwise>
3847
-
3848
- <xsl:text>[</xsl:text>
3849
-
3850
- <xsl:apply-templates/>
3851
-
3852
- <xsl:text>]</xsl:text>
3853
-
3854
- </xsl:otherwise>
3855
- </xsl:choose>
3856
- </fo:block>
3857
- </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
3858
- <xsl:if test="normalize-space() != ''">
3859
- <xsl:value-of select="."/>
3860
- </xsl:if>
3861
- </xsl:template><xsl:template match="*[local-name() = 'origin']">
3862
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3863
-
3864
- <fo:inline>
3865
-
3866
-
3867
-
3868
-
3869
- <xsl:call-template name="getTitle">
3870
- <xsl:with-param name="name" select="'title-source'"/>
3871
- </xsl:call-template>
3872
-
3873
-
3874
- <xsl:text>: </xsl:text>
3875
- </fo:inline>
3876
-
3877
- <fo:inline xsl:use-attribute-sets="origin-style">
3878
- <xsl:apply-templates/>
3879
- </fo:inline>
3880
- </fo:basic-link>
3881
- </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
3882
- <fo:inline><xsl:apply-templates/></fo:inline>
3883
- </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
3884
- <xsl:if test="normalize-space() != ''">
3885
- <xsl:value-of select="."/>
3886
- </xsl:if>
3887
- </xsl:template><xsl:template match="*[local-name() = 'quote']">
3888
- <fo:block-container margin-left="0mm">
3889
- <xsl:if test="parent::*[local-name() = 'note']">
3890
- <xsl:if test="not(ancestor::*[local-name() = 'table'])">
3891
- <xsl:attribute name="margin-left">5mm</xsl:attribute>
3892
- </xsl:if>
3893
- </xsl:if>
3894
-
3895
-
3896
- <fo:block-container margin-left="0mm">
3897
-
3898
- <fo:block xsl:use-attribute-sets="quote-style">
3899
- <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
3900
-
3901
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
3902
- </fo:block>
3903
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3904
- <fo:block xsl:use-attribute-sets="quote-source-style">
3905
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
3906
- <xsl:apply-templates select="*[local-name() = 'author']"/>
3907
- <xsl:apply-templates select="*[local-name() = 'source']"/>
3908
- </fo:block>
3909
- </xsl:if>
3910
-
3911
- </fo:block-container>
3912
- </fo:block-container>
3913
- </xsl:template><xsl:template match="*[local-name() = 'source']">
3914
- <xsl:if test="../*[local-name() = 'author']">
3915
- <xsl:text>, </xsl:text>
3916
- </xsl:if>
3917
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3918
- <xsl:apply-templates/>
3919
- </fo:basic-link>
3920
- </xsl:template><xsl:template match="*[local-name() = 'author']">
3921
- <xsl:text>— </xsl:text>
3922
- <xsl:apply-templates/>
3923
- </xsl:template><xsl:template match="*[local-name() = 'eref']">
3924
- <fo:inline xsl:use-attribute-sets="eref-style">
3925
- <xsl:if test="@type = 'footnote'">
3926
-
3927
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
3928
- <xsl:attribute name="font-size">80%</xsl:attribute>
3929
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3930
- <xsl:attribute name="vertical-align">super</xsl:attribute>
3931
-
3932
-
3933
- </xsl:if>
3934
-
3935
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3936
-
3937
- <xsl:if test="@type = 'inline'">
3938
-
3939
- <xsl:attribute name="color">blue</xsl:attribute>
3940
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
3941
-
3942
-
3943
-
3944
- </xsl:if>
3945
-
3946
-
3947
- <xsl:apply-templates/>
3948
- </fo:basic-link>
3949
- </fo:inline>
3950
- </xsl:template><xsl:template match="*[local-name() = 'tab']">
3951
- <!-- zero-space char -->
3952
- <xsl:variable name="depth">
3953
- <xsl:call-template name="getLevel">
3954
- <xsl:with-param name="depth" select="../@depth"/>
3955
- </xsl:call-template>
3956
- </xsl:variable>
3957
-
3958
- <xsl:variable name="padding">
3959
-
3960
-
3961
- <xsl:choose>
3962
- <xsl:when test="$depth &gt;= 3">3</xsl:when>
3963
- <xsl:when test="$depth = 1">3</xsl:when>
3964
- <xsl:otherwise>2</xsl:otherwise>
3965
- </xsl:choose>
3966
-
3967
-
3968
-
3969
-
3970
-
3971
-
3972
-
3973
-
3974
-
3975
-
3976
-
3977
-
3978
-
3979
-
3980
-
3981
-
3982
-
3983
- </xsl:variable>
3984
-
3985
- <xsl:variable name="padding-right">
3986
- <xsl:choose>
3987
- <xsl:when test="normalize-space($padding) = ''">0</xsl:when>
3988
- <xsl:otherwise>
3989
- <xsl:value-of select="normalize-space($padding)"/>
3990
- </xsl:otherwise>
3991
- </xsl:choose>
3992
- </xsl:variable>
3993
-
3994
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3995
-
3996
- <xsl:choose>
3997
- <xsl:when test="$language = 'zh'">
3998
- <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
3999
- </xsl:when>
4000
- <xsl:when test="../../@inline-header = 'true'">
4001
- <fo:inline font-size="90%">
4002
- <xsl:call-template name="insertNonBreakSpaces">
4003
- <xsl:with-param name="count" select="$padding-right"/>
4004
- </xsl:call-template>
4005
- </fo:inline>
4006
- </xsl:when>
4007
- <xsl:otherwise>
4008
- <fo:inline padding-right="{$padding-right}mm">​</fo:inline>
4009
- </xsl:otherwise>
4010
- </xsl:choose>
4011
-
4012
- </xsl:template><xsl:template name="insertNonBreakSpaces">
4013
- <xsl:param name="count"/>
4014
- <xsl:if test="$count &gt; 0">
4015
- <xsl:text> </xsl:text>
4016
- <xsl:call-template name="insertNonBreakSpaces">
4017
- <xsl:with-param name="count" select="$count - 1"/>
4018
- </xsl:call-template>
4019
- </xsl:if>
4020
- </xsl:template><xsl:template match="*[local-name() = 'domain']">
4021
- <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
4022
- <xsl:text> </xsl:text>
4023
- </xsl:template><xsl:template match="*[local-name() = 'admitted']">
4024
- <fo:block xsl:use-attribute-sets="admitted-style">
4025
- <xsl:apply-templates/>
4026
- </fo:block>
4027
- </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
4028
- <xsl:variable name="title-deprecated">
4029
-
4030
-
4031
- <xsl:call-template name="getTitle">
4032
- <xsl:with-param name="name" select="'title-deprecated'"/>
4033
- </xsl:call-template>
4034
-
4035
- </xsl:variable>
4036
- <fo:block xsl:use-attribute-sets="deprecates-style">
4037
- <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
4038
- </fo:block>
4039
- </xsl:template><xsl:template match="*[local-name() = 'definition']">
4040
- <fo:block xsl:use-attribute-sets="definition-style">
4041
- <xsl:apply-templates/>
4042
- </fo:block>
4043
- </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
4044
- <xsl:apply-templates/>
4045
- </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
4046
- <fo:inline> <xsl:apply-templates/></fo:inline>
4047
- <fo:block> </fo:block>
4048
- </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
4049
-
4050
- <fo:block>
4051
- <xsl:call-template name="setId"/>
4052
-
4053
-
4054
- <xsl:variable name="pos"><xsl:number count="csd:sections/csd:clause | csd:sections/csd:terms"/></xsl:variable>
4055
- <xsl:if test="$pos &gt;= 2">
4056
- <xsl:attribute name="space-before">18pt</xsl:attribute>
4057
- </xsl:if>
4058
-
4059
-
4060
-
4061
-
4062
-
4063
-
4064
-
4065
-
4066
-
4067
-
4068
- <xsl:apply-templates/>
4069
- </fo:block>
4070
-
4071
-
4072
-
4073
- </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
4074
- <fo:block break-after="page"/>
4075
- <fo:block>
4076
- <xsl:call-template name="setId"/>
4077
- <xsl:apply-templates/>
4078
- </fo:block>
4079
- </xsl:template><xsl:template match="*[local-name() = 'clause']">
4080
- <fo:block>
4081
- <xsl:call-template name="setId"/>
4082
-
4083
-
4084
- <xsl:apply-templates/>
4085
- </fo:block>
4086
- </xsl:template><xsl:template match="*[local-name() = 'definitions']">
4087
- <fo:block id="{@id}">
4088
- <xsl:apply-templates/>
4089
- </fo:block>
4090
- </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
4091
-
4092
- <fo:block id="{@id}">
4093
- <xsl:apply-templates/>
4094
- </fo:block>
4095
- </xsl:template><xsl:template match="*[local-name() = 'annex']">
4096
- <fo:block break-after="page"/>
4097
- <fo:block id="{@id}">
4098
-
4099
- </fo:block>
4100
- <xsl:apply-templates/>
4101
- </xsl:template><xsl:template match="*[local-name() = 'review']">
4102
- <!-- comment 2019-11-29 -->
4103
- <!-- <fo:block font-weight="bold">Review:</fo:block>
4104
- <xsl:apply-templates /> -->
4105
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
4106
- <!-- 0xA0 to space replacement -->
4107
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
4108
- </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
4109
- <xsl:choose>
4110
- <xsl:when test="parent::*[local-name() = 'note']">
4111
- <fo:block-container>
4112
- <xsl:attribute name="margin-left">
4113
- <xsl:choose>
4114
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
4115
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4116
- </xsl:choose>
4117
- </xsl:attribute>
4118
-
4119
-
4120
- <fo:block-container margin-left="0mm">
4121
- <fo:block>
4122
- <xsl:apply-templates select="." mode="ul_ol"/>
4123
- </fo:block>
4124
- </fo:block-container>
4125
- </fo:block-container>
4126
- </xsl:when>
4127
- <xsl:otherwise>
4128
- <fo:block>
4129
- <xsl:apply-templates select="." mode="ul_ol"/>
4130
- </fo:block>
4131
- </xsl:otherwise>
4132
- </xsl:choose>
4133
- </xsl:template><xsl:template match="*[local-name() = 'errata']">
4134
- <!-- <row>
4135
- <date>05-07-2013</date>
4136
- <type>Editorial</type>
4137
- <change>Changed CA-9 Priority Code from P1 to P2 in <xref target="tabled2"/>.</change>
4138
- <pages>D-3</pages>
4139
- </row>
4140
- -->
4141
- <fo:table table-layout="fixed" width="100%" font-size="10pt" border="1pt solid black">
4142
- <fo:table-column column-width="20mm"/>
4143
- <fo:table-column column-width="23mm"/>
4144
- <fo:table-column column-width="107mm"/>
4145
- <fo:table-column column-width="15mm"/>
4146
- <fo:table-body>
4147
- <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
4148
-
4149
- <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
4150
- <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
4151
- <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
4152
- <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
4153
- </fo:table-row>
4154
- <xsl:apply-templates/>
4155
- </fo:table-body>
4156
- </fo:table>
4157
- </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']">
4158
- <fo:table-row>
4159
- <xsl:apply-templates/>
4160
- </fo:table-row>
4161
- </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
4162
- <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
4163
- <fo:block><xsl:apply-templates/></fo:block>
4164
- </fo:table-cell>
4165
- </xsl:template><xsl:template name="processBibitem">
4166
-
4167
-
4168
- <!-- end BIPM bibitem processing-->
4169
-
4170
-
4171
-
4172
-
4173
-
4174
- </xsl:template><xsl:template name="processBibitemDocId">
4175
- <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
4176
- <xsl:choose>
4177
- <xsl:when test="normalize-space($_doc_ident) != ''">
4178
- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
4179
- <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
4180
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4181
- </xsl:if>
4182
- <xsl:value-of select="$_doc_ident"/>
4183
- </xsl:when>
4184
- <xsl:otherwise>
4185
- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
4186
- <xsl:if test="$type != ''">
4187
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4188
- </xsl:if>
4189
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
4190
- </xsl:otherwise>
4191
- </xsl:choose>
4192
- </xsl:template><xsl:template name="processPersonalAuthor">
4193
- <xsl:choose>
4194
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
4195
- <author>
4196
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
4197
- </author>
4198
- </xsl:when>
4199
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
4200
- <author>
4201
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
4202
- <xsl:text> </xsl:text>
4203
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
4204
- </author>
4205
- </xsl:when>
4206
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
4207
- <author>
4208
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
4209
- <xsl:text> </xsl:text>
4210
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
4211
- </author>
4212
- </xsl:when>
4213
- <xsl:otherwise>
4214
- <xsl:apply-templates/>
4215
- </xsl:otherwise>
4216
- </xsl:choose>
4217
- </xsl:template><xsl:template name="renderDate">
4218
- <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
4219
- <xsl:value-of select="*[local-name() = 'on']"/>
4220
- </xsl:if>
4221
- <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
4222
- <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
4223
- </xsl:if>
4224
- </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
4225
- <xsl:value-of select="translate(.,'. ','')"/>
4226
- </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
4227
- <xsl:value-of select="substring(.,1,1)"/>
4228
- </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
4229
- <fo:inline><xsl:apply-templates/></fo:inline>
4230
- </xsl:template><xsl:template name="convertDate">
4231
- <xsl:param name="date"/>
4232
- <xsl:param name="format" select="'short'"/>
4233
- <xsl:variable name="year" select="substring($date, 1, 4)"/>
4234
- <xsl:variable name="month" select="substring($date, 6, 2)"/>
4235
- <xsl:variable name="day" select="substring($date, 9, 2)"/>
4236
- <xsl:variable name="monthStr">
4237
- <xsl:choose>
4238
- <xsl:when test="$month = '01'">January</xsl:when>
4239
- <xsl:when test="$month = '02'">February</xsl:when>
4240
- <xsl:when test="$month = '03'">March</xsl:when>
4241
- <xsl:when test="$month = '04'">April</xsl:when>
4242
- <xsl:when test="$month = '05'">May</xsl:when>
4243
- <xsl:when test="$month = '06'">June</xsl:when>
4244
- <xsl:when test="$month = '07'">July</xsl:when>
4245
- <xsl:when test="$month = '08'">August</xsl:when>
4246
- <xsl:when test="$month = '09'">September</xsl:when>
4247
- <xsl:when test="$month = '10'">October</xsl:when>
4248
- <xsl:when test="$month = '11'">November</xsl:when>
4249
- <xsl:when test="$month = '12'">December</xsl:when>
4250
- </xsl:choose>
4251
- </xsl:variable>
4252
- <xsl:variable name="result">
4253
- <xsl:choose>
4254
- <xsl:when test="$format = 'ddMMyyyy'">
4255
- <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4256
- <xsl:text> </xsl:text>
4257
- <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4258
- </xsl:when>
4259
- <xsl:when test="$format = 'ddMM'">
4260
- <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4261
- <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4262
- </xsl:when>
4263
- <xsl:when test="$format = 'short' or $day = ''">
4264
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
4265
- </xsl:when>
4266
- <xsl:otherwise>
4267
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
4268
- </xsl:otherwise>
4269
- </xsl:choose>
4270
- </xsl:variable>
4271
- <xsl:value-of select="$result"/>
4272
- </xsl:template><xsl:template name="convertDateLocalized">
4273
- <xsl:param name="date"/>
4274
- <xsl:param name="format" select="'short'"/>
4275
- <xsl:variable name="year" select="substring($date, 1, 4)"/>
4276
- <xsl:variable name="month" select="substring($date, 6, 2)"/>
4277
- <xsl:variable name="day" select="substring($date, 9, 2)"/>
4278
- <xsl:variable name="monthStr">
4279
- <xsl:choose>
4280
- <xsl:when test="$month = '01'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_january</xsl:with-param></xsl:call-template></xsl:when>
4281
- <xsl:when test="$month = '02'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_february</xsl:with-param></xsl:call-template></xsl:when>
4282
- <xsl:when test="$month = '03'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_march</xsl:with-param></xsl:call-template></xsl:when>
4283
- <xsl:when test="$month = '04'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_april</xsl:with-param></xsl:call-template></xsl:when>
4284
- <xsl:when test="$month = '05'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_may</xsl:with-param></xsl:call-template></xsl:when>
4285
- <xsl:when test="$month = '06'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_june</xsl:with-param></xsl:call-template></xsl:when>
4286
- <xsl:when test="$month = '07'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_july</xsl:with-param></xsl:call-template></xsl:when>
4287
- <xsl:when test="$month = '08'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_august</xsl:with-param></xsl:call-template></xsl:when>
4288
- <xsl:when test="$month = '09'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_september</xsl:with-param></xsl:call-template></xsl:when>
4289
- <xsl:when test="$month = '10'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_october</xsl:with-param></xsl:call-template></xsl:when>
4290
- <xsl:when test="$month = '11'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_november</xsl:with-param></xsl:call-template></xsl:when>
4291
- <xsl:when test="$month = '12'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_december</xsl:with-param></xsl:call-template></xsl:when>
4292
- </xsl:choose>
4293
- </xsl:variable>
4294
- <xsl:variable name="result">
4295
- <xsl:choose>
4296
- <xsl:when test="$format = 'ddMMyyyy'">
4297
- <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4298
- <xsl:text> </xsl:text>
4299
- <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4300
- </xsl:when>
4301
- <xsl:when test="$format = 'ddMM'">
4302
- <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4303
- <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4304
- </xsl:when>
4305
- <xsl:when test="$format = 'short' or $day = ''">
4306
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
4307
- </xsl:when>
4308
- <xsl:otherwise>
4309
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
4310
- </xsl:otherwise>
4311
- </xsl:choose>
4312
- </xsl:variable>
4313
- <xsl:value-of select="$result"/>
4314
- </xsl:template><xsl:template name="insertKeywords">
4315
- <xsl:param name="sorting" select="'true'"/>
4316
- <xsl:param name="charAtEnd" select="'.'"/>
4317
- <xsl:param name="charDelim" select="', '"/>
4318
- <xsl:choose>
4319
- <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
4320
- <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4321
- <xsl:sort data-type="text" order="ascending"/>
4322
- <xsl:call-template name="insertKeyword">
4323
- <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
4324
- <xsl:with-param name="charDelim" select="$charDelim"/>
4325
- </xsl:call-template>
4326
- </xsl:for-each>
4327
- </xsl:when>
4328
- <xsl:otherwise>
4329
- <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4330
- <xsl:call-template name="insertKeyword">
4331
- <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
4332
- <xsl:with-param name="charDelim" select="$charDelim"/>
4333
- </xsl:call-template>
4334
- </xsl:for-each>
4335
- </xsl:otherwise>
4336
- </xsl:choose>
4337
- </xsl:template><xsl:template name="insertKeyword">
4338
- <xsl:param name="charAtEnd"/>
4339
- <xsl:param name="charDelim"/>
4340
- <xsl:apply-templates/>
4341
- <xsl:choose>
4342
- <xsl:when test="position() != last()"><xsl:value-of select="$charDelim"/></xsl:when>
4343
- <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
4344
- </xsl:choose>
4345
- </xsl:template><xsl:template name="addPDFUAmeta">
4346
- <xsl:variable name="lang">
4347
- <xsl:call-template name="getLang"/>
4348
- </xsl:variable>
4349
- <fo:declarations>
4350
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4351
- <pdf:dictionary type="normal" key="ViewerPreferences">
4352
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4353
- </pdf:dictionary>
4354
- </pdf:catalog>
4355
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
4356
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4357
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4358
- <!-- Dublin Core properties go here -->
4359
- <dc:title>
4360
- <xsl:variable name="title">
4361
- <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4362
-
4363
-
4364
-
4365
-
4366
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
4367
-
4368
-
4369
-
4370
- </xsl:for-each>
4371
- </xsl:variable>
4372
- <xsl:choose>
4373
- <xsl:when test="normalize-space($title) != ''">
4374
- <xsl:value-of select="$title"/>
4375
- </xsl:when>
4376
- <xsl:otherwise>
4377
- <xsl:text> </xsl:text>
4378
- </xsl:otherwise>
4379
- </xsl:choose>
4380
- </dc:title>
4381
- <dc:creator>
4382
- <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4383
-
4384
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4385
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
4386
- <xsl:if test="position() != last()">; </xsl:if>
4387
- </xsl:for-each>
4388
-
4389
-
4390
-
4391
- </xsl:for-each>
4392
- </dc:creator>
4393
- <dc:description>
4394
- <xsl:variable name="abstract">
4395
-
4396
- <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4397
-
4398
-
4399
- </xsl:variable>
4400
- <xsl:value-of select="normalize-space($abstract)"/>
4401
- </dc:description>
4402
- <pdf:Keywords>
4403
- <xsl:call-template name="insertKeywords"/>
4404
- </pdf:Keywords>
4405
- </rdf:Description>
4406
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
4407
- <!-- XMP properties go here -->
4408
- <xmp:CreatorTool/>
4409
- </rdf:Description>
4410
- </rdf:RDF>
4411
- </x:xmpmeta>
4412
- </fo:declarations>
4413
- </xsl:template><xsl:template name="getId">
4414
- <xsl:choose>
4415
- <xsl:when test="../@id">
4416
- <xsl:value-of select="../@id"/>
4417
- </xsl:when>
4418
- <xsl:otherwise>
4419
- <!-- <xsl:value-of select="concat(local-name(..), '_', text())"/> -->
4420
- <xsl:value-of select="concat(generate-id(..), '_', text())"/>
4421
- </xsl:otherwise>
4422
- </xsl:choose>
4423
- </xsl:template><xsl:template name="getLevel">
4424
- <xsl:param name="depth"/>
4425
- <xsl:choose>
4426
- <xsl:when test="normalize-space(@depth) != ''">
4427
- <xsl:value-of select="@depth"/>
4428
- </xsl:when>
4429
- <xsl:when test="normalize-space($depth) != ''">
4430
- <xsl:value-of select="$depth"/>
4431
- </xsl:when>
4432
- <xsl:otherwise>
4433
- <xsl:variable name="level_total" select="count(ancestor::*)"/>
4434
- <xsl:variable name="level">
4435
- <xsl:choose>
4436
- <xsl:when test="parent::*[local-name() = 'preface']">
4437
- <xsl:value-of select="$level_total - 1"/>
4438
- </xsl:when>
4439
- <xsl:when test="ancestor::*[local-name() = 'preface']">
4440
- <xsl:value-of select="$level_total - 2"/>
4441
- </xsl:when>
4442
- <!-- <xsl:when test="parent::*[local-name() = 'sections']">
4443
- <xsl:value-of select="$level_total - 1"/>
4444
- </xsl:when> -->
4445
- <xsl:when test="ancestor::*[local-name() = 'sections']">
4446
- <xsl:value-of select="$level_total - 1"/>
4447
- </xsl:when>
4448
- <xsl:when test="ancestor::*[local-name() = 'bibliography']">
4449
- <xsl:value-of select="$level_total - 1"/>
4450
- </xsl:when>
4451
- <xsl:when test="parent::*[local-name() = 'annex']">
4452
- <xsl:value-of select="$level_total - 1"/>
4453
- </xsl:when>
4454
- <xsl:when test="ancestor::*[local-name() = 'annex']">
4455
- <xsl:value-of select="$level_total"/>
4456
- </xsl:when>
4457
- <xsl:when test="local-name() = 'annex'">1</xsl:when>
4458
- <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
4459
- <xsl:otherwise>
4460
- <xsl:value-of select="$level_total - 1"/>
4461
- </xsl:otherwise>
4462
- </xsl:choose>
4463
- </xsl:variable>
4464
- <xsl:value-of select="$level"/>
4465
- </xsl:otherwise>
4466
- </xsl:choose>
4467
- </xsl:template><xsl:template name="split">
4468
- <xsl:param name="pText" select="."/>
4469
- <xsl:param name="sep" select="','"/>
4470
- <xsl:param name="normalize-space" select="'true'"/>
4471
- <xsl:if test="string-length($pText) &gt;0">
4472
- <item>
4473
- <xsl:choose>
4474
- <xsl:when test="$normalize-space = 'true'">
4475
- <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4476
- </xsl:when>
4477
- <xsl:otherwise>
4478
- <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4479
- </xsl:otherwise>
4480
- </xsl:choose>
4481
- </item>
4482
- <xsl:call-template name="split">
4483
- <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4484
- <xsl:with-param name="sep" select="$sep"/>
4485
- <xsl:with-param name="normalize-space" select="$normalize-space"/>
4486
- </xsl:call-template>
4487
- </xsl:if>
4488
- </xsl:template><xsl:template name="getDocumentId">
4489
- <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
4490
- </xsl:template><xsl:template name="namespaceCheck">
4491
- <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
4492
- <xsl:variable name="XSLNS">
4493
-
4494
-
4495
-
4496
-
4497
-
4498
-
4499
-
4500
-
4501
-
4502
- <xsl:value-of select="document('')//*/namespace::csd"/>
4503
-
4504
-
4505
-
4506
-
4507
-
4508
-
4509
-
4510
- </xsl:variable>
4511
- <xsl:if test="$documentNS != $XSLNS">
4512
- <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
4513
- </xsl:if>
4514
- </xsl:template><xsl:template name="getLanguage">
4515
- <xsl:param name="lang"/>
4516
- <xsl:variable name="language" select="java:toLowerCase(java:java.lang.String.new($lang))"/>
4517
- <xsl:choose>
4518
- <xsl:when test="$language = 'en'">English</xsl:when>
4519
- <xsl:when test="$language = 'fr'">French</xsl:when>
4520
- <xsl:when test="$language = 'de'">Deutsch</xsl:when>
4521
- <xsl:when test="$language = 'cn'">Chinese</xsl:when>
4522
- <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
4523
- </xsl:choose>
4524
- </xsl:template><xsl:template name="setId">
4525
- <xsl:attribute name="id">
4526
- <xsl:choose>
4527
- <xsl:when test="@id">
4528
- <xsl:value-of select="@id"/>
4529
- </xsl:when>
4530
- <xsl:otherwise>
4531
- <xsl:value-of select="generate-id()"/>
4532
- </xsl:otherwise>
4533
- </xsl:choose>
4534
- </xsl:attribute>
4535
- </xsl:template><xsl:template name="add-letter-spacing">
4536
- <xsl:param name="text"/>
4537
- <xsl:param name="letter-spacing" select="'0.15'"/>
4538
- <xsl:if test="string-length($text) &gt; 0">
4539
- <xsl:variable name="char" select="substring($text, 1, 1)"/>
4540
- <fo:inline padding-right="{$letter-spacing}mm">
4541
- <xsl:if test="$char = '®'">
4542
- <xsl:attribute name="font-size">58%</xsl:attribute>
4543
- <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4544
- </xsl:if>
4545
- <xsl:value-of select="$char"/>
4546
- </fo:inline>
4547
- <xsl:call-template name="add-letter-spacing">
4548
- <xsl:with-param name="text" select="substring($text, 2)"/>
4549
- <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4550
- </xsl:call-template>
4551
- </xsl:if>
4552
- </xsl:template><xsl:template name="repeat">
4553
- <xsl:param name="char" select="'*'"/>
4554
- <xsl:param name="count"/>
4555
- <xsl:if test="$count &gt; 0">
4556
- <xsl:value-of select="$char"/>
4557
- <xsl:call-template name="repeat">
4558
- <xsl:with-param name="char" select="$char"/>
4559
- <xsl:with-param name="count" select="$count - 1"/>
4560
- </xsl:call-template>
4561
- </xsl:if>
4562
- </xsl:template><xsl:template name="getLocalizedString">
4563
- <xsl:param name="key"/>
4564
-
4565
- <xsl:variable name="curr_lang">
4566
- <xsl:call-template name="getLang"/>
4567
- </xsl:variable>
4568
-
4569
- <xsl:choose>
4570
- <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
4571
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4572
- </xsl:when>
4573
- <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
4574
- </xsl:choose>
4575
-
4576
- </xsl:template></xsl:stylesheet>