metanorma-cc 1.4.3 → 1.5.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,29 +1,8 @@
1
1
  require "isodoc"
2
- require_relative "metadata"
3
2
 
4
3
  module IsoDoc
5
4
  module CC
6
- module BaseConvert
7
- def metadata_init(lang, script, labels)
8
- @meta = Metadata.new(lang, script, labels)
9
- end
10
-
11
- def annex_name(annex, name, div)
12
- div.h1 **{ class: "Annex" } do |t|
13
- t << "#{@xrefs.anchor(annex['id'], :label)} "
14
- t.br
15
- t.b do |b|
16
- name&.children&.each { |c2| parse(c2, b) }
17
- end
18
- end
19
- end
20
-
21
- def i18n_init(lang, script)
22
- super
23
- @annex_lbl = "Appendix"
24
- @labels["annex"] = "Appendix"
25
- end
26
-
5
+ module BaseConvert
27
6
  def cleanup(docxml)
28
7
  super
29
8
  term_cleanup(docxml)
@@ -37,6 +16,6 @@ module IsoDoc
37
16
  end
38
17
  docxml
39
18
  end
40
- end
19
+ end
41
20
  end
42
21
  end
@@ -2,6 +2,9 @@
2
2
 
3
3
  <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
+ <xsl:param name="svg_images"/>
6
+ <xsl:variable name="images" select="document($svg_images)"/>
7
+
5
8
  <xsl:variable name="pageWidth" select="'210mm'"/>
6
9
  <xsl:variable name="pageHeight" select="'297mm'"/>
7
10
 
@@ -23,25 +26,8 @@
23
26
 
24
27
  <xsl:variable name="contents">
25
28
  <contents>
26
- <xsl:apply-templates select="/csd:csd-standard/csd:preface/node()" mode="contents"/>
27
- <!-- <xsl:with-param name="sectionNum" select="'0'"/>
28
- </xsl:apply-templates> -->
29
- <xsl:apply-templates select="/csd:csd-standard/csd:sections/csd:clause[1]" mode="contents"> <!-- [@id = '_scope'] -->
30
- <xsl:with-param name="sectionNum" select="'1'"/>
31
- </xsl:apply-templates>
32
- <xsl:apply-templates select="/csd:csd-standard/csd:bibliography/csd:references[1]" mode="contents"> <!-- [@id = '_normative_references'] -->
33
- <xsl:with-param name="sectionNum" select="'2'"/>
34
- </xsl:apply-templates>
35
- <xsl:apply-templates select="/csd:csd-standard/csd:sections/*[position() &gt; 1]" mode="contents"> <!-- @id != '_scope' -->
36
- <xsl:with-param name="sectionNumSkew" select="'1'"/>
37
- </xsl:apply-templates>
38
- <xsl:apply-templates select="/csd:csd-standard/csd:annex" mode="contents"/>
39
- <xsl:apply-templates select="/csd:csd-standard/csd:bibliography/csd:references[position() &gt; 1]" mode="contents"/> <!-- @id = '_bibliography' -->
40
-
41
- <xsl:apply-templates select="//csd:figure" mode="contents"/>
42
-
43
- <xsl:apply-templates select="//csd:table" mode="contents"/>
44
-
29
+ <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
30
+ <xsl:call-template name="processMainSectionsDefault_Contents"/>
45
31
  </contents>
46
32
  </xsl:variable>
47
33
 
@@ -50,6 +36,7 @@
50
36
  </xsl:variable>
51
37
 
52
38
  <xsl:template match="/">
39
+ <xsl:call-template name="namespaceCheck"/>
53
40
  <fo:root font-family="SourceSansPro, STIX2Math, HanSans" font-size="10.5pt" xml:lang="{$lang}">
54
41
  <fo:layout-master-set>
55
42
  <!-- Cover page -->
@@ -62,13 +49,6 @@
62
49
  </fo:simple-page-master>
63
50
 
64
51
  <!-- Document pages -->
65
- <!-- <fo:simple-page-master master-name="document" page-width="{$pageWidth}" page-height="{$pageHeight}">
66
- <fo:region-body margin-top="23.5mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
67
- <fo:region-before extent="23.5mm"/>
68
- <fo:region-after extent="10mm"/>
69
- <fo:region-start extent="19mm"/>
70
- <fo:region-end extent="19mm"/>
71
- </fo:simple-page-master> -->
72
52
 
73
53
  <!-- Preface odd pages -->
74
54
  <fo:simple-page-master master-name="odd-preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
@@ -128,7 +108,10 @@
128
108
  </fo:layout-master-set>
129
109
 
130
110
  <xsl:call-template name="addPDFUAmeta"/>
131
-
111
+
112
+ <xsl:call-template name="addBookmarks">
113
+ <xsl:with-param name="contents" select="$contents"/>
114
+ </xsl:call-template>
132
115
 
133
116
  <!-- Cover Page -->
134
117
  <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
@@ -245,38 +228,32 @@
245
228
  </xsl:variable>
246
229
  <fo:block font-size="14pt" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
247
230
 
248
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true' and @level &lt;= 2][not(@level = 2 and starts-with(@section, '0'))]"><!-- skip clause from preface -->
231
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
249
232
 
250
233
  <fo:block>
251
234
  <xsl:if test="@level = 1">
252
235
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
253
236
  </xsl:if>
237
+
238
+
254
239
  <fo:list-block>
255
240
  <xsl:attribute name="provisional-distance-between-starts">
256
241
  <xsl:choose>
257
242
  <!-- skip 0 section without subsections -->
258
- <xsl:when test="@section != '' and not(@display-section = 'false')">8mm</xsl:when>
243
+ <xsl:when test="@section != ''">8mm</xsl:when> <!-- and not(@display-section = 'false') -->
259
244
  <xsl:otherwise>0mm</xsl:otherwise>
260
245
  </xsl:choose>
261
246
  </xsl:attribute>
262
247
  <fo:list-item>
263
248
  <fo:list-item-label end-indent="label-end()">
264
- <fo:block>
265
- <xsl:if test="@section and not(@display-section = 'false')"> <!-- output below -->
266
- <xsl:value-of select="@section"/><xsl:text>.</xsl:text>
267
- </xsl:if>
249
+ <fo:block>
250
+ <xsl:value-of select="@section"/>
268
251
  </fo:block>
269
252
  </fo:list-item-label>
270
253
  <fo:list-item-body start-indent="body-start()">
271
254
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
272
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
273
- <xsl:if test="@section and @display-section = 'false'">
274
- <xsl:value-of select="@section"/><xsl:text> </xsl:text>
275
- </xsl:if>
276
- <xsl:if test="@addon != ''">
277
- <xsl:text>(</xsl:text><xsl:value-of select="@addon"/><xsl:text>)</xsl:text>
278
- </xsl:if>
279
- <xsl:text> </xsl:text><xsl:value-of select="text()"/>
255
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
256
+ <xsl:apply-templates select="title"/>
280
257
  <fo:inline keep-together.within-line="always">
281
258
  <fo:leader leader-pattern="dots"/>
282
259
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
@@ -290,8 +267,8 @@
290
267
  </xsl:for-each>
291
268
  </fo:block-container>
292
269
 
293
- <!-- Foreword, Introduction -->
294
- <xsl:apply-templates select="/csd:csd-standard/csd:preface/node()"/>
270
+ <!-- Foreword, Introduction -->
271
+ <xsl:call-template name="processPrefaceSectionsDefault"/>
295
272
 
296
273
  </fo:flow>
297
274
  </fo:page-sequence>
@@ -310,22 +287,7 @@
310
287
  <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:title[@language = 'en']"/>
311
288
  </fo:block>
312
289
  <fo:block>
313
- <xsl:apply-templates select="/csd:csd-standard/csd:sections/csd:clause[1]"> <!-- Scope -->
314
- <xsl:with-param name="sectionNum" select="'1'"/>
315
- </xsl:apply-templates>
316
- <!-- Normative references -->
317
- <xsl:apply-templates select="/csd:csd-standard/csd:bibliography/csd:references[1]">
318
- <xsl:with-param name="sectionNum" select="'2'"/>
319
- </xsl:apply-templates>
320
-
321
- <!-- Other Sections -->
322
- <xsl:apply-templates select="/csd:csd-standard/csd:sections/*[position() &gt; 1]">
323
- <xsl:with-param name="sectionNumSkew" select="'1'"/>
324
- </xsl:apply-templates>
325
-
326
- <xsl:apply-templates select="/csd:csd-standard/csd:annex"/>
327
- <xsl:apply-templates select="/csd:csd-standard/csd:bibliography/csd:references[position() &gt; 1]"/>
328
-
290
+ <xsl:call-template name="processMainSectionsDefault"/>
329
291
  </fo:block>
330
292
  </fo:flow>
331
293
  </fo:page-sequence>
@@ -335,168 +297,61 @@
335
297
  </fo:root>
336
298
  </xsl:template>
337
299
 
338
- <!-- for pass the paremeter 'sectionNum' over templates, like 'tunnel' parameter in XSLT 2.0 -->
339
300
  <xsl:template match="node()">
340
- <xsl:param name="sectionNum"/>
341
- <xsl:param name="sectionNumSkew"/>
342
- <xsl:apply-templates>
343
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
344
- <xsl:with-param name="sectionNumSkew" select="$sectionNumSkew"/>
345
- </xsl:apply-templates>
301
+ <xsl:apply-templates/>
346
302
  </xsl:template>
347
303
 
348
304
  <!-- ============================= -->
349
305
  <!-- CONTENTS -->
350
306
  <!-- ============================= -->
351
- <xsl:template match="node()" mode="contents">
352
- <xsl:param name="sectionNum"/>
353
- <xsl:param name="sectionNumSkew"/>
354
- <xsl:apply-templates mode="contents">
355
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
356
- <xsl:with-param name="sectionNumSkew" select="$sectionNumSkew"/>
357
- </xsl:apply-templates>
307
+ <xsl:template match="node()" mode="contents">
308
+ <xsl:apply-templates mode="contents"/>
358
309
  </xsl:template>
359
310
 
360
-
361
- <!-- calculate main section number (1,2,3) and pass it deep into templates -->
362
- <!-- it's necessary, because there is itu:bibliography/itu:references from other section, but numbering should be sequental -->
363
- <xsl:template match="csd:csd-standard/csd:sections/*" mode="contents">
364
- <xsl:param name="sectionNum"/>
365
- <xsl:param name="sectionNumSkew" select="0"/>
366
- <xsl:variable name="sectionNum_">
367
- <xsl:choose>
368
- <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
369
- <xsl:when test="$sectionNumSkew != 0">
370
- <xsl:variable name="number"><xsl:number count="*"/></xsl:variable> <!-- csd:sections/csd:clause | csd:sections/csd:terms -->
371
- <xsl:value-of select="$number + $sectionNumSkew"/>
372
- </xsl:when>
373
- <xsl:otherwise>
374
- <xsl:number count="*"/>
375
- </xsl:otherwise>
376
- </xsl:choose>
377
- </xsl:variable>
378
- <xsl:apply-templates mode="contents">
379
- <xsl:with-param name="sectionNum" select="$sectionNum_"/>
380
- </xsl:apply-templates>
381
- </xsl:template>
382
-
383
- <!-- Any node with title element - clause, definition, annex,... -->
384
- <xsl:template match="csd:title | csd:preferred" mode="contents">
385
- <xsl:param name="sectionNum"/>
386
- <!-- sectionNum=<xsl:value-of select="$sectionNum"/> -->
387
- <xsl:variable name="id">
388
- <xsl:call-template name="getId"/>
389
- </xsl:variable>
390
-
311
+ <!-- element with title -->
312
+ <xsl:template match="*[csd:title]" mode="contents">
391
313
  <xsl:variable name="level">
392
- <xsl:call-template name="getLevel"/>
393
- </xsl:variable>
394
-
395
- <xsl:variable name="section">
396
- <xsl:call-template name="getSection">
397
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
314
+ <xsl:call-template name="getLevel">
315
+ <xsl:with-param name="depth" select="csd:title/@depth"/>
398
316
  </xsl:call-template>
399
317
  </xsl:variable>
400
318
 
401
319
  <xsl:variable name="display">
402
320
  <xsl:choose>
403
- <xsl:when test="ancestor::csd:bibitem">false</xsl:when>
404
- <xsl:when test="ancestor::csd:term">false</xsl:when>
405
- <xsl:when test="ancestor::csd:annex and $level &gt;= 2">false</xsl:when>
406
- <xsl:when test="$level &lt;= 3">true</xsl:when>
407
- <xsl:otherwise>false</xsl:otherwise>
408
- </xsl:choose>
409
- </xsl:variable>
410
-
411
- <xsl:variable name="display-section">
412
- <xsl:choose>
413
- <xsl:when test="ancestor::csd:annex">false</xsl:when>
321
+ <xsl:when test="$level &gt; 2">false</xsl:when>
414
322
  <xsl:otherwise>true</xsl:otherwise>
415
323
  </xsl:choose>
416
324
  </xsl:variable>
417
325
 
418
- <xsl:variable name="type">
419
- <xsl:value-of select="local-name(..)"/>
420
- </xsl:variable>
421
-
422
- <xsl:variable name="root">
326
+ <xsl:variable name="skip">
423
327
  <xsl:choose>
424
- <xsl:when test="ancestor::csd:annex">annex</xsl:when>
425
- <xsl:when test="ancestor::csd:clause">clause</xsl:when>
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>
426
331
  </xsl:choose>
427
332
  </xsl:variable>
428
333
 
429
- <item id="{$id}" level="{$level}" section="{$section}" display-section="{$display-section}" display="{$display}" type="{$type}" root="{$root}">
430
- <xsl:attribute name="addon">
431
- <xsl:if test="local-name(..) = 'annex'"><xsl:value-of select="../@obligation"/></xsl:if>
432
- </xsl:attribute>
433
- <xsl:value-of select="."/>
434
- </item>
334
+ <xsl:if test="$skip = 'false'">
435
335
 
436
- <xsl:apply-templates mode="contents">
437
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
438
- </xsl:apply-templates>
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>
439
351
 
440
352
  </xsl:template>
441
353
 
442
354
 
443
- <xsl:template match="csd:figure" mode="contents">
444
- <item level="" id="{@id}" display="false">
445
- <xsl:attribute name="section">
446
- <xsl:variable name="title-figure">
447
- <xsl:call-template name="getTitle">
448
- <xsl:with-param name="name" select="'title-figure'"/>
449
- </xsl:call-template>
450
- </xsl:variable>
451
- <xsl:value-of select="$title-figure"/><xsl:number format="A.1-1" level="multiple" count="csd:annex | csd:figure"/>
452
- </xsl:attribute>
453
- </item>
454
- </xsl:template>
455
-
456
-
457
- <xsl:template match="csd:table" mode="contents">
458
- <xsl:param name="sectionNum"/>
459
- <xsl:variable name="annex-id" select="ancestor::csd:annex/@id"/>
460
- <item level="" id="{@id}" display="false" type="table">
461
- <xsl:attribute name="section">
462
- <xsl:variable name="title-table">
463
- <xsl:call-template name="getTitle">
464
- <xsl:with-param name="name" select="'title-table'"/>
465
- </xsl:call-template>
466
- </xsl:variable>
467
- <xsl:value-of select="$title-table"/>
468
- <xsl:choose>
469
- <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
470
- <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table']"/>
471
- </xsl:when>
472
- <xsl:when test="ancestor::*[local-name()='annex']">
473
- <xsl:number format="A-" count="csd:annex"/>
474
- <xsl:number format="1" level="any" count="csd:table[ancestor::csd:annex[@id = $annex-id]]"/>
475
- </xsl:when>
476
- <xsl:otherwise>
477
- <!-- <xsl:number format="1"/> -->
478
- <xsl:number format="1" level="any" count="*[local-name()='sections']//*[local-name()='table']"/>
479
- </xsl:otherwise>
480
- </xsl:choose>
481
- </xsl:attribute>
482
- <xsl:value-of select="csd:name/text()"/>
483
- </item>
484
- </xsl:template>
485
-
486
-
487
-
488
- <xsl:template match="csd:formula" mode="contents">
489
- <item level="" id="{@id}" display="false">
490
- <xsl:attribute name="section">
491
- <xsl:variable name="title-formula">
492
- <xsl:call-template name="getTitle">
493
- <xsl:with-param name="name" select="'title-formula'"/>
494
- </xsl:call-template>
495
- </xsl:variable>
496
- <xsl:value-of select="$title-formula"/><xsl:number format="(A.1)" level="multiple" count="csd:annex | csd:formula"/>
497
- </xsl:attribute>
498
- </item>
499
- </xsl:template>
500
355
  <!-- ============================= -->
501
356
  <!-- ============================= -->
502
357
 
@@ -546,90 +401,14 @@
546
401
  </fo:block>
547
402
  </xsl:template>
548
403
 
549
- <!-- Foreword, Introduction -->
550
- <xsl:template match="csd:csd-standard/csd:preface/*">
551
- <fo:block break-after="page"/>
552
- <!-- <fo:block> -->
553
- <xsl:apply-templates/>
554
- <!-- </fo:block> -->
555
- </xsl:template>
556
-
557
-
558
-
559
- <!-- clause, terms, clause, ...-->
560
- <xsl:template match="csd:csd-standard/csd:sections/*">
561
- <xsl:param name="sectionNum"/>
562
- <xsl:param name="sectionNumSkew" select="0"/>
563
- <fo:block>
564
- <xsl:variable name="pos"><xsl:number count="csd:sections/csd:clause | csd:sections/csd:terms"/></xsl:variable>
565
- <xsl:if test="$pos &gt;= 2">
566
- <xsl:attribute name="space-before">18pt</xsl:attribute>
567
- </xsl:if>
568
- <!-- pos=<xsl:value-of select="$pos" /> -->
569
- <xsl:variable name="sectionNum_">
570
- <xsl:choose>
571
- <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
572
- <xsl:when test="$sectionNumSkew != 0">
573
- <xsl:variable name="number"><xsl:number count="csd:sections/csd:clause | csd:sections/csd:terms"/></xsl:variable>
574
- <xsl:value-of select="$number + $sectionNumSkew"/>
575
- </xsl:when>
576
- </xsl:choose>
577
- </xsl:variable>
578
- <xsl:if test="not(csd:title)">
579
- <fo:block margin-top="3pt" margin-bottom="12pt">
580
- <xsl:value-of select="$sectionNum_"/><xsl:number format=".1 " level="multiple" count="csd:clause"/>
581
- </fo:block>
582
- </xsl:if>
583
- <xsl:apply-templates>
584
- <xsl:with-param name="sectionNum" select="$sectionNum_"/>
585
- </xsl:apply-templates>
586
- </fo:block>
587
- </xsl:template>
588
-
589
404
 
590
405
 
591
- <xsl:template match="csd:clause//csd:clause[not(csd:title)]">
592
- <xsl:param name="sectionNum"/>
593
- <xsl:variable name="section">
594
- <xsl:call-template name="getSection">
595
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
596
- </xsl:call-template>
597
- </xsl:variable>
598
-
599
- <fo:block margin-top="3pt"><!-- margin-bottom="6pt" -->
600
- <fo:inline font-weight="bold" padding-right="3mm">
601
- <xsl:value-of select="$section"/><!-- <xsl:number format=".1 " level="multiple" count="csd:clause/csd:clause" /> -->
602
- </fo:inline>
603
- <xsl:apply-templates>
604
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
605
- <xsl:with-param name="inline" select="'true'"/>
606
- </xsl:apply-templates>
607
- </fo:block>
608
- </xsl:template>
609
-
610
-
611
406
  <xsl:template match="csd:title">
612
- <xsl:param name="sectionNum"/>
613
-
614
- <xsl:variable name="parent-name" select="local-name(..)"/>
615
- <xsl:variable name="references_num_current">
616
- <xsl:number level="any" count="csd:references"/>
617
- </xsl:variable>
618
-
619
- <xsl:variable name="id">
620
- <xsl:call-template name="getId"/>
621
- </xsl:variable>
622
407
 
623
408
  <xsl:variable name="level">
624
409
  <xsl:call-template name="getLevel"/>
625
410
  </xsl:variable>
626
-
627
- <xsl:variable name="section">
628
- <xsl:call-template name="getSection">
629
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
630
- </xsl:call-template>
631
- </xsl:variable>
632
-
411
+
633
412
  <xsl:variable name="font-size">
634
413
  <xsl:choose>
635
414
  <xsl:when test="ancestor::csd:preface">13pt</xsl:when>
@@ -650,41 +429,16 @@
650
429
  <xsl:variable name="color" select="'rgb(14, 26, 133)'"/>
651
430
 
652
431
  <xsl:element name="{$element-name}">
653
- <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
654
- <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
655
- <xsl:attribute name="font-weight">bold</xsl:attribute>
656
- <!-- <xsl:attribute name="margin-top">
657
- <xsl:choose>
658
- <xsl:when test="$level = 2 and ancestor::annex">18pt</xsl:when>
659
- <xsl:when test="$level = '' or $level = 1">6pt</xsl:when>
660
- <xsl:otherwise>12pt</xsl:otherwise>
661
- </xsl:choose>
662
- </xsl:attribute> -->
663
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
664
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
665
- <xsl:attribute name="color"><xsl:value-of select="$color"/></xsl:attribute>
666
- <xsl:if test="ancestor::csd:sections">
667
- <xsl:attribute name="margin-top">13.5pt</xsl:attribute>
668
- </xsl:if>
669
- <!-- DEBUG level=<xsl:value-of select="$level"/>x -->
670
- <!-- section=<xsl:value-of select="$sectionNum"/> -->
671
- <!-- <xsl:if test="$sectionNum"> -->
672
- <xsl:if test="$section != ''">
673
- <xsl:value-of select="$section"/><xsl:text>.</xsl:text>
674
- <xsl:choose>
675
- <xsl:when test="$level &gt;= 3">
676
- <fo:inline padding-right="2mm"> </fo:inline>
677
- </xsl:when>
678
- <xsl:when test="$level = 1">
679
- <fo:inline padding-right="2mm"> </fo:inline>
680
- </xsl:when>
681
- <xsl:otherwise>
682
- <fo:inline padding-right="1mm"> </fo:inline>
683
- </xsl:otherwise>
684
- </xsl:choose>
685
- </xsl:if>
686
- <xsl:apply-templates/>
687
- </xsl:element>
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>
688
442
  </xsl:template>
689
443
 
690
444
 
@@ -763,85 +517,6 @@
763
517
  <xsl:apply-templates/>
764
518
  </xsl:template>
765
519
 
766
- <xsl:template match="csd:review">
767
- <!-- comment 2019-11-29 -->
768
- <!-- <fo:block font-weight="bold">Review:</fo:block>
769
- <xsl:apply-templates /> -->
770
- </xsl:template>
771
-
772
- <xsl:template match="text()">
773
- <xsl:value-of select="."/>
774
- </xsl:template>
775
-
776
-
777
-
778
- <xsl:template match="csd:image">
779
- <fo:block-container text-align="center">
780
- <fo:block>
781
- <fo:external-graphic src="{@src}" fox:alt-text="Image {@alt}"/>
782
- </fo:block>
783
- <xsl:variable name="title-figure">
784
- <xsl:call-template name="getTitle">
785
- <xsl:with-param name="name" select="'title-figure'"/>
786
- </xsl:call-template>
787
- </xsl:variable>
788
- <fo:block font-weight="bold" margin-top="12pt" margin-bottom="12pt"><xsl:value-of select="$title-figure"/><xsl:number format="1" level="any"/></fo:block>
789
- </fo:block-container>
790
-
791
- </xsl:template>
792
-
793
- <xsl:template match="csd:figure">
794
- <fo:block-container id="{@id}">
795
- <fo:block>
796
- <xsl:apply-templates/>
797
- </fo:block>
798
- <xsl:call-template name="fn_display_figure"/>
799
- <xsl:for-each select="csd:note//csd:p">
800
- <xsl:call-template name="note"/>
801
- </xsl:for-each>
802
- <fo:block font-weight="bold" text-align="center" margin-top="12pt" margin-bottom="12pt" keep-with-previous="always">
803
- <xsl:variable name="title-figure">
804
- <xsl:call-template name="getTitle">
805
- <xsl:with-param name="name" select="'title-figure'"/>
806
- </xsl:call-template>
807
- </xsl:variable>
808
- <xsl:choose>
809
- <xsl:when test="ancestor::csd:annex">
810
- <xsl:choose>
811
- <xsl:when test="local-name(..) = 'figure'">
812
- <xsl:number format="a) "/>
813
- </xsl:when>
814
- <xsl:otherwise>
815
- <xsl:value-of select="$title-figure"/><xsl:number format="A.1-1" level="multiple" count="csd:annex | csd:figure"/>
816
- </xsl:otherwise>
817
- </xsl:choose>
818
-
819
- </xsl:when>
820
- <xsl:otherwise>
821
- <xsl:value-of select="$title-figure"/><xsl:number format="1" level="any"/>
822
- </xsl:otherwise>
823
- </xsl:choose>
824
- <xsl:if test="csd:name">
825
- <xsl:if test="not(local-name(..) = 'figure')">
826
- <xsl:text> — </xsl:text>
827
- </xsl:if>
828
- <xsl:value-of select="csd:name"/>
829
- </xsl:if>
830
- </fo:block>
831
- </fo:block-container>
832
- </xsl:template>
833
-
834
- <xsl:template match="csd:figure/csd:name"/>
835
- <xsl:template match="csd:figure/csd:fn"/>
836
- <xsl:template match="csd:figure/csd:note"/>
837
-
838
-
839
- <xsl:template match="csd:figure/csd:image">
840
- <fo:block text-align="center">
841
- <fo:external-graphic src="{@src}" content-width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/> <!-- content-width="75%" -->
842
- </fo:block>
843
- </xsl:template>
844
-
845
520
 
846
521
  <xsl:template match="csd:bibitem">
847
522
  <fo:block id="{@id}" margin-bottom="6pt"> <!-- 12 pt -->
@@ -873,7 +548,7 @@
873
548
  </xsl:template>
874
549
 
875
550
 
876
- <xsl:template match="csd:bibitem/csd:note">
551
+ <xsl:template match="csd:bibitem/csd:note" priority="2">
877
552
  <fo:footnote>
878
553
  <xsl:variable name="number">
879
554
  <xsl:choose>
@@ -903,7 +578,7 @@
903
578
 
904
579
 
905
580
 
906
- <xsl:template match="csd:ul | csd:ol">
581
+ <xsl:template match="csd:ul | csd:ol" mode="ul_ol">
907
582
  <fo:list-block provisional-distance-between-starts="6.5mm" margin-bottom="12pt">
908
583
  <xsl:if test="ancestor::csd:ol">
909
584
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
@@ -935,28 +610,15 @@
935
610
  </fo:block>
936
611
  </fo:list-item-label>
937
612
  <fo:list-item-body start-indent="body-start()">
938
- <xsl:apply-templates/>
613
+ <fo:block>
614
+ <xsl:apply-templates/>
615
+ </fo:block>
939
616
  </fo:list-item-body>
940
617
  </fo:list-item>
941
618
  </xsl:template>
942
619
 
943
-
944
- <xsl:template match="csd:term">
945
- <xsl:param name="sectionNum"/>
946
- <fo:block id="{@id}">
947
- <xsl:apply-templates>
948
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
949
- </xsl:apply-templates>
950
- </fo:block>
951
- </xsl:template>
952
-
953
- <xsl:template match="csd:preferred">
954
- <xsl:param name="sectionNum"/>
955
- <xsl:variable name="section">
956
- <xsl:call-template name="getSection">
957
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
958
- </xsl:call-template>
959
- </xsl:variable>
620
+
621
+ <xsl:template match="csd:preferred">
960
622
  <xsl:variable name="level">
961
623
  <xsl:call-template name="getLevel"/>
962
624
  </xsl:variable>
@@ -968,10 +630,7 @@
968
630
  </xsl:variable>
969
631
  <fo:block font-size="{$font-size}" line-height="1.1">
970
632
  <fo:block font-weight="bold" keep-with-next="always">
971
- <fo:inline>
972
- <xsl:value-of select="$section"/><xsl:text>.</xsl:text>
973
- <!-- <xsl:value-of select="$sectionNum"/>.<xsl:number count="csd:term"/> -->
974
- </fo:inline>
633
+ <xsl:apply-templates select="ancestor::csd:term/csd:name" mode="presentation"/>
975
634
  </fo:block>
976
635
  <fo:block font-weight="bold" keep-with-next="always">
977
636
  <xsl:apply-templates/>
@@ -979,116 +638,21 @@
979
638
  </fo:block>
980
639
  </xsl:template>
981
640
 
982
- <xsl:template match="csd:admitted">
983
- <fo:block>
984
- <xsl:apply-templates/>
985
- </fo:block>
986
- </xsl:template>
987
-
988
- <xsl:template match="csd:deprecates">
989
- <xsl:variable name="title-deprecated">
990
- <xsl:call-template name="getTitle">
991
- <xsl:with-param name="name" select="'title-deprecated'"/>
992
- </xsl:call-template>
993
- </xsl:variable>
994
- <fo:block><xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/></fo:block>
995
- </xsl:template>
996
-
997
- <xsl:template match="csd:definition[preceding-sibling::csd:domain]">
998
- <xsl:apply-templates/>
999
- </xsl:template>
1000
- <xsl:template match="csd:definition[preceding-sibling::csd:domain]/csd:p">
1001
- <fo:inline> <xsl:apply-templates/></fo:inline>
1002
- <fo:block> </fo:block>
1003
- </xsl:template>
1004
-
1005
- <xsl:template match="csd:definition">
1006
- <fo:block margin-bottom="6pt">
1007
- <xsl:apply-templates/>
1008
- </fo:block>
1009
- </xsl:template>
1010
-
1011
- <xsl:template match="csd:termsource">
1012
- <fo:block margin-bottom="8pt" keep-with-previous="always">
1013
- <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
1014
- <fo:basic-link internal-destination="{csd:origin/@bibitemid}" fox:alt-text="{csd:origin/@citeas}">
1015
- <xsl:text>[</xsl:text>
1016
- <xsl:variable name="title-source">
1017
- <xsl:call-template name="getTitle">
1018
- <xsl:with-param name="name" select="'title-source'"/>
1019
- </xsl:call-template>
1020
- </xsl:variable>
1021
- <xsl:value-of select="$title-source"/>
1022
- <xsl:text>: </xsl:text>
1023
- <xsl:value-of select="csd:origin/@citeas"/>
1024
-
1025
- <xsl:apply-templates select="csd:origin/csd:localityStack"/>
1026
-
1027
- </fo:basic-link>
1028
- <xsl:apply-templates select="csd:modification"/>
1029
- <xsl:text>]</xsl:text>
1030
- </fo:block>
1031
- </xsl:template>
1032
-
1033
- <xsl:template match="csd:modification/csd:p">
1034
- <fo:inline><xsl:apply-templates/></fo:inline>
1035
- </xsl:template>
1036
-
1037
- <xsl:template match="csd:termnote">
1038
- <fo:block font-size="10pt" margin-bottom="12pt">
1039
- <xsl:variable name="num"><xsl:number/></xsl:variable>
1040
- <xsl:variable name="title-note-to-entry">
1041
- <xsl:call-template name="getTitle">
1042
- <xsl:with-param name="name" select="'title-note-to-entry'"/>
1043
- </xsl:call-template>
1044
- </xsl:variable>
1045
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($title-note-to-entry),'#',$num)"/>
1046
- <xsl:apply-templates/>
1047
- </fo:block>
1048
- </xsl:template>
1049
-
1050
- <xsl:template match="csd:termnote/csd:p">
1051
- <fo:inline><xsl:apply-templates/></fo:inline>
1052
- </xsl:template>
1053
-
1054
- <xsl:template match="csd:domain">
1055
- <fo:inline>&lt;<xsl:apply-templates/>&gt;</fo:inline>
1056
- </xsl:template>
1057
-
1058
-
1059
- <xsl:template match="csd:termexample">
1060
- <fo:block font-size="10pt" margin-bottom="12pt">
1061
- <xsl:variable name="title-example">
1062
- <xsl:call-template name="getTitle">
1063
- <xsl:with-param name="name" select="'title-example'"/>
1064
- </xsl:call-template>
1065
- </xsl:variable>
1066
- <fo:inline padding-right="10mm"><xsl:value-of select="normalize-space($title-example)"/></fo:inline>
1067
- <xsl:apply-templates/>
1068
- </fo:block>
1069
- </xsl:template>
1070
-
1071
- <xsl:template match="csd:termexample/csd:p">
1072
- <fo:inline><xsl:apply-templates/></fo:inline>
1073
- </xsl:template>
1074
641
 
1075
-
1076
- <xsl:template match="csd:annex">
1077
- <fo:block break-after="page"/>
1078
- <xsl:apply-templates/>
1079
- </xsl:template>
1080
642
 
1081
-
643
+
1082
644
  <!-- <xsl:template match="csd:references[@id = '_bibliography']"> -->
1083
- <xsl:template match="csd:references[position() &gt; 1]">
645
+ <xsl:template match="csd:references[not(@normative='true')]">
1084
646
  <fo:block break-after="page"/>
647
+ <fo:block id="{@id}">
1085
648
  <xsl:apply-templates/>
649
+ </fo:block>
1086
650
  </xsl:template>
1087
651
 
1088
652
 
1089
653
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
1090
654
  <!-- <xsl:template match="csd:references[@id = '_bibliography']/csd:bibitem"> -->
1091
- <xsl:template match="csd:references[position() &gt; 1]/csd:bibitem">
655
+ <xsl:template match="csd:references[not(@normative='true')]/csd:bibitem">
1092
656
  <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="12mm">
1093
657
  <fo:list-item>
1094
658
  <fo:list-item-label end-indent="label-end()">
@@ -1123,162 +687,27 @@
1123
687
  </xsl:template>
1124
688
 
1125
689
  <!-- <xsl:template match="csd:references[@id = '_bibliography']/csd:bibitem" mode="contents"/> -->
1126
- <xsl:template match="csd:references[position() &gt; 1]/csd:bibitem" mode="contents"/>
690
+ <xsl:template match="csd:references[not(@normative='true')]/csd:bibitem" mode="contents"/>
1127
691
 
1128
692
  <!-- <xsl:template match="csd:references[@id = '_bibliography']/csd:bibitem/csd:title"> -->
1129
- <xsl:template match="csd:references[position() &gt; 1]/csd:bibitem/csd:title">
693
+ <xsl:template match="csd:references[not(@normative='true')]/csd:bibitem/csd:title">
1130
694
  <fo:inline font-style="italic">
1131
695
  <xsl:apply-templates/>
1132
696
  </fo:inline>
1133
697
  </xsl:template>
1134
-
1135
- <xsl:template match="csd:quote">
1136
- <fo:block margin-top="12pt" margin-left="12mm" margin-right="12mm">
1137
- <xsl:apply-templates select=".//csd:p"/>
1138
- </fo:block>
1139
- <fo:block text-align="right">
1140
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
1141
- <xsl:text>— </xsl:text><xsl:value-of select="csd:author"/>
1142
- <xsl:if test="csd:source">
1143
- <xsl:text>, </xsl:text>
1144
- <xsl:apply-templates select="csd:source"/>
1145
- </xsl:if>
1146
- </fo:block>
1147
- </xsl:template>
1148
-
1149
- <xsl:template match="csd:source">
1150
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
1151
- <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1152
- <xsl:apply-templates select="csd:localityStack"/>
1153
- </fo:basic-link>
1154
- </xsl:template>
1155
698
 
1156
699
 
1157
- <xsl:template match="csd:xref">
1158
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">
1159
- <xsl:variable name="section" select="xalan:nodeset($contents)//item[@id = current()/@target]/@section"/>
1160
- <xsl:if test="not(starts-with($section, 'Figure') or starts-with($section, 'Table'))">
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'))">
1161
703
  <xsl:attribute name="color">blue</xsl:attribute>
1162
704
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1163
705
  </xsl:if>
1164
- <xsl:variable name="type" select="xalan:nodeset($contents)//item[@id = current()/@target]/@type"/>
1165
- <xsl:variable name="root" select="xalan:nodeset($contents)//item[@id = current()/@target]/@root"/>
1166
- <xsl:variable name="title-clause">
1167
- <xsl:call-template name="getTitle">
1168
- <xsl:with-param name="name" select="'title-clause'"/>
1169
- </xsl:call-template>
1170
- </xsl:variable>
1171
-
1172
- <xsl:choose>
1173
- <xsl:when test="$type = 'clause' and $root != 'annex'"><xsl:value-of select="$title-clause"/></xsl:when><!-- and not (ancestor::annex) -->
1174
- <xsl:when test="$type = 'term' and $root = 'clause'"><xsl:value-of select="$title-clause"/></xsl:when>
1175
- <xsl:otherwise/> <!-- <xsl:value-of select="$type"/> -->
1176
- </xsl:choose>
1177
- <xsl:value-of select="$section"/>
706
+ <xsl:apply-templates/>
1178
707
  </fo:basic-link>
1179
708
  </xsl:template>
1180
709
 
1181
- <xsl:template match="csd:sourcecode" priority="2">
1182
- <xsl:call-template name="sourcecode"/>
1183
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt">
1184
- <xsl:variable name="title-figure">
1185
- <xsl:call-template name="getTitle">
1186
- <xsl:with-param name="name" select="'title-figure'"/>
1187
- </xsl:call-template>
1188
- </xsl:variable>
1189
- <xsl:value-of select="$title-figure"/>
1190
- <xsl:number format="1" level="any"/>
1191
- </fo:block>
1192
- </xsl:template>
1193
-
1194
- <xsl:template match="csd:tt" priority="2">
1195
- <fo:inline font-family="SourceCodePro" font-size="10pt">
1196
- <xsl:apply-templates/>
1197
- </fo:inline>
1198
- </xsl:template>
1199
-
1200
- <xsl:template match="csd:example">
1201
- <fo:block font-size="10pt" margin-bottom="12pt" font-weight="bold" keep-with-next="always">
1202
- <xsl:variable name="title-example">
1203
- <xsl:call-template name="getTitle">
1204
- <xsl:with-param name="name" select="'title-example'"/>
1205
- </xsl:call-template>
1206
- </xsl:variable>
1207
- <xsl:value-of select="normalize-space($title-example)"/>
1208
- <xsl:if test="following-sibling::csd:example or preceding-sibling::csd:example">
1209
- <xsl:number format=" 1"/>
1210
- </xsl:if>
1211
- </fo:block>
1212
- <fo:block font-size="10pt" margin-left="12.5mm">
1213
- <xsl:apply-templates/>
1214
- </fo:block>
1215
- </xsl:template>
1216
-
1217
- <xsl:template match="csd:example/csd:p">
1218
- <fo:block margin-bottom="14pt">
1219
- <xsl:apply-templates/>
1220
- </fo:block>
1221
- </xsl:template>
1222
-
1223
- <xsl:template match="csd:note/csd:p" name="note">
1224
- <fo:block font-size="10pt" margin-bottom="12pt">
1225
- <xsl:variable name="title-note">
1226
- <xsl:call-template name="getTitle">
1227
- <xsl:with-param name="name" select="'title-note'"/>
1228
- </xsl:call-template>
1229
- </xsl:variable>
1230
- <fo:inline padding-right="6mm"><xsl:value-of select="$title-note"/><xsl:number count="csd:note"/></fo:inline>
1231
- <xsl:apply-templates/>
1232
- </fo:block>
1233
- </xsl:template>
1234
710
 
1235
- <!-- <eref type="inline" bibitemid="ISO20483" citeas="ISO 20483:2013"><locality type="annex"><referenceFrom>C</referenceFrom></locality></eref> -->
1236
- <xsl:template match="csd:eref">
1237
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}" color="blue" text-decoration="underline"> <!-- font-size="9pt" color="blue" vertical-align="super" -->
1238
- <xsl:if test="@type = 'footnote'">
1239
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
1240
- <xsl:attribute name="font-size">80%</xsl:attribute>
1241
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1242
- <xsl:attribute name="vertical-align">super</xsl:attribute>
1243
- </xsl:if>
1244
- <xsl:if test="@type = 'inline'">
1245
- <xsl:attribute name="color">blue</xsl:attribute>
1246
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1247
- </xsl:if>
1248
- <!-- <xsl:if test="@type = 'inline'">
1249
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1250
- </xsl:if> -->
1251
- <xsl:choose>
1252
- <xsl:when test="@citeas">
1253
- <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1254
- </xsl:when>
1255
- <xsl:when test="@bibitemid">
1256
- <xsl:value-of select="//csd:bibitem[@id = current()/@bibitemid]/csd:docidentifier"/>
1257
- </xsl:when>
1258
- <xsl:otherwise/>
1259
- </xsl:choose>
1260
- <xsl:apply-templates select="csd:localityStack"/>
1261
- </fo:basic-link>
1262
- </xsl:template>
1263
-
1264
- <xsl:template match="csd:locality">
1265
- <xsl:variable name="title-clause">
1266
- <xsl:call-template name="getTitle">
1267
- <xsl:with-param name="name" select="'title-clause'"/>
1268
- </xsl:call-template>
1269
- </xsl:variable>
1270
- <xsl:variable name="title-annex">
1271
- <xsl:call-template name="getTitle">
1272
- <xsl:with-param name="name" select="'title-annex'"/>
1273
- </xsl:call-template>
1274
- </xsl:variable>
1275
- <xsl:choose>
1276
- <xsl:when test="@type ='clause'"><xsl:value-of select="$title-clause"/></xsl:when>
1277
- <xsl:when test="@type ='annex'"><xsl:value-of select="$title-annex"/></xsl:when>
1278
- <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
1279
- </xsl:choose>
1280
- <xsl:text> </xsl:text><xsl:value-of select="csd:referenceFrom"/>
1281
- </xsl:template>
1282
711
 
1283
712
  <xsl:template match="csd:admonition">
1284
713
  <fo:block margin-bottom="12pt" font-weight="bold"> <!-- text-align="center" -->
@@ -1288,17 +717,7 @@
1288
717
  </fo:block>
1289
718
  </xsl:template>
1290
719
 
1291
- <xsl:template match="csd:formula">
1292
- <fo:block id="{@id}">
1293
- <xsl:apply-templates/>
1294
- </fo:block>
1295
- </xsl:template>
1296
-
1297
- <xsl:template match="csd:formula/csd:dt/csd:stem">
1298
- <fo:inline>
1299
- <xsl:apply-templates/>
1300
- </fo:inline>
1301
- </xsl:template>
720
+
1302
721
 
1303
722
  <xsl:template match="csd:formula/csd:stem">
1304
723
  <fo:block margin-top="6pt" margin-bottom="12pt">
@@ -1314,29 +733,16 @@
1314
733
  </fo:table-cell>
1315
734
  <fo:table-cell display-align="center">
1316
735
  <fo:block text-align="right">
1317
- <xsl:choose>
1318
- <xsl:when test="ancestor::csd:annex">
1319
- <xsl:number format="(A.1)" level="multiple" count="csd:annex | csd:formula"/>
1320
- </xsl:when>
1321
- <xsl:otherwise> <!-- not(ancestor::csd:annex) -->
1322
- <!-- <xsl:text>(</xsl:text><xsl:number level="any" count="csd:formula"/><xsl:text>)</xsl:text> -->
1323
- </xsl:otherwise>
1324
- </xsl:choose>
736
+ <xsl:apply-templates select="../csd:name" mode="presentation"/>
1325
737
  </fo:block>
1326
738
  </fo:table-cell>
1327
739
  </fo:table-row>
1328
740
  </fo:table-body>
1329
- </fo:table>
1330
- <fo:inline keep-together.within-line="always">
1331
- </fo:inline>
741
+ </fo:table>
1332
742
  </fo:block>
1333
743
  </xsl:template>
1334
744
 
1335
-
1336
- <xsl:template match="csd:br" priority="2">
1337
- <!-- <fo:block>&#xA0;</fo:block> -->
1338
- <xsl:value-of select="$linebreak"/>
1339
- </xsl:template>
745
+
1340
746
 
1341
747
  <xsl:template name="insertHeaderFooter">
1342
748
  <fo:static-content flow-name="header-even">
@@ -1391,139 +797,8 @@
1391
797
  </fo:static-content>
1392
798
  </xsl:template>
1393
799
 
1394
-
1395
-
1396
- <xsl:template name="getSection">
1397
- <xsl:param name="sectionNum"/>
1398
- <xsl:variable name="level">
1399
- <xsl:call-template name="getLevel"/>
1400
- </xsl:variable>
1401
- <xsl:variable name="section">
1402
- <xsl:choose>
1403
- <xsl:when test="ancestor::csd:bibliography">
1404
- <xsl:value-of select="$sectionNum"/>
1405
- </xsl:when>
1406
- <xsl:when test="ancestor::csd:sections">
1407
- <!-- 1, 2, 3, 4, ... from main section (not annex, bibliography, ...) -->
1408
- <xsl:choose>
1409
- <xsl:when test="$level = 1">
1410
- <xsl:value-of select="$sectionNum"/>
1411
- </xsl:when>
1412
- <xsl:when test="$level &gt;= 2">
1413
- <xsl:variable name="num">
1414
- <xsl:call-template name="getSubSection"/>
1415
- </xsl:variable>
1416
- <xsl:value-of select="concat($sectionNum, $num)"/>
1417
- </xsl:when>
1418
- <xsl:otherwise>
1419
- <!-- z<xsl:value-of select="$sectionNum"/>z -->
1420
- </xsl:otherwise>
1421
- </xsl:choose>
1422
- <!-- <xsl:text>.</xsl:text> -->
1423
- </xsl:when>
1424
- <!-- <xsl:when test="ancestor::csd:annex[@obligation = 'informative']">
1425
- <xsl:choose>
1426
- <xsl:when test="$level = 1">
1427
- <xsl:text>Annex </xsl:text>
1428
- <xsl:number format="I" level="any" count="csd:annex[@obligation = 'informative']"/>
1429
- </xsl:when>
1430
- <xsl:otherwise>
1431
- <xsl:number format="I.1" level="multiple" count="csd:annex[@obligation = 'informative'] | csd:clause"/>
1432
- </xsl:otherwise>
1433
- </xsl:choose>
1434
- </xsl:when> -->
1435
- <xsl:when test="ancestor::csd:annex">
1436
- <xsl:choose>
1437
- <xsl:when test="$level = 1">
1438
- <xsl:variable name="title-annex">
1439
- <xsl:call-template name="getTitle">
1440
- <xsl:with-param name="name" select="'title-annex'"/>
1441
- </xsl:call-template>
1442
- </xsl:variable>
1443
- <xsl:value-of select="$title-annex"/>
1444
- <xsl:choose>
1445
- <xsl:when test="count(//csd:annex) = 1">
1446
- <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:ext/csd:structuredidentifier/csd:annexid"/>
1447
- </xsl:when>
1448
- <xsl:otherwise>
1449
- <xsl:number format="A." level="any" count="csd:annex"/>
1450
- </xsl:otherwise>
1451
- </xsl:choose>
1452
- </xsl:when>
1453
- <xsl:otherwise>
1454
- <xsl:choose>
1455
- <xsl:when test="count(//csd:annex) = 1">
1456
- <xsl:value-of select="/csd:csd-standard/csd:bibdata/csd:ext/csd:structuredidentifier/csd:annexid"/><xsl:number format=".1" level="multiple" count="csd:clause"/>
1457
- </xsl:when>
1458
- <xsl:otherwise>
1459
- <xsl:number format="A.1." level="multiple" count="csd:annex | csd:clause"/>
1460
- </xsl:otherwise>
1461
- </xsl:choose>
1462
- </xsl:otherwise>
1463
- </xsl:choose>
1464
- </xsl:when>
1465
- <xsl:when test="ancestor::csd:preface"> <!-- if preface and there is clause(s) -->
1466
- <xsl:choose>
1467
- <xsl:when test="$level = 1 and ..//csd:clause">0</xsl:when>
1468
- <xsl:when test="$level &gt;= 2">
1469
- <xsl:variable name="num">
1470
- <xsl:number format=".1." level="multiple" count="csd:clause"/>
1471
- </xsl:variable>
1472
- <xsl:value-of select="concat('0', $num)"/>
1473
- </xsl:when>
1474
- <xsl:otherwise>
1475
- <!-- z<xsl:value-of select="$sectionNum"/>z -->
1476
- </xsl:otherwise>
1477
- </xsl:choose>
1478
- </xsl:when>
1479
- <xsl:otherwise>
1480
- </xsl:otherwise>
1481
- </xsl:choose>
1482
- </xsl:variable>
1483
- <xsl:value-of select="$section"/>
1484
- </xsl:template>
1485
800
 
1486
801
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
1487
-
1488
- <title-table lang="en">Table </title-table>
1489
- <title-table lang="fr">Tableau </title-table>
1490
-
1491
- <title-table lang="zh">Table </title-table>
1492
-
1493
-
1494
-
1495
- <title-note lang="en">NOTE </title-note>
1496
- <title-note lang="fr">NOTE </title-note>
1497
-
1498
- <title-note lang="zh">NOTE </title-note>
1499
-
1500
-
1501
-
1502
- <title-figure lang="en">Figure </title-figure>
1503
- <title-figure lang="fr">Figure </title-figure>
1504
-
1505
- <title-figure lang="zh">Figure </title-figure>
1506
-
1507
-
1508
-
1509
- <title-example lang="en">EXAMPLE </title-example>
1510
- <title-example lang="fr">EXEMPLE </title-example>
1511
-
1512
- <title-example lang="zh">EXAMPLE </title-example>
1513
-
1514
-
1515
-
1516
- <title-example-xref lang="en">Example </title-example-xref>
1517
- <title-example-xref lang="fr">Exemple </title-example-xref>
1518
-
1519
- <title-section lang="en">Section </title-section>
1520
- <title-section lang="fr">Section </title-section>
1521
-
1522
- <title-inequality lang="en">Inequality </title-inequality>
1523
- <title-inequality lang="fr">Inequality </title-inequality>
1524
-
1525
- <title-equation lang="en">Equation </title-equation>
1526
- <title-equation lang="fr">Equation </title-equation>
1527
802
 
1528
803
  <title-annex lang="en">Annex </title-annex>
1529
804
  <title-annex lang="fr">Annexe </title-annex>
@@ -1531,17 +806,7 @@
1531
806
  <title-annex lang="zh">Annex </title-annex>
1532
807
 
1533
808
 
1534
-
1535
- <title-appendix lang="en">Appendix </title-appendix>
1536
- <title-appendix lang="fr">Appendix </title-appendix>
1537
-
1538
- <title-clause lang="en">Clause </title-clause>
1539
- <title-clause lang="fr">Article </title-clause>
1540
-
1541
- <title-clause lang="zh">Clause </title-clause>
1542
-
1543
-
1544
-
809
+
1545
810
  <title-edition lang="en">
1546
811
 
1547
812
  <xsl:text>Edition </xsl:text>
@@ -1549,9 +814,13 @@
1549
814
 
1550
815
  </title-edition>
1551
816
 
1552
- <title-formula lang="en">Formula </title-formula>
1553
- <title-formula lang="fr">Formula </title-formula>
817
+ <title-edition lang="fr">
818
+
819
+ <xsl:text>Édition </xsl:text>
820
+
821
+ </title-edition>
1554
822
 
823
+
1555
824
  <title-toc lang="en">
1556
825
 
1557
826
  <xsl:text>Contents</xsl:text>
@@ -1586,13 +855,6 @@
1586
855
  </title-part>
1587
856
  <title-part lang="zh">第 # 部分:</title-part>
1588
857
 
1589
- <title-note-to-entry lang="en">Note # to entry: </title-note-to-entry>
1590
- <title-note-to-entry lang="fr">Note # à l'article: </title-note-to-entry>
1591
-
1592
- <title-note-to-entry lang="zh">Note # to entry: </title-note-to-entry>
1593
-
1594
-
1595
-
1596
858
  <title-modified lang="en">modified</title-modified>
1597
859
  <title-modified lang="fr">modifiée</title-modified>
1598
860
 
@@ -1600,20 +862,23 @@
1600
862
 
1601
863
 
1602
864
 
1603
- <title-source lang="en">SOURCE</title-source>
865
+ <title-source lang="en">
866
+
867
+ <xsl:text>SOURCE</xsl:text>
868
+
869
+
870
+ </title-source>
1604
871
 
1605
872
  <title-keywords lang="en">Keywords</title-keywords>
1606
873
 
1607
874
  <title-deprecated lang="en">DEPRECATED</title-deprecated>
1608
875
  <title-deprecated lang="fr">DEPRECATED</title-deprecated>
1609
-
1610
- <title-submitting-organizations lang="en">Submitting Organizations</title-submitting-organizations>
1611
-
876
+
1612
877
  <title-list-tables lang="en">List of Tables</title-list-tables>
1613
878
 
1614
879
  <title-list-figures lang="en">List of Figures</title-list-figures>
1615
880
 
1616
- <title-recommendation lang="en">Recommendation </title-recommendation>
881
+ <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1617
882
 
1618
883
  <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
1619
884
 
@@ -1623,8 +888,6 @@
1623
888
 
1624
889
  <title-in lang="en">in </title-in>
1625
890
 
1626
- <title-box lang="en">Box </title-box>
1627
-
1628
891
  <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
1629
892
  <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
1630
893
 
@@ -1647,7 +910,11 @@
1647
910
  <title-warning lang="zh">警告</title-warning>
1648
911
 
1649
912
  <title-amendment lang="en">AMENDMENT</title-amendment>
1650
- </xsl:variable><xsl:template name="getTitle">
913
+
914
+ <title-continued lang="en">(continued)</title-continued>
915
+ <title-continued lang="fr">(continué)</title-continued>
916
+
917
+ </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1651
918
  <xsl:param name="name"/>
1652
919
  <xsl:variable name="lang">
1653
920
  <xsl:call-template name="getLang"/>
@@ -1661,18 +928,22 @@
1661
928
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
1662
929
  </xsl:otherwise>
1663
930
  </xsl:choose>
1664
- </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="link-style">
931
+ </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">
932
+
933
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
1665
934
 
1666
935
  <xsl:attribute name="color">blue</xsl:attribute>
1667
936
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1668
937
 
1669
938
 
939
+
1670
940
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
941
+ <xsl:attribute name="white-space">pre</xsl:attribute>
942
+ <xsl:attribute name="wrap-option">wrap</xsl:attribute>
1671
943
 
1672
944
 
1673
945
 
1674
- <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
1675
- <xsl:attribute name="font-size">10pt</xsl:attribute>
946
+ <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
1676
947
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1677
948
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1678
949
 
@@ -1681,222 +952,495 @@
1681
952
 
1682
953
 
1683
954
 
1684
- </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1685
-
1686
- <xsl:attribute name="font-size">12pt</xsl:attribute>
1687
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1688
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
1689
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1690
-
1691
955
 
956
+ </xsl:attribute-set><xsl:attribute-set name="permission-style">
1692
957
 
1693
- </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
958
+ </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
1694
959
 
1695
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1696
- <xsl:attribute name="margin-top">8pt</xsl:attribute>
1697
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
960
+ </xsl:attribute-set><xsl:attribute-set name="permission-label-style">
1698
961
 
962
+ </xsl:attribute-set><xsl:attribute-set name="requirement-style">
963
+
964
+ </xsl:attribute-set><xsl:attribute-set name="requirement-name-style">
965
+
966
+ </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
967
+
968
+ </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
969
+ </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
970
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
971
+
972
+
973
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-name-style">
974
+
975
+
976
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-label-style">
977
+
978
+ </xsl:attribute-set><xsl:attribute-set name="termexample-style">
979
+
980
+
981
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
982
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
983
+
984
+
985
+
986
+
987
+
988
+
989
+ </xsl:attribute-set><xsl:attribute-set name="example-style">
990
+
991
+
992
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
993
+
994
+
995
+
996
+
997
+
998
+
999
+
1000
+
1001
+
1002
+
1003
+ </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1004
+
1005
+
1006
+ <xsl:attribute name="margin-left">12.5mm</xsl:attribute>
1007
+
1008
+
1009
+ </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1010
+
1011
+
1012
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1013
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1014
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1699
1015
 
1700
1016
 
1701
- </xsl:attribute-set><xsl:template match="text()">
1702
- <xsl:value-of select="."/>
1703
- </xsl:template><xsl:template match="*[local-name()='br']">
1704
- <xsl:value-of select="$linebreak"/>
1705
- </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1706
- <!-- <xsl:call-template name="add-zero-spaces"/> -->
1707
- <xsl:call-template name="add-zero-spaces-java"/>
1708
- </xsl:template><xsl:template match="*[local-name()='table']">
1709
-
1710
- <xsl:variable name="simple-table">
1711
- <!-- <xsl:copy> -->
1712
- <xsl:call-template name="getSimpleTable"/>
1713
- <!-- </xsl:copy> -->
1714
- </xsl:variable>
1715
-
1716
- <!-- DEBUG -->
1717
- <!-- SourceTable=<xsl:copy-of select="current()"/>EndSourceTable -->
1718
- <!-- Simpletable=<xsl:copy-of select="$simple-table"/>EndSimpltable -->
1719
-
1720
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
1721
1017
 
1722
- <!-- <xsl:if test="$namespace = 'iso'">
1723
- <fo:block space-before="6pt">&#xA0;</fo:block>
1724
- </xsl:if> -->
1725
1018
 
1726
- <xsl:choose>
1727
- <xsl:when test="@unnumbered = 'true'"/>
1728
- <xsl:otherwise>
1729
-
1730
-
1731
-
1732
- <fo:block font-weight="bold" text-align="center" margin-bottom="6pt" keep-with-next="always">
1733
-
1734
-
1735
-
1736
-
1737
-
1738
-
1739
-
1740
-
1741
- <xsl:variable name="title-table">
1742
- <xsl:call-template name="getTitle">
1743
- <xsl:with-param name="name" select="'title-table'"/>
1744
- </xsl:call-template>
1745
- </xsl:variable>
1746
- <xsl:value-of select="$title-table"/>
1747
-
1748
- <xsl:call-template name="getTableNumber"/>
1749
-
1750
-
1751
- <xsl:if test="*[local-name()='name']">
1752
-
1753
-
1754
-
1755
- <xsl:text> — </xsl:text>
1756
-
1757
- <xsl:apply-templates select="*[local-name()='name']" mode="process"/>
1758
- </xsl:if>
1759
- </fo:block>
1760
-
1761
-
1762
- <xsl:call-template name="fn_name_display"/>
1763
-
1764
- </xsl:otherwise>
1765
- </xsl:choose>
1766
1019
 
1767
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1768
1020
 
1769
- <!-- <xsl:variable name="cols-count">
1770
- <xsl:choose>
1771
- <xsl:when test="*[local-name()='thead']">
1772
- <xsl:call-template name="calculate-columns-numbers">
1773
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1774
- </xsl:call-template>
1775
- </xsl:when>
1776
- <xsl:otherwise>
1777
- <xsl:call-template name="calculate-columns-numbers">
1778
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1779
- </xsl:call-template>
1780
- </xsl:otherwise>
1781
- </xsl:choose>
1782
- </xsl:variable> -->
1783
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1784
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1785
1021
 
1786
1022
 
1787
1023
 
1788
- <xsl:variable name="colwidths">
1789
- <xsl:call-template name="calculate-column-widths">
1790
- <xsl:with-param name="cols-count" select="$cols-count"/>
1791
- <xsl:with-param name="table" select="$simple-table"/>
1792
- </xsl:call-template>
1793
- </xsl:variable>
1794
1024
 
1795
- <!-- <xsl:variable name="colwidths2">
1796
- <xsl:call-template name="calculate-column-widths">
1797
- <xsl:with-param name="cols-count" select="$cols-count"/>
1798
- </xsl:call-template>
1799
- </xsl:variable> -->
1800
1025
 
1801
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1802
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
1803
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1804
1026
 
1805
- <xsl:variable name="margin-left">
1806
- <xsl:choose>
1807
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1808
- <xsl:otherwise>0</xsl:otherwise>
1809
- </xsl:choose>
1810
- </xsl:variable>
1811
1027
 
1812
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1813
-
1814
-
1815
-
1816
-
1817
-
1818
-
1819
-
1820
-
1821
- <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
1822
-
1823
-
1824
-
1825
-
1826
-
1827
-
1828
-
1829
-
1830
-
1831
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1832
-
1833
-
1834
-
1835
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1836
- <xsl:choose>
1837
- <xsl:when test=". = 1 or . = 0">
1838
- <fo:table-column column-width="proportional-column-width(2)"/>
1839
- </xsl:when>
1840
- <xsl:otherwise>
1841
- <fo:table-column column-width="proportional-column-width({.})"/>
1842
- </xsl:otherwise>
1843
- </xsl:choose>
1844
- </xsl:for-each>
1845
-
1846
- <xsl:choose>
1847
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1848
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1849
- </xsl:when>
1850
- <xsl:otherwise>
1851
- <xsl:apply-templates/>
1852
- </xsl:otherwise>
1853
- </xsl:choose>
1854
-
1855
- </fo:table>
1856
-
1857
-
1858
-
1859
- </fo:block-container>
1860
- </xsl:template><xsl:template name="getTableNumber">
1861
- <xsl:choose>
1862
- <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
1863
- <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/>
1864
- </xsl:when>
1865
- <xsl:when test="ancestor::*[local-name()='annex']">
1866
1028
 
1029
+
1030
+
1031
+
1032
+ </xsl:attribute-set><xsl:attribute-set name="example-p-style">
1033
+
1034
+
1035
+ <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
1036
+
1037
+
1038
+
1039
+
1040
+
1041
+
1042
+
1043
+
1044
+
1045
+
1046
+
1047
+
1048
+ </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
1049
+
1050
+ <xsl:attribute name="padding-right">10mm</xsl:attribute>
1051
+
1052
+
1053
+
1867
1054
 
1055
+ </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1056
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1057
+
1058
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1059
+ <xsl:attribute name="text-align">center</xsl:attribute>
1060
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1061
+
1062
+
1063
+
1064
+
1868
1065
 
1066
+
1067
+
1068
+
1869
1069
 
1070
+
1071
+
1072
+ </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1870
1073
 
1074
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
1075
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1076
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1077
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1078
+
1079
+
1080
+
1081
+ </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
1082
+
1083
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1084
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1085
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1086
+
1087
+
1088
+
1089
+ </xsl:attribute-set><xsl:attribute-set name="xref-style">
1090
+
1091
+
1092
+
1093
+ </xsl:attribute-set><xsl:attribute-set name="eref-style">
1094
+
1095
+
1096
+ <xsl:attribute name="color">blue</xsl:attribute>
1097
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1098
+
1099
+
1100
+
1101
+ </xsl:attribute-set><xsl:attribute-set name="note-style">
1102
+
1103
+
1104
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1105
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1106
+
1107
+
1871
1108
 
1109
+
1110
+
1111
+
1112
+
1113
+
1114
+
1115
+
1116
+
1117
+
1118
+ </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">
1119
+
1120
+
1121
+ <xsl:attribute name="padding-right">6mm</xsl:attribute>
1122
+
1123
+
1124
+
1125
+
1126
+
1127
+
1128
+
1129
+
1130
+
1131
+
1132
+
1133
+ </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1134
+
1135
+
1136
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1137
+
1138
+
1872
1139
 
1140
+
1141
+
1142
+
1143
+
1144
+
1145
+
1146
+
1147
+
1148
+
1149
+ </xsl:attribute-set><xsl:attribute-set name="termnote-style">
1150
+
1151
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1152
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1153
+
1154
+
1155
+
1156
+
1157
+
1158
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1873
1159
 
1874
- <xsl:number format="A-1" level="multiple" count="*[local-name()='annex'] | *[local-name()='table'][not(@unnumbered) or @unnumbered != 'true'] "/>
1160
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1161
+
1162
+
1163
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1164
+ <xsl:attribute name="margin-left">12mm</xsl:attribute>
1165
+ <xsl:attribute name="margin-right">12mm</xsl:attribute>
1166
+
1167
+
1168
+
1169
+
1170
+
1171
+ </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1172
+
1173
+
1174
+ <xsl:attribute name="text-align">right</xsl:attribute>
1875
1175
 
1876
- </xsl:when>
1877
- <xsl:otherwise>
1878
1176
 
1177
+ </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1178
+
1179
+
1180
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1181
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1182
+
1183
+
1184
+
1185
+
1186
+ </xsl:attribute-set><xsl:attribute-set name="origin-style">
1187
+
1188
+
1189
+
1190
+ </xsl:attribute-set><xsl:attribute-set name="term-style">
1191
+
1192
+ </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1879
1193
 
1880
- <xsl:number format="A." count="*[local-name()='annex']"/>
1881
- <xsl:number format="1" level="any" count="//*[local-name()='table'] [not(ancestor::*[local-name()='annex']) and not(ancestor::*[local-name()='executivesummary']) and not(ancestor::*[local-name()='bibdata'])] [not(@unnumbered) or @unnumbered != 'true']"/>
1194
+
1195
+
1196
+
1882
1197
 
1883
- </xsl:otherwise>
1884
- </xsl:choose>
1885
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']"/><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="process">
1886
- <xsl:apply-templates/>
1887
- </xsl:template><xsl:template name="calculate-columns-numbers">
1888
- <xsl:param name="table-row"/>
1889
- <xsl:variable name="columns-count" select="count($table-row/*)"/>
1890
- <xsl:variable name="sum-colspans" select="sum($table-row/*/@colspan)"/>
1891
- <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
1892
- <xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
1893
- </xsl:template><xsl:template name="calculate-column-widths">
1894
- <xsl:param name="table"/>
1895
- <xsl:param name="cols-count"/>
1896
- <xsl:param name="curr-col" select="1"/>
1897
- <xsl:param name="width" select="0"/>
1198
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1199
+ <xsl:attribute name="text-align">center</xsl:attribute>
1200
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1201
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1202
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1898
1203
 
1899
- <xsl:if test="$curr-col &lt;= $cols-count">
1204
+
1205
+
1206
+
1207
+
1208
+
1209
+
1210
+
1211
+
1212
+
1213
+
1214
+
1215
+
1216
+ </xsl:attribute-set><xsl:attribute-set name="formula-style">
1217
+
1218
+ </xsl:attribute-set><xsl:attribute-set name="image-style">
1219
+ <xsl:attribute name="text-align">center</xsl:attribute>
1220
+
1221
+
1222
+
1223
+
1224
+
1225
+ </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1226
+
1227
+ </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1228
+
1229
+ <xsl:attribute name="width">100%</xsl:attribute>
1230
+ <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
1231
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
1232
+
1233
+
1234
+
1235
+
1236
+
1237
+ </xsl:attribute-set><xsl:attribute-set name="tt-style">
1238
+
1239
+ <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
1240
+
1241
+
1242
+
1243
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1244
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1245
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1246
+ <xsl:attribute name="text-align">center</xsl:attribute>
1247
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1248
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1249
+
1250
+ </xsl:attribute-set><xsl:attribute-set name="domain-style">
1251
+
1252
+ </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1253
+
1254
+
1255
+ </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1256
+
1257
+ </xsl:attribute-set><xsl:attribute-set name="definition-style">
1258
+
1259
+
1260
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1261
+
1262
+ </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
1263
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1264
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1265
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1266
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1267
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1268
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1269
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1270
+
1271
+ <!-- Normative references -->
1272
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1273
+ <!-- Terms and definitions -->
1274
+ <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"/>
1275
+ <!-- Another main sections -->
1276
+ <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"/>
1277
+ <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1278
+ <!-- Bibliography -->
1279
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1280
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1281
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1282
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1283
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1284
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1285
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1286
+ </xsl:template><xsl:template name="processMainSectionsDefault">
1287
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1288
+
1289
+ <!-- Normative references -->
1290
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
1291
+ <!-- Terms and definitions -->
1292
+ <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']]"/>
1293
+ <!-- Another main sections -->
1294
+ <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'])]"/>
1295
+ <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1296
+ <!-- Bibliography -->
1297
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1298
+ </xsl:template><xsl:template match="text()">
1299
+ <xsl:value-of select="."/>
1300
+ </xsl:template><xsl:template match="*[local-name()='br']">
1301
+ <xsl:value-of select="$linebreak"/>
1302
+ </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1303
+ <!-- <xsl:call-template name="add-zero-spaces"/> -->
1304
+ <xsl:call-template name="add-zero-spaces-java"/>
1305
+ </xsl:template><xsl:template match="*[local-name()='table']">
1306
+
1307
+ <xsl:variable name="simple-table">
1308
+ <xsl:call-template name="getSimpleTable"/>
1309
+ </xsl:variable>
1310
+
1311
+
1312
+
1313
+
1314
+
1315
+ <!-- $namespace = 'iso' or -->
1316
+
1317
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1318
+
1319
+
1320
+
1321
+ <xsl:call-template name="fn_name_display"/>
1322
+
1323
+
1324
+
1325
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1326
+
1327
+ <!-- <xsl:variable name="cols-count">
1328
+ <xsl:choose>
1329
+ <xsl:when test="*[local-name()='thead']">
1330
+ <xsl:call-template name="calculate-columns-numbers">
1331
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1332
+ </xsl:call-template>
1333
+ </xsl:when>
1334
+ <xsl:otherwise>
1335
+ <xsl:call-template name="calculate-columns-numbers">
1336
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1337
+ </xsl:call-template>
1338
+ </xsl:otherwise>
1339
+ </xsl:choose>
1340
+ </xsl:variable> -->
1341
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1342
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1343
+
1344
+
1345
+
1346
+ <xsl:variable name="colwidths">
1347
+ <xsl:call-template name="calculate-column-widths">
1348
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1349
+ <xsl:with-param name="table" select="$simple-table"/>
1350
+ </xsl:call-template>
1351
+ </xsl:variable>
1352
+
1353
+ <!-- <xsl:variable name="colwidths2">
1354
+ <xsl:call-template name="calculate-column-widths">
1355
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1356
+ </xsl:call-template>
1357
+ </xsl:variable> -->
1358
+
1359
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1360
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1361
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1362
+
1363
+ <xsl:variable name="margin-left">
1364
+ <xsl:choose>
1365
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1366
+ <xsl:otherwise>0</xsl:otherwise>
1367
+ </xsl:choose>
1368
+ </xsl:variable>
1369
+
1370
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1371
+
1372
+
1373
+
1374
+
1375
+
1376
+
1377
+
1378
+
1379
+
1380
+ <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
1381
+
1382
+
1383
+
1384
+
1385
+
1386
+
1387
+
1388
+
1389
+
1390
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1391
+
1392
+
1393
+
1394
+
1395
+
1396
+
1397
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1398
+ <xsl:choose>
1399
+ <xsl:when test=". = 1 or . = 0">
1400
+ <fo:table-column column-width="proportional-column-width(2)"/>
1401
+ </xsl:when>
1402
+ <xsl:otherwise>
1403
+ <fo:table-column column-width="proportional-column-width({.})"/>
1404
+ </xsl:otherwise>
1405
+ </xsl:choose>
1406
+ </xsl:for-each>
1407
+
1408
+ <xsl:choose>
1409
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1410
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1411
+ </xsl:when>
1412
+ <xsl:otherwise>
1413
+ <xsl:apply-templates/>
1414
+ </xsl:otherwise>
1415
+ </xsl:choose>
1416
+
1417
+ </fo:table>
1418
+
1419
+
1420
+
1421
+
1422
+
1423
+ </fo:block-container>
1424
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1425
+ <xsl:if test="normalize-space() != ''">
1426
+ <fo:block xsl:use-attribute-sets="table-name-style">
1427
+
1428
+ <xsl:apply-templates/>
1429
+ </fo:block>
1430
+ </xsl:if>
1431
+ </xsl:template><xsl:template name="calculate-columns-numbers">
1432
+ <xsl:param name="table-row"/>
1433
+ <xsl:variable name="columns-count" select="count($table-row/*)"/>
1434
+ <xsl:variable name="sum-colspans" select="sum($table-row/*/@colspan)"/>
1435
+ <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
1436
+ <xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
1437
+ </xsl:template><xsl:template name="calculate-column-widths">
1438
+ <xsl:param name="table"/>
1439
+ <xsl:param name="cols-count"/>
1440
+ <xsl:param name="curr-col" select="1"/>
1441
+ <xsl:param name="width" select="0"/>
1442
+
1443
+ <xsl:if test="$curr-col &lt;= $cols-count">
1900
1444
  <xsl:variable name="widths">
1901
1445
  <xsl:choose>
1902
1446
  <xsl:when test="not($table)"><!-- this branch is not using in production, for debug only -->
@@ -1998,10 +1542,25 @@
1998
1542
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1999
1543
  <xsl:param name="cols-count"/>
2000
1544
  <!-- font-weight="bold" -->
2001
- <fo:table-header>
2002
-
1545
+ <fo:table-header>
1546
+
2003
1547
  <xsl:apply-templates/>
2004
1548
  </fo:table-header>
1549
+ </xsl:template><xsl:template name="table-header-title">
1550
+ <xsl:param name="cols-count"/>
1551
+ <!-- row for title -->
1552
+ <fo:table-row>
1553
+ <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">
1554
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1555
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1556
+ <xsl:call-template name="fn_name_display"/>
1557
+ </xsl:for-each>
1558
+ <fo:block text-align="right" font-style="italic">
1559
+ <xsl:text> </xsl:text>
1560
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1561
+ </fo:block>
1562
+ </fo:table-cell>
1563
+ </fo:table-row>
2005
1564
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
2006
1565
  <fo:table-body>
2007
1566
  <xsl:apply-templates/>
@@ -2065,6 +1624,8 @@
2065
1624
  </xsl:choose>
2066
1625
  </xsl:variable>
2067
1626
 
1627
+
1628
+
2068
1629
  <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
2069
1630
  <xsl:with-param name="cols-count" select="$cols-count"/>
2070
1631
  </xsl:apply-templates>
@@ -2074,6 +1635,8 @@
2074
1635
  </xsl:call-template>
2075
1636
 
2076
1637
  <fo:table-body>
1638
+
1639
+
2077
1640
  <xsl:apply-templates/>
2078
1641
  <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
2079
1642
 
@@ -2096,11 +1659,24 @@
2096
1659
 
2097
1660
  </xsl:if>
2098
1661
 
1662
+
1663
+
2099
1664
 
2100
1665
  <xsl:apply-templates/>
2101
1666
  </fo:table-row>
2102
1667
  </xsl:template><xsl:template match="*[local-name()='th']">
2103
1668
  <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
1669
+ <xsl:attribute name="text-align">
1670
+ <xsl:choose>
1671
+ <xsl:when test="@align">
1672
+ <xsl:value-of select="@align"/>
1673
+ </xsl:when>
1674
+ <xsl:otherwise>center</xsl:otherwise>
1675
+ </xsl:choose>
1676
+ </xsl:attribute>
1677
+
1678
+
1679
+
2104
1680
 
2105
1681
 
2106
1682
 
@@ -2118,15 +1694,36 @@
2118
1694
  <xsl:value-of select="@rowspan"/>
2119
1695
  </xsl:attribute>
2120
1696
  </xsl:if>
1697
+ <xsl:call-template name="display-align"/>
2121
1698
  <fo:block>
2122
1699
  <xsl:apply-templates/>
2123
1700
  </fo:block>
2124
1701
  </fo:table-cell>
1702
+ </xsl:template><xsl:template name="display-align">
1703
+ <xsl:if test="@valign">
1704
+ <xsl:attribute name="display-align">
1705
+ <xsl:choose>
1706
+ <xsl:when test="@valign = 'top'">before</xsl:when>
1707
+ <xsl:when test="@valign = 'middle'">center</xsl:when>
1708
+ <xsl:when test="@valign = 'bottom'">after</xsl:when>
1709
+ <xsl:otherwise>before</xsl:otherwise>
1710
+ </xsl:choose>
1711
+ </xsl:attribute>
1712
+ </xsl:if>
2125
1713
  </xsl:template><xsl:template match="*[local-name()='td']">
2126
1714
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
1715
+ <xsl:attribute name="text-align">
1716
+ <xsl:choose>
1717
+ <xsl:when test="@align">
1718
+ <xsl:value-of select="@align"/>
1719
+ </xsl:when>
1720
+ <xsl:otherwise>left</xsl:otherwise>
1721
+ </xsl:choose>
1722
+ </xsl:attribute>
2127
1723
 
2128
1724
 
2129
1725
 
1726
+
2130
1727
 
2131
1728
 
2132
1729
 
@@ -2143,24 +1740,12 @@
2143
1740
  <xsl:value-of select="@rowspan"/>
2144
1741
  </xsl:attribute>
2145
1742
  </xsl:if>
2146
- <fo:block>
2147
-
1743
+ <xsl:call-template name="display-align"/>
1744
+ <fo:block>
2148
1745
  <xsl:apply-templates/>
2149
- </fo:block>
2150
- <!-- <xsl:choose>
2151
- <xsl:when test="count(*) = 1 and *[local-name() = 'p']">
2152
- <xsl:apply-templates />
2153
- </xsl:when>
2154
- <xsl:otherwise>
2155
- <fo:block>
2156
- <xsl:apply-templates />
2157
- </fo:block>
2158
- </xsl:otherwise>
2159
- </xsl:choose> -->
2160
-
2161
-
1746
+ </fo:block>
2162
1747
  </fo:table-cell>
2163
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
1748
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
2164
1749
 
2165
1750
 
2166
1751
  <fo:block font-size="10pt" margin-bottom="12pt">
@@ -2172,22 +1757,14 @@
2172
1757
 
2173
1758
 
2174
1759
 
2175
- <xsl:variable name="title-note">
2176
- <xsl:call-template name="getTitle">
2177
- <xsl:with-param name="name" select="'title-note'"/>
2178
- </xsl:call-template>
2179
- </xsl:variable>
2180
- <xsl:value-of select="$title-note"/>
2181
-
2182
-
2183
-
2184
- <xsl:number format="1 "/>
2185
-
1760
+
1761
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1762
+
2186
1763
  </fo:inline>
2187
1764
  <xsl:apply-templates mode="process"/>
2188
1765
  </fo:block>
2189
1766
 
2190
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
1767
+ </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">
2191
1768
  <xsl:apply-templates/>
2192
1769
  </xsl:template><xsl:template name="fn_display">
2193
1770
  <xsl:variable name="references">
@@ -2247,7 +1824,7 @@
2247
1824
  <!-- and (not(@class) or @class !='pseudocode') -->
2248
1825
  </xsl:variable>
2249
1826
  <xsl:variable name="references">
2250
- <xsl:for-each select=".//*[local-name()='fn']">
1827
+ <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]">
2251
1828
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2252
1829
  <xsl:apply-templates/>
2253
1830
  </fn>
@@ -2341,6 +1918,7 @@
2341
1918
 
2342
1919
 
2343
1920
 
1921
+
2344
1922
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2345
1923
 
2346
1924
  <xsl:value-of select="@reference"/>
@@ -2351,115 +1929,129 @@
2351
1929
  <xsl:apply-templates/>
2352
1930
  </fo:inline>
2353
1931
  </xsl:template><xsl:template match="*[local-name()='dl']">
2354
- <xsl:variable name="parent" select="local-name(..)"/>
2355
-
2356
- <xsl:variable name="key_iso">
2357
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
2358
- </xsl:variable>
2359
-
2360
- <xsl:choose>
2361
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2362
-
2363
-
2364
- <fo:block margin-bottom="12pt" text-align="left">
2365
-
2366
- <xsl:variable name="title-where">
2367
- <xsl:call-template name="getTitle">
2368
- <xsl:with-param name="name" select="'title-where'"/>
2369
- </xsl:call-template>
2370
- </xsl:variable>
2371
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2372
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
2373
- <xsl:text/>
2374
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2375
- </fo:block>
2376
-
2377
- </xsl:when>
2378
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2379
- <fo:block margin-bottom="12pt" text-align="left">
2380
-
2381
-
2382
-
2383
-
2384
- <xsl:variable name="title-where">
2385
- <xsl:call-template name="getTitle">
2386
- <xsl:with-param name="name" select="'title-where'"/>
2387
- </xsl:call-template>
2388
- </xsl:variable>
2389
- <xsl:value-of select="$title-where"/>
2390
- </fo:block>
2391
- </xsl:when>
2392
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2393
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2394
-
2395
-
2396
-
2397
- <xsl:variable name="title-key">
2398
- <xsl:call-template name="getTitle">
2399
- <xsl:with-param name="name" select="'title-key'"/>
2400
- </xsl:call-template>
2401
- </xsl:variable>
2402
- <xsl:value-of select="$title-key"/>
2403
- </fo:block>
2404
- </xsl:when>
2405
- </xsl:choose>
2406
-
2407
- <!-- a few components -->
2408
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2409
- <fo:block>
1932
+ <fo:block-container margin-left="0mm">
1933
+ <xsl:if test="parent::*[local-name() = 'note']">
1934
+ <xsl:attribute name="margin-left">
1935
+ <xsl:choose>
1936
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
1937
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
1938
+ </xsl:choose>
1939
+ </xsl:attribute>
2410
1940
 
1941
+ </xsl:if>
1942
+ <fo:block-container margin-left="0mm">
1943
+
1944
+ <xsl:variable name="parent" select="local-name(..)"/>
2411
1945
 
1946
+ <xsl:variable name="key_iso">
1947
+ <!-- and (not(../@class) or ../@class !='pseudocode') -->
1948
+ </xsl:variable>
2412
1949
 
1950
+ <xsl:choose>
1951
+ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
1952
+
1953
+
1954
+ <fo:block margin-bottom="12pt" text-align="left">
1955
+
1956
+ <xsl:variable name="title-where">
1957
+ <xsl:call-template name="getTitle">
1958
+ <xsl:with-param name="name" select="'title-where'"/>
1959
+ </xsl:call-template>
1960
+ </xsl:variable>
1961
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
1962
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
1963
+ <xsl:text/>
1964
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
1965
+ </fo:block>
1966
+
1967
+ </xsl:when>
1968
+ <xsl:when test="$parent = 'formula'"> <!-- a few components -->
1969
+ <fo:block margin-bottom="12pt" text-align="left">
1970
+
1971
+
1972
+
1973
+
1974
+ <xsl:variable name="title-where">
1975
+ <xsl:call-template name="getTitle">
1976
+ <xsl:with-param name="name" select="'title-where'"/>
1977
+ </xsl:call-template>
1978
+ </xsl:variable>
1979
+ <xsl:value-of select="$title-where"/>
1980
+ </fo:block>
1981
+ </xsl:when>
1982
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
1983
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
1984
+
1985
+
1986
+
1987
+ <xsl:variable name="title-key">
1988
+ <xsl:call-template name="getTitle">
1989
+ <xsl:with-param name="name" select="'title-key'"/>
1990
+ </xsl:call-template>
1991
+ </xsl:variable>
1992
+ <xsl:value-of select="$title-key"/>
1993
+ </fo:block>
1994
+ </xsl:when>
1995
+ </xsl:choose>
2413
1996
 
2414
- <fo:block>
2415
-
2416
-
2417
-
2418
-
2419
- <fo:table width="95%" table-layout="fixed">
1997
+ <!-- a few components -->
1998
+ <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
1999
+ <fo:block>
2420
2000
 
2421
- <xsl:choose>
2422
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2423
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2424
- </xsl:when>
2425
- <xsl:when test="normalize-space($key_iso) = 'true'">
2426
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2001
+
2002
+
2003
+
2004
+ <fo:block>
2005
+
2006
+
2007
+
2008
+
2009
+ <fo:table width="95%" table-layout="fixed">
2427
2010
 
2428
- </xsl:when>
2429
- </xsl:choose>
2430
- <!-- create virtual html table for dl/[dt and dd] -->
2431
- <xsl:variable name="html-table">
2432
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2433
- <xsl:element name="{$ns}:table">
2434
- <tbody>
2435
- <xsl:apply-templates mode="dl"/>
2436
- </tbody>
2437
- </xsl:element>
2438
- </xsl:variable>
2439
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
2440
- <xsl:variable name="colwidths">
2441
- <xsl:call-template name="calculate-column-widths">
2442
- <xsl:with-param name="cols-count" select="2"/>
2443
- <xsl:with-param name="table" select="$html-table"/>
2444
- </xsl:call-template>
2445
- </xsl:variable>
2446
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2447
- <xsl:variable name="maxlength_dt">
2448
- <xsl:call-template name="getMaxLength_dt"/>
2449
- </xsl:variable>
2450
- <xsl:call-template name="setColumnWidth_dl">
2451
- <xsl:with-param name="colwidths" select="$colwidths"/>
2452
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2453
- </xsl:call-template>
2454
- <fo:table-body>
2455
- <xsl:apply-templates>
2456
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2457
- </xsl:apply-templates>
2458
- </fo:table-body>
2459
- </fo:table>
2460
- </fo:block>
2461
- </fo:block>
2462
- </xsl:if>
2011
+ <xsl:choose>
2012
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2013
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2014
+ </xsl:when>
2015
+ <xsl:when test="normalize-space($key_iso) = 'true'">
2016
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2017
+
2018
+ </xsl:when>
2019
+ </xsl:choose>
2020
+ <!-- create virtual html table for dl/[dt and dd] -->
2021
+ <xsl:variable name="html-table">
2022
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2023
+ <xsl:element name="{$ns}:table">
2024
+ <tbody>
2025
+ <xsl:apply-templates mode="dl"/>
2026
+ </tbody>
2027
+ </xsl:element>
2028
+ </xsl:variable>
2029
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
2030
+ <xsl:variable name="colwidths">
2031
+ <xsl:call-template name="calculate-column-widths">
2032
+ <xsl:with-param name="cols-count" select="2"/>
2033
+ <xsl:with-param name="table" select="$html-table"/>
2034
+ </xsl:call-template>
2035
+ </xsl:variable>
2036
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2037
+ <xsl:variable name="maxlength_dt">
2038
+ <xsl:call-template name="getMaxLength_dt"/>
2039
+ </xsl:variable>
2040
+ <xsl:call-template name="setColumnWidth_dl">
2041
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2042
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2043
+ </xsl:call-template>
2044
+ <fo:table-body>
2045
+ <xsl:apply-templates>
2046
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2047
+ </xsl:apply-templates>
2048
+ </fo:table-body>
2049
+ </fo:table>
2050
+ </fo:block>
2051
+ </fo:block>
2052
+ </xsl:if>
2053
+ </fo:block-container>
2054
+ </fo:block-container>
2463
2055
  </xsl:template><xsl:template name="setColumnWidth_dl">
2464
2056
  <xsl:param name="colwidths"/>
2465
2057
  <xsl:param name="maxlength_dt"/>
@@ -2514,7 +2106,7 @@
2514
2106
  <xsl:value-of select="string-length(normalize-space(.))"/>
2515
2107
  </xsl:if>
2516
2108
  </xsl:for-each>
2517
- </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']">
2109
+ </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2518
2110
  <xsl:param name="key_iso"/>
2519
2111
 
2520
2112
  <!-- <tr>
@@ -2530,12 +2122,7 @@
2530
2122
  <xsl:if test="normalize-space($key_iso) = 'true'">
2531
2123
  <xsl:attribute name="margin-top">0</xsl:attribute>
2532
2124
  </xsl:if>
2533
- <xsl:variable name="title-note">
2534
- <xsl:call-template name="getTitle">
2535
- <xsl:with-param name="name" select="'title-note'"/>
2536
- </xsl:call-template>
2537
- </xsl:variable>
2538
- <xsl:value-of select="$title-note"/>
2125
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2539
2126
  </fo:block>
2540
2127
  </fo:table-cell>
2541
2128
  <fo:table-cell>
@@ -2561,6 +2148,7 @@
2561
2148
  <xsl:param name="key_iso"/>
2562
2149
 
2563
2150
  <fo:table-row>
2151
+
2564
2152
  <fo:table-cell>
2565
2153
 
2566
2154
  <fo:block margin-top="6pt">
@@ -2588,14 +2176,36 @@
2588
2176
  <fo:table-cell>
2589
2177
  <fo:block>
2590
2178
 
2591
-
2179
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2180
+ <xsl:if test="local-name(*[1]) != 'stem'">
2181
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2182
+ </xsl:if>
2183
+ </xsl:if> -->
2592
2184
 
2593
2185
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2594
2186
 
2595
2187
  </fo:block>
2596
2188
  </fo:table-cell>
2597
2189
  </fo:table-row>
2598
-
2190
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2191
+ <xsl:if test="local-name(*[1]) = 'stem'">
2192
+ <fo:table-row>
2193
+ <fo:table-cell>
2194
+ <fo:block margin-top="6pt">
2195
+ <xsl:if test="normalize-space($key_iso) = 'true'">
2196
+ <xsl:attribute name="margin-top">0</xsl:attribute>
2197
+ </xsl:if>
2198
+ <xsl:text>&#xA0;</xsl:text>
2199
+ </fo:block>
2200
+ </fo:table-cell>
2201
+ <fo:table-cell>
2202
+ <fo:block>
2203
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2204
+ </fo:block>
2205
+ </fo:table-cell>
2206
+ </fo:table-row>
2207
+ </xsl:if>
2208
+ </xsl:if> -->
2599
2209
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2600
2210
  <xsl:apply-templates/>
2601
2211
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
@@ -2606,7 +2216,7 @@
2606
2216
  <fo:inline font-style="italic">
2607
2217
  <xsl:apply-templates/>
2608
2218
  </fo:inline>
2609
- </xsl:template><xsl:template match="*[local-name()='strong']">
2219
+ </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2610
2220
  <fo:inline font-weight="bold">
2611
2221
  <xsl:apply-templates/>
2612
2222
  </fo:inline>
@@ -2619,7 +2229,32 @@
2619
2229
  <xsl:apply-templates/>
2620
2230
  </fo:inline>
2621
2231
  </xsl:template><xsl:template match="*[local-name()='tt']">
2622
- <fo:inline font-family="Courier" font-size="10pt">
2232
+ <fo:inline xsl:use-attribute-sets="tt-style">
2233
+ <xsl:variable name="_font-size">
2234
+
2235
+ 10
2236
+
2237
+
2238
+
2239
+
2240
+
2241
+
2242
+
2243
+
2244
+
2245
+
2246
+
2247
+
2248
+ </xsl:variable>
2249
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
2250
+ <xsl:if test="$font-size != ''">
2251
+ <xsl:attribute name="font-size">
2252
+ <xsl:choose>
2253
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
2254
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
2255
+ </xsl:choose>
2256
+ </xsl:attribute>
2257
+ </xsl:if>
2623
2258
  <xsl:apply-templates/>
2624
2259
  </fo:inline>
2625
2260
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -2724,343 +2359,1373 @@
2724
2359
  <xsl:variable name="zero-space-after-underscore">_</xsl:variable>
2725
2360
  <xsl:variable name="zero-space">​</xsl:variable>
2726
2361
  <xsl:choose>
2727
- <xsl:when test="contains($text, $zero-space-after-chars)">
2728
- <xsl:value-of select="substring-before($text, $zero-space-after-chars)"/>
2729
- <xsl:value-of select="$zero-space-after-chars"/>
2730
- <xsl:value-of select="$zero-space"/>
2731
- <xsl:call-template name="add-zero-spaces">
2732
- <xsl:with-param name="text" select="substring-after($text, $zero-space-after-chars)"/>
2733
- </xsl:call-template>
2734
- </xsl:when>
2735
- <xsl:when test="contains($text, $zero-space-after-dot)">
2736
- <xsl:value-of select="substring-before($text, $zero-space-after-dot)"/>
2737
- <xsl:value-of select="$zero-space-after-dot"/>
2738
- <xsl:value-of select="$zero-space"/>
2739
- <xsl:call-template name="add-zero-spaces">
2740
- <xsl:with-param name="text" select="substring-after($text, $zero-space-after-dot)"/>
2741
- </xsl:call-template>
2742
- </xsl:when>
2743
- <xsl:when test="contains($text, $zero-space-after-colon)">
2744
- <xsl:value-of select="substring-before($text, $zero-space-after-colon)"/>
2745
- <xsl:value-of select="$zero-space-after-colon"/>
2746
- <xsl:value-of select="$zero-space"/>
2747
- <xsl:call-template name="add-zero-spaces">
2748
- <xsl:with-param name="text" select="substring-after($text, $zero-space-after-colon)"/>
2749
- </xsl:call-template>
2750
- </xsl:when>
2751
- <xsl:when test="contains($text, $zero-space-after-equal)">
2752
- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
2753
- <xsl:value-of select="$zero-space-after-equal"/>
2754
- <xsl:value-of select="$zero-space"/>
2755
- <xsl:call-template name="add-zero-spaces">
2756
- <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
2757
- </xsl:call-template>
2362
+ <xsl:when test="contains($text, $zero-space-after-chars)">
2363
+ <xsl:value-of select="substring-before($text, $zero-space-after-chars)"/>
2364
+ <xsl:value-of select="$zero-space-after-chars"/>
2365
+ <xsl:value-of select="$zero-space"/>
2366
+ <xsl:call-template name="add-zero-spaces">
2367
+ <xsl:with-param name="text" select="substring-after($text, $zero-space-after-chars)"/>
2368
+ </xsl:call-template>
2369
+ </xsl:when>
2370
+ <xsl:when test="contains($text, $zero-space-after-dot)">
2371
+ <xsl:value-of select="substring-before($text, $zero-space-after-dot)"/>
2372
+ <xsl:value-of select="$zero-space-after-dot"/>
2373
+ <xsl:value-of select="$zero-space"/>
2374
+ <xsl:call-template name="add-zero-spaces">
2375
+ <xsl:with-param name="text" select="substring-after($text, $zero-space-after-dot)"/>
2376
+ </xsl:call-template>
2377
+ </xsl:when>
2378
+ <xsl:when test="contains($text, $zero-space-after-colon)">
2379
+ <xsl:value-of select="substring-before($text, $zero-space-after-colon)"/>
2380
+ <xsl:value-of select="$zero-space-after-colon"/>
2381
+ <xsl:value-of select="$zero-space"/>
2382
+ <xsl:call-template name="add-zero-spaces">
2383
+ <xsl:with-param name="text" select="substring-after($text, $zero-space-after-colon)"/>
2384
+ </xsl:call-template>
2385
+ </xsl:when>
2386
+ <xsl:when test="contains($text, $zero-space-after-equal)">
2387
+ <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
2388
+ <xsl:value-of select="$zero-space-after-equal"/>
2389
+ <xsl:value-of select="$zero-space"/>
2390
+ <xsl:call-template name="add-zero-spaces">
2391
+ <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
2392
+ </xsl:call-template>
2393
+ </xsl:when>
2394
+ <xsl:when test="contains($text, $zero-space-after-underscore)">
2395
+ <xsl:value-of select="substring-before($text, $zero-space-after-underscore)"/>
2396
+ <xsl:value-of select="$zero-space-after-underscore"/>
2397
+ <xsl:value-of select="$zero-space"/>
2398
+ <xsl:call-template name="add-zero-spaces">
2399
+ <xsl:with-param name="text" select="substring-after($text, $zero-space-after-underscore)"/>
2400
+ </xsl:call-template>
2401
+ </xsl:when>
2402
+ <xsl:otherwise>
2403
+ <xsl:value-of select="$text"/>
2404
+ </xsl:otherwise>
2405
+ </xsl:choose>
2406
+ </xsl:template><xsl:template name="add-zero-spaces-equal">
2407
+ <xsl:param name="text" select="."/>
2408
+ <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
2409
+ <xsl:variable name="zero-space-after-equal">=</xsl:variable>
2410
+ <xsl:variable name="zero-space">​</xsl:variable>
2411
+ <xsl:choose>
2412
+ <xsl:when test="contains($text, $zero-space-after-equals)">
2413
+ <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
2414
+ <xsl:value-of select="$zero-space-after-equals"/>
2415
+ <xsl:value-of select="$zero-space"/>
2416
+ <xsl:call-template name="add-zero-spaces-equal">
2417
+ <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equals)"/>
2418
+ </xsl:call-template>
2419
+ </xsl:when>
2420
+ <xsl:when test="contains($text, $zero-space-after-equal)">
2421
+ <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
2422
+ <xsl:value-of select="$zero-space-after-equal"/>
2423
+ <xsl:value-of select="$zero-space"/>
2424
+ <xsl:call-template name="add-zero-spaces-equal">
2425
+ <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
2426
+ </xsl:call-template>
2427
+ </xsl:when>
2428
+ <xsl:otherwise>
2429
+ <xsl:value-of select="$text"/>
2430
+ </xsl:otherwise>
2431
+ </xsl:choose>
2432
+ </xsl:template><xsl:template name="getSimpleTable">
2433
+ <xsl:variable name="simple-table">
2434
+
2435
+ <!-- Step 1. colspan processing -->
2436
+ <xsl:variable name="simple-table-colspan">
2437
+ <tbody>
2438
+ <xsl:apply-templates mode="simple-table-colspan"/>
2439
+ </tbody>
2440
+ </xsl:variable>
2441
+
2442
+ <!-- Step 2. rowspan processing -->
2443
+ <xsl:variable name="simple-table-rowspan">
2444
+ <xsl:apply-templates select="xalan:nodeset($simple-table-colspan)" mode="simple-table-rowspan"/>
2445
+ </xsl:variable>
2446
+
2447
+ <xsl:copy-of select="xalan:nodeset($simple-table-rowspan)"/>
2448
+
2449
+ <!-- <xsl:choose>
2450
+ <xsl:when test="current()//*[local-name()='th'][@colspan] or current()//*[local-name()='td'][@colspan] ">
2451
+
2452
+ </xsl:when>
2453
+ <xsl:otherwise>
2454
+ <xsl:copy-of select="current()"/>
2455
+ </xsl:otherwise>
2456
+ </xsl:choose> -->
2457
+ </xsl:variable>
2458
+ <xsl:copy-of select="$simple-table"/>
2459
+ </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
2460
+ <xsl:apply-templates mode="simple-table-colspan"/>
2461
+ </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">
2462
+ <xsl:choose>
2463
+ <xsl:when test="@colspan">
2464
+ <xsl:variable name="td">
2465
+ <xsl:element name="td">
2466
+ <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
2467
+ <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
2468
+ <xsl:apply-templates mode="simple-table-colspan"/>
2469
+ </xsl:element>
2470
+ </xsl:variable>
2471
+ <xsl:call-template name="repeatNode">
2472
+ <xsl:with-param name="count" select="@colspan"/>
2473
+ <xsl:with-param name="node" select="$td"/>
2474
+ </xsl:call-template>
2475
+ </xsl:when>
2476
+ <xsl:otherwise>
2477
+ <xsl:element name="td">
2478
+ <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
2479
+ <xsl:apply-templates mode="simple-table-colspan"/>
2480
+ </xsl:element>
2481
+ </xsl:otherwise>
2482
+ </xsl:choose>
2483
+ </xsl:template><xsl:template match="@colspan" mode="simple-table-colspan"/><xsl:template match="*[local-name()='tr']" mode="simple-table-colspan">
2484
+ <xsl:element name="tr">
2485
+ <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
2486
+ <xsl:apply-templates mode="simple-table-colspan"/>
2487
+ </xsl:element>
2488
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-colspan">
2489
+ <xsl:copy>
2490
+ <xsl:apply-templates select="@*|node()" mode="simple-table-colspan"/>
2491
+ </xsl:copy>
2492
+ </xsl:template><xsl:template name="repeatNode">
2493
+ <xsl:param name="count"/>
2494
+ <xsl:param name="node"/>
2495
+
2496
+ <xsl:if test="$count &gt; 0">
2497
+ <xsl:call-template name="repeatNode">
2498
+ <xsl:with-param name="count" select="$count - 1"/>
2499
+ <xsl:with-param name="node" select="$node"/>
2500
+ </xsl:call-template>
2501
+ <xsl:copy-of select="$node"/>
2502
+ </xsl:if>
2503
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-rowspan">
2504
+ <xsl:copy>
2505
+ <xsl:apply-templates select="@*|node()" mode="simple-table-rowspan"/>
2506
+ </xsl:copy>
2507
+ </xsl:template><xsl:template match="tbody" mode="simple-table-rowspan">
2508
+ <xsl:copy>
2509
+ <xsl:copy-of select="tr[1]"/>
2510
+ <xsl:apply-templates select="tr[2]" mode="simple-table-rowspan">
2511
+ <xsl:with-param name="previousRow" select="tr[1]"/>
2512
+ </xsl:apply-templates>
2513
+ </xsl:copy>
2514
+ </xsl:template><xsl:template match="tr" mode="simple-table-rowspan">
2515
+ <xsl:param name="previousRow"/>
2516
+ <xsl:variable name="currentRow" select="."/>
2517
+
2518
+ <xsl:variable name="normalizedTDs">
2519
+ <xsl:for-each select="xalan:nodeset($previousRow)//td">
2520
+ <xsl:choose>
2521
+ <xsl:when test="@rowspan &gt; 1">
2522
+ <xsl:copy>
2523
+ <xsl:attribute name="rowspan">
2524
+ <xsl:value-of select="@rowspan - 1"/>
2525
+ </xsl:attribute>
2526
+ <xsl:copy-of select="@*[not(name() = 'rowspan')]"/>
2527
+ <xsl:copy-of select="node()"/>
2528
+ </xsl:copy>
2529
+ </xsl:when>
2530
+ <xsl:otherwise>
2531
+ <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
2532
+ </xsl:otherwise>
2533
+ </xsl:choose>
2534
+ </xsl:for-each>
2535
+ </xsl:variable>
2536
+
2537
+ <xsl:variable name="newRow">
2538
+ <xsl:copy>
2539
+ <xsl:copy-of select="$currentRow/@*"/>
2540
+ <xsl:copy-of select="xalan:nodeset($normalizedTDs)"/>
2541
+ </xsl:copy>
2542
+ </xsl:variable>
2543
+ <xsl:copy-of select="$newRow"/>
2544
+
2545
+ <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
2546
+ <xsl:with-param name="previousRow" select="$newRow"/>
2547
+ </xsl:apply-templates>
2548
+ </xsl:template><xsl:template name="getLang">
2549
+ <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2550
+ <xsl:choose>
2551
+ <xsl:when test="$language = 'English'">en</xsl:when>
2552
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
2553
+ </xsl:choose>
2554
+ </xsl:template><xsl:template name="capitalizeWords">
2555
+ <xsl:param name="str"/>
2556
+ <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
2557
+ <xsl:choose>
2558
+ <xsl:when test="contains($str2, ' ')">
2559
+ <xsl:variable name="substr" select="substring-before($str2, ' ')"/>
2560
+ <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
2561
+ <xsl:value-of select="substring($substr, 2)"/> -->
2562
+ <xsl:call-template name="capitalize">
2563
+ <xsl:with-param name="str" select="$substr"/>
2564
+ </xsl:call-template>
2565
+ <xsl:text> </xsl:text>
2566
+ <xsl:call-template name="capitalizeWords">
2567
+ <xsl:with-param name="str" select="substring-after($str2, ' ')"/>
2568
+ </xsl:call-template>
2569
+ </xsl:when>
2570
+ <xsl:otherwise>
2571
+ <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
2572
+ <xsl:value-of select="substring($str2, 2)"/> -->
2573
+ <xsl:call-template name="capitalize">
2574
+ <xsl:with-param name="str" select="$str2"/>
2575
+ </xsl:call-template>
2576
+ </xsl:otherwise>
2577
+ </xsl:choose>
2578
+ </xsl:template><xsl:template name="capitalize">
2579
+ <xsl:param name="str"/>
2580
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2581
+ <xsl:value-of select="substring($str, 2)"/>
2582
+ </xsl:template><xsl:template match="mathml:math">
2583
+ <fo:inline font-family="STIX2Math">
2584
+ <xsl:variable name="mathml">
2585
+ <xsl:apply-templates select="." mode="mathml"/>
2586
+ </xsl:variable>
2587
+ <fo:instream-foreign-object fox:alt-text="Math">
2588
+ <!-- <xsl:copy-of select="."/> -->
2589
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
2590
+ </fo:instream-foreign-object>
2591
+ </fo:inline>
2592
+ </xsl:template><xsl:template match="@*|node()" mode="mathml">
2593
+ <xsl:copy>
2594
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
2595
+ </xsl:copy>
2596
+ </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
2597
+ <xsl:copy>
2598
+ <!-- replace start and end spaces to non-break space -->
2599
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
2600
+ </xsl:copy>
2601
+ </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2602
+ <xsl:variable name="target">
2603
+ <xsl:choose>
2604
+ <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
2605
+ <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
2606
+ </xsl:when>
2607
+ <xsl:otherwise>
2608
+ <xsl:value-of select="normalize-space(@target)"/>
2609
+ </xsl:otherwise>
2610
+ </xsl:choose>
2611
+ </xsl:variable>
2612
+ <fo:inline xsl:use-attribute-sets="link-style">
2613
+ <xsl:choose>
2614
+ <xsl:when test="$target = ''">
2615
+ <xsl:apply-templates/>
2616
+ </xsl:when>
2617
+ <xsl:otherwise>
2618
+ <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
2619
+ <xsl:choose>
2620
+ <xsl:when test="normalize-space(.) = ''">
2621
+ <xsl:value-of select="$target"/>
2622
+ </xsl:when>
2623
+ <xsl:otherwise>
2624
+ <xsl:apply-templates/>
2625
+ </xsl:otherwise>
2626
+ </xsl:choose>
2627
+ </fo:basic-link>
2628
+ </xsl:otherwise>
2629
+ </xsl:choose>
2630
+ </fo:inline>
2631
+ </xsl:template><xsl:template match="*[local-name()='bookmark']">
2632
+ <fo:inline id="{@id}"/>
2633
+ </xsl:template><xsl:template match="*[local-name()='appendix']">
2634
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
2635
+ <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
2636
+ </fo:block>
2637
+ <xsl:apply-templates/>
2638
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
2639
+ <fo:inline><xsl:apply-templates/></fo:inline>
2640
+ </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
2641
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
2642
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2643
+ </fo:block>
2644
+ <xsl:apply-templates/>
2645
+ </xsl:template><xsl:template match="*[local-name() = 'callout']">
2646
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
2647
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']">
2648
+ <xsl:variable name="annotation-id" select="@id"/>
2649
+ <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
2650
+ <fo:block id="{$annotation-id}" white-space="nowrap">
2651
+ <fo:inline>
2652
+ <xsl:apply-templates>
2653
+ <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
2654
+ </xsl:apply-templates>
2655
+ </fo:inline>
2656
+ </fo:block>
2657
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
2658
+ <xsl:param name="callout"/>
2659
+ <fo:inline id="{@id}">
2660
+ <!-- for first p in annotation, put <x> -->
2661
+ <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
2662
+ <xsl:apply-templates/>
2663
+ </fo:inline>
2664
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
2665
+ <xsl:variable name="title-modified">
2666
+ <xsl:call-template name="getTitle">
2667
+ <xsl:with-param name="name" select="'title-modified'"/>
2668
+ </xsl:call-template>
2669
+ </xsl:variable>
2670
+ <xsl:choose>
2671
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2672
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
2673
+ </xsl:choose>
2674
+ <xsl:apply-templates/>
2675
+ </xsl:template><xsl:template match="*[local-name() = 'xref']">
2676
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2677
+
2678
+ <xsl:apply-templates/>
2679
+ </fo:basic-link>
2680
+ </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2681
+ <fo:block-container margin-left="0mm">
2682
+ <xsl:if test="parent::*[local-name() = 'note']">
2683
+ <xsl:attribute name="margin-left">
2684
+ <xsl:choose>
2685
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2686
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2687
+ </xsl:choose>
2688
+ </xsl:attribute>
2689
+
2690
+ </xsl:if>
2691
+ <fo:block-container margin-left="0mm">
2692
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2693
+ <xsl:apply-templates/>
2694
+ </fo:block>
2695
+ </fo:block-container>
2696
+ </fo:block-container>
2697
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2698
+ <fo:inline>
2699
+ <xsl:apply-templates/>
2700
+ </fo:inline>
2701
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']/*[local-name() = 'stem']">
2702
+ <fo:inline>
2703
+ <xsl:apply-templates/>
2704
+ </fo:inline>
2705
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation">
2706
+ <xsl:if test="normalize-space() != ''">
2707
+ <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
2708
+ </xsl:if>
2709
+ </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
2710
+
2711
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
2712
+
2713
+
2714
+
2715
+
2716
+ <fo:block-container margin-left="0mm">
2717
+
2718
+
2719
+
2720
+
2721
+
2722
+
2723
+
2724
+
2725
+ <fo:block>
2726
+
2727
+
2728
+
2729
+
2730
+ <fo:inline xsl:use-attribute-sets="note-name-style">
2731
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2732
+ </fo:inline>
2733
+ <xsl:apply-templates/>
2734
+ </fo:block>
2735
+
2736
+
2737
+ </fo:block-container>
2738
+ </fo:block-container>
2739
+
2740
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
2741
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
2742
+ <xsl:choose>
2743
+ <xsl:when test="$num = 1">
2744
+ <fo:inline xsl:use-attribute-sets="note-p-style">
2745
+ <xsl:apply-templates/>
2746
+ </fo:inline>
2747
+ </xsl:when>
2748
+ <xsl:otherwise>
2749
+ <fo:block xsl:use-attribute-sets="note-p-style">
2750
+ <xsl:apply-templates/>
2751
+ </fo:block>
2752
+ </xsl:otherwise>
2753
+ </xsl:choose>
2754
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2755
+ <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2756
+ <fo:inline xsl:use-attribute-sets="termnote-name-style">
2757
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2758
+ </fo:inline>
2759
+ <xsl:apply-templates/>
2760
+ </fo:block>
2761
+ </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">
2762
+ <xsl:param name="sfx"/>
2763
+ <xsl:variable name="suffix">
2764
+ <xsl:choose>
2765
+ <xsl:when test="$sfx != ''">
2766
+ <xsl:value-of select="$sfx"/>
2767
+ </xsl:when>
2768
+ <xsl:otherwise>
2769
+
2770
+
2771
+ </xsl:otherwise>
2772
+ </xsl:choose>
2773
+ </xsl:variable>
2774
+ <xsl:if test="normalize-space() != ''">
2775
+ <xsl:apply-templates/>
2776
+ <xsl:value-of select="$suffix"/>
2777
+ </xsl:if>
2778
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation">
2779
+ <xsl:param name="sfx"/>
2780
+ <xsl:variable name="suffix">
2781
+ <xsl:choose>
2782
+ <xsl:when test="$sfx != ''">
2783
+ <xsl:value-of select="$sfx"/>
2784
+ </xsl:when>
2785
+ <xsl:otherwise>
2786
+
2787
+
2788
+ </xsl:otherwise>
2789
+ </xsl:choose>
2790
+ </xsl:variable>
2791
+ <xsl:if test="normalize-space() != ''">
2792
+ <xsl:apply-templates/>
2793
+ <xsl:value-of select="$suffix"/>
2794
+ </xsl:if>
2795
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
2796
+ <fo:inline><xsl:apply-templates/></fo:inline>
2797
+ </xsl:template><xsl:template match="*[local-name() = 'terms']">
2798
+ <fo:block id="{@id}">
2799
+ <xsl:apply-templates/>
2800
+ </fo:block>
2801
+ </xsl:template><xsl:template match="*[local-name() = 'term']">
2802
+ <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
2803
+
2804
+
2805
+
2806
+ <xsl:apply-templates/>
2807
+ </fo:block>
2808
+ </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
2809
+ <xsl:if test="normalize-space() != ''">
2810
+ <fo:inline>
2811
+ <xsl:apply-templates/>
2812
+ <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
2813
+ <xsl:text>.</xsl:text>
2814
+ </xsl:if> -->
2815
+ </fo:inline>
2816
+ </xsl:if>
2817
+ </xsl:template><xsl:template match="*[local-name() = 'figure']">
2818
+ <fo:block-container id="{@id}">
2819
+ <fo:block>
2820
+ <xsl:apply-templates/>
2821
+ </fo:block>
2822
+ <xsl:call-template name="fn_display_figure"/>
2823
+ <xsl:for-each select="*[local-name() = 'note']">
2824
+ <xsl:call-template name="note"/>
2825
+ </xsl:for-each>
2826
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2827
+ </fo:block-container>
2828
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
2829
+ <fo:block id="{@id}">
2830
+ <xsl:apply-templates/>
2831
+ </fo:block>
2832
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
2833
+ <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
2834
+ <xsl:apply-templates/>
2835
+ </fo:block>
2836
+ </xsl:template><xsl:template match="*[local-name() = 'image']">
2837
+ <fo:block xsl:use-attribute-sets="image-style">
2838
+
2839
+
2840
+ <xsl:variable name="src">
2841
+ <xsl:choose>
2842
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
2843
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
2844
+ </xsl:when>
2845
+ <xsl:otherwise>
2846
+ <xsl:value-of select="@src"/>
2847
+ </xsl:otherwise>
2848
+ </xsl:choose>
2849
+ </xsl:variable>
2850
+
2851
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2852
+ </fo:block>
2853
+ </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">
2854
+ <xsl:apply-templates mode="contents"/>
2855
+ <xsl:text> </xsl:text>
2856
+ </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">
2857
+ <xsl:apply-templates mode="bookmarks"/>
2858
+ <xsl:text> </xsl:text>
2859
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
2860
+ <xsl:value-of select="."/>
2861
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
2862
+ <xsl:value-of select="."/>
2863
+ </xsl:template><xsl:template match="node()" mode="contents">
2864
+ <xsl:apply-templates mode="contents"/>
2865
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
2866
+ <xsl:apply-templates mode="bookmarks"/>
2867
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
2868
+ <xsl:apply-templates select="."/>
2869
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
2870
+ <xsl:apply-templates mode="bookmarks"/>
2871
+ </xsl:template><xsl:template name="addBookmarks">
2872
+ <xsl:param name="contents"/>
2873
+ <xsl:if test="xalan:nodeset($contents)//item">
2874
+ <fo:bookmark-tree>
2875
+ <xsl:choose>
2876
+ <xsl:when test="xalan:nodeset($contents)/doc">
2877
+ <xsl:choose>
2878
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
2879
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
2880
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
2881
+ <fo:bookmark-title>
2882
+ <xsl:variable name="bookmark-title_">
2883
+ <xsl:choose>
2884
+ <xsl:when test="@lang = 'en'">
2885
+
2886
+
2887
+ </xsl:when>
2888
+ <xsl:when test="@lang = 'fr'">
2889
+
2890
+
2891
+ </xsl:when>
2892
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
2893
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
2894
+ </xsl:choose>
2895
+ </xsl:variable>
2896
+ <xsl:choose>
2897
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
2898
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
2899
+ </xsl:when>
2900
+ <xsl:otherwise>
2901
+ <xsl:choose>
2902
+ <xsl:when test="@lang = 'en'">English</xsl:when>
2903
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
2904
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
2905
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
2906
+ </xsl:choose>
2907
+ </xsl:otherwise>
2908
+ </xsl:choose>
2909
+ </fo:bookmark-title>
2910
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
2911
+ </fo:bookmark>
2912
+
2913
+ </xsl:for-each>
2914
+ </xsl:when>
2915
+ <xsl:otherwise>
2916
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
2917
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
2918
+ </xsl:for-each>
2919
+ </xsl:otherwise>
2920
+ </xsl:choose>
2921
+ </xsl:when>
2922
+ <xsl:otherwise>
2923
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
2924
+ </xsl:otherwise>
2925
+ </xsl:choose>
2926
+
2927
+
2928
+
2929
+
2930
+
2931
+
2932
+
2933
+
2934
+ </fo:bookmark-tree>
2935
+ </xsl:if>
2936
+ </xsl:template><xsl:template match="item" mode="bookmark">
2937
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
2938
+ <fo:bookmark-title>
2939
+ <xsl:if test="@section != ''">
2940
+ <xsl:value-of select="@section"/>
2941
+ <xsl:text> </xsl:text>
2942
+ </xsl:if>
2943
+ <xsl:value-of select="normalize-space(title)"/>
2944
+ </fo:bookmark-title>
2945
+ <xsl:apply-templates mode="bookmark"/>
2946
+ </fo:bookmark>
2947
+ </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">
2948
+ <xsl:if test="normalize-space() != ''">
2949
+ <fo:block xsl:use-attribute-sets="figure-name-style">
2950
+
2951
+ <xsl:apply-templates/>
2952
+ </fo:block>
2953
+ </xsl:if>
2954
+ </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">
2955
+ <xsl:apply-templates mode="contents_item"/>
2956
+ <!-- <xsl:text> </xsl:text> -->
2957
+ </xsl:template><xsl:template name="getSection">
2958
+ <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
2959
+ </xsl:template><xsl:template name="getName">
2960
+ <xsl:choose>
2961
+ <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
2962
+ <xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/>
2963
+ </xsl:when>
2964
+ <xsl:otherwise>
2965
+ <xsl:copy-of select="*[local-name() = 'title']/node()"/>
2966
+ </xsl:otherwise>
2967
+ </xsl:choose>
2968
+ </xsl:template><xsl:template name="insertTitleAsListItem">
2969
+ <xsl:param name="provisional-distance-between-starts" select="'9.5mm'"/>
2970
+ <xsl:variable name="section">
2971
+ <xsl:for-each select="..">
2972
+ <xsl:call-template name="getSection"/>
2973
+ </xsl:for-each>
2974
+ </xsl:variable>
2975
+ <fo:list-block provisional-distance-between-starts="{$provisional-distance-between-starts}">
2976
+ <fo:list-item>
2977
+ <fo:list-item-label end-indent="label-end()">
2978
+ <fo:block>
2979
+ <xsl:value-of select="$section"/>
2980
+ </fo:block>
2981
+ </fo:list-item-label>
2982
+ <fo:list-item-body start-indent="body-start()">
2983
+ <fo:block>
2984
+ <xsl:choose>
2985
+ <xsl:when test="*[local-name() = 'tab']">
2986
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
2987
+ </xsl:when>
2988
+ <xsl:otherwise>
2989
+ <xsl:apply-templates/>
2990
+ </xsl:otherwise>
2991
+ </xsl:choose>
2992
+ </fo:block>
2993
+ </fo:list-item-body>
2994
+ </fo:list-item>
2995
+ </fo:list-block>
2996
+ </xsl:template><xsl:template name="extractTitle">
2997
+ <xsl:choose>
2998
+ <xsl:when test="*[local-name() = 'tab']">
2999
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
3000
+ </xsl:when>
3001
+ <xsl:otherwise>
3002
+ <xsl:apply-templates/>
3003
+ </xsl:otherwise>
3004
+ </xsl:choose>
3005
+ </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">
3006
+ <xsl:text> </xsl:text>
3007
+ </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
3008
+ <xsl:copy>
3009
+ <xsl:apply-templates mode="contents_item"/>
3010
+ </xsl:copy>
3011
+ </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3012
+ <xsl:text> </xsl:text>
3013
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3014
+
3015
+ <fo:block-container margin-left="0mm">
3016
+ <xsl:if test="parent::*[local-name() = 'note']">
3017
+ <xsl:attribute name="margin-left">
3018
+ <xsl:choose>
3019
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3020
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3021
+ </xsl:choose>
3022
+ </xsl:attribute>
3023
+
3024
+ </xsl:if>
3025
+ <fo:block-container margin-left="0mm">
3026
+
3027
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
3028
+ <xsl:variable name="_font-size">
3029
+
3030
+ 10
3031
+
3032
+
3033
+
3034
+
3035
+
3036
+
3037
+
3038
+
3039
+
3040
+
3041
+
3042
+
3043
+ </xsl:variable>
3044
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3045
+ <xsl:if test="$font-size != ''">
3046
+ <xsl:attribute name="font-size">
3047
+ <xsl:choose>
3048
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3049
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3050
+ </xsl:choose>
3051
+ </xsl:attribute>
3052
+ </xsl:if>
3053
+ <xsl:apply-templates/>
3054
+ </fo:block>
3055
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3056
+
3057
+ </fo:block-container>
3058
+ </fo:block-container>
3059
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
3060
+ <xsl:variable name="text">
3061
+ <xsl:call-template name="add-zero-spaces-equal"/>
3062
+ </xsl:variable>
3063
+ <xsl:call-template name="add-zero-spaces-java">
3064
+ <xsl:with-param name="text" select="$text"/>
3065
+ </xsl:call-template>
3066
+ </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
3067
+ <xsl:if test="normalize-space() != ''">
3068
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
3069
+ <xsl:apply-templates/>
3070
+ </fo:block>
3071
+ </xsl:if>
3072
+ </xsl:template><xsl:template match="*[local-name() = 'permission']">
3073
+ <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
3074
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3075
+ <xsl:apply-templates/>
3076
+ </fo:block>
3077
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation">
3078
+ <xsl:if test="normalize-space() != ''">
3079
+ <fo:block xsl:use-attribute-sets="permission-name-style">
3080
+ <xsl:apply-templates/>
3081
+
3082
+ </fo:block>
3083
+ </xsl:if>
3084
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'label']">
3085
+ <fo:block xsl:use-attribute-sets="permission-label-style">
3086
+ <xsl:apply-templates/>
3087
+ </fo:block>
3088
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']">
3089
+ <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
3090
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3091
+ <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/>
3092
+ <xsl:apply-templates select="@obligation" mode="presentation"/>
3093
+ <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/>
3094
+ <xsl:apply-templates/>
3095
+ </fo:block>
3096
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation">
3097
+ <xsl:if test="normalize-space() != ''">
3098
+ <fo:block xsl:use-attribute-sets="requirement-name-style">
3099
+
3100
+ <xsl:apply-templates/>
3101
+
3102
+ </fo:block>
3103
+ </xsl:if>
3104
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation">
3105
+ <fo:block xsl:use-attribute-sets="requirement-label-style">
3106
+ <xsl:apply-templates/>
3107
+ </fo:block>
3108
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation">
3109
+ <fo:block>
3110
+ <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
3111
+ </fo:block>
3112
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
3113
+ <fo:block xsl:use-attribute-sets="requirement-subject-style">
3114
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
3115
+ </fo:block>
3116
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
3117
+ <fo:block xsl:use-attribute-sets="requirement-inherit-style">
3118
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
3119
+ </fo:block>
3120
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
3121
+ <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
3122
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3123
+ <xsl:apply-templates/>
3124
+ </fo:block>
3125
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation">
3126
+ <xsl:if test="normalize-space() != ''">
3127
+ <fo:block xsl:use-attribute-sets="recommendation-name-style">
3128
+ <xsl:apply-templates/>
3129
+
3130
+ </fo:block>
3131
+ </xsl:if>
3132
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'label']">
3133
+ <fo:block xsl:use-attribute-sets="recommendation-label-style">
3134
+ <xsl:apply-templates/>
3135
+ </fo:block>
3136
+ </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3137
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
3138
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3139
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3140
+ </xsl:if>
3141
+ <fo:block-container margin-left="0mm" margin-right="0mm">
3142
+ <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
3143
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3144
+ <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
3145
+ </xsl:if>
3146
+ <xsl:variable name="simple-table">
3147
+ <xsl:call-template name="getSimpleTable"/>
3148
+ </xsl:variable>
3149
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
3150
+ <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
3151
+ <!-- <fo:table-column column-width="35mm"/>
3152
+ <fo:table-column column-width="115mm"/> -->
3153
+ <fo:table-column column-width="30%"/>
3154
+ <fo:table-column column-width="70%"/>
3155
+ </xsl:if>
3156
+ <xsl:apply-templates mode="requirement"/>
3157
+ </fo:table>
3158
+ <!-- fn processing -->
3159
+ <xsl:if test=".//*[local-name() = 'fn']">
3160
+ <xsl:for-each select="*[local-name() = 'tbody']">
3161
+ <fo:block font-size="90%" border-bottom="1pt solid black">
3162
+ <xsl:call-template name="fn_display"/>
3163
+ </fo:block>
3164
+ </xsl:for-each>
3165
+ </xsl:if>
3166
+ </fo:block-container>
3167
+ </fo:block-container>
3168
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="requirement">
3169
+ <fo:table-header>
3170
+ <xsl:apply-templates mode="requirement"/>
3171
+ </fo:table-header>
3172
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="requirement">
3173
+ <fo:table-body>
3174
+ <xsl:apply-templates mode="requirement"/>
3175
+ </fo:table-body>
3176
+ </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
3177
+ <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
3178
+ <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
3179
+ <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
3180
+ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
3181
+ </xsl:if>
3182
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
3183
+ <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
3184
+ </xsl:if>
3185
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
3186
+ <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
3187
+ </xsl:if>
3188
+ <xsl:apply-templates mode="requirement"/>
3189
+ </fo:table-row>
3190
+ </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
3191
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3192
+ <xsl:attribute name="text-align">
3193
+ <xsl:choose>
3194
+ <xsl:when test="@align">
3195
+ <xsl:value-of select="@align"/>
3196
+ </xsl:when>
3197
+ <xsl:otherwise>left</xsl:otherwise>
3198
+ </xsl:choose>
3199
+ </xsl:attribute>
3200
+ <xsl:if test="@colspan">
3201
+ <xsl:attribute name="number-columns-spanned">
3202
+ <xsl:value-of select="@colspan"/>
3203
+ </xsl:attribute>
3204
+ </xsl:if>
3205
+ <xsl:if test="@rowspan">
3206
+ <xsl:attribute name="number-rows-spanned">
3207
+ <xsl:value-of select="@rowspan"/>
3208
+ </xsl:attribute>
3209
+ </xsl:if>
3210
+ <xsl:call-template name="display-align"/>
3211
+
3212
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3213
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3214
+ <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
3215
+ </xsl:if>
3216
+ <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
3217
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3218
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3219
+ </xsl:if> -->
3220
+
3221
+ <fo:block>
3222
+ <xsl:apply-templates/>
3223
+ </fo:block>
3224
+ </fo:table-cell>
3225
+ </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
3226
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3227
+ <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3228
+ <xsl:attribute name="padding">0mm</xsl:attribute>
3229
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
3230
+ </xsl:if>
3231
+ <xsl:attribute name="text-align">
3232
+ <xsl:choose>
3233
+ <xsl:when test="@align">
3234
+ <xsl:value-of select="@align"/>
3235
+ </xsl:when>
3236
+ <xsl:otherwise>left</xsl:otherwise>
3237
+ </xsl:choose>
3238
+ </xsl:attribute>
3239
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
3240
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3241
+ </xsl:if>
3242
+ <xsl:if test="@colspan">
3243
+ <xsl:attribute name="number-columns-spanned">
3244
+ <xsl:value-of select="@colspan"/>
3245
+ </xsl:attribute>
3246
+ </xsl:if>
3247
+ <xsl:if test="@rowspan">
3248
+ <xsl:attribute name="number-rows-spanned">
3249
+ <xsl:value-of select="@rowspan"/>
3250
+ </xsl:attribute>
3251
+ </xsl:if>
3252
+ <xsl:call-template name="display-align"/>
3253
+
3254
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3255
+ <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
3256
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3257
+ <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
3258
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3259
+ </xsl:if>
3260
+ </xsl:if> -->
3261
+ <!-- 2nd line and below -->
3262
+
3263
+ <fo:block>
3264
+ <xsl:apply-templates/>
3265
+ </fo:block>
3266
+ </fo:table-cell>
3267
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
3268
+ <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
3269
+ <xsl:apply-templates/>
3270
+ </fo:block>
3271
+ </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
3272
+ <fo:block> <!-- margin-bottom="10pt" -->
3273
+ <xsl:apply-templates/>
3274
+ </fo:block>
3275
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']">
3276
+ <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
3277
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3278
+ <xsl:apply-templates/>
3279
+ </fo:block>
3280
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation">
3281
+ <xsl:if test="normalize-space() != ''">
3282
+ <fo:inline xsl:use-attribute-sets="termexample-name-style">
3283
+ <xsl:apply-templates/>
3284
+ </fo:inline>
3285
+ </xsl:if>
3286
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
3287
+ <fo:inline><xsl:apply-templates/></fo:inline>
3288
+ </xsl:template><xsl:template match="*[local-name() = 'example']">
3289
+ <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
3290
+
3291
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3292
+
3293
+ <xsl:variable name="element">
3294
+ block
3295
+
3296
+ <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
3297
+ </xsl:variable>
3298
+
3299
+ <xsl:choose>
3300
+ <xsl:when test="contains(normalize-space($element), 'block')">
3301
+ <fo:block xsl:use-attribute-sets="example-body-style">
3302
+ <xsl:apply-templates/>
3303
+ </fo:block>
3304
+ </xsl:when>
3305
+ <xsl:otherwise>
3306
+ <fo:inline>
3307
+ <xsl:apply-templates/>
3308
+ </fo:inline>
3309
+ </xsl:otherwise>
3310
+ </xsl:choose>
3311
+
3312
+ </fo:block>
3313
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
3314
+
3315
+ <xsl:variable name="element">
3316
+ block
3317
+
3318
+ </xsl:variable>
3319
+ <xsl:choose>
3320
+ <xsl:when test="ancestor::*[local-name() = 'appendix']">
3321
+ <fo:inline>
3322
+ <xsl:apply-templates/>
3323
+ </fo:inline>
2758
3324
  </xsl:when>
2759
- <xsl:when test="contains($text, $zero-space-after-underscore)">
2760
- <xsl:value-of select="substring-before($text, $zero-space-after-underscore)"/>
2761
- <xsl:value-of select="$zero-space-after-underscore"/>
2762
- <xsl:value-of select="$zero-space"/>
2763
- <xsl:call-template name="add-zero-spaces">
2764
- <xsl:with-param name="text" select="substring-after($text, $zero-space-after-underscore)"/>
2765
- </xsl:call-template>
3325
+ <xsl:when test="normalize-space($element) = 'block'">
3326
+ <fo:block xsl:use-attribute-sets="example-name-style">
3327
+ <xsl:apply-templates/>
3328
+ </fo:block>
2766
3329
  </xsl:when>
2767
3330
  <xsl:otherwise>
2768
- <xsl:value-of select="$text"/>
3331
+ <fo:inline xsl:use-attribute-sets="example-name-style">
3332
+ <xsl:apply-templates/>
3333
+ </fo:inline>
2769
3334
  </xsl:otherwise>
2770
3335
  </xsl:choose>
2771
- </xsl:template><xsl:template name="add-zero-spaces-equal">
2772
- <xsl:param name="text" select="."/>
2773
- <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
2774
- <xsl:variable name="zero-space-after-equal">=</xsl:variable>
2775
- <xsl:variable name="zero-space">​</xsl:variable>
2776
- <xsl:choose>
2777
- <xsl:when test="contains($text, $zero-space-after-equals)">
2778
- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
2779
- <xsl:value-of select="$zero-space-after-equals"/>
2780
- <xsl:value-of select="$zero-space"/>
2781
- <xsl:call-template name="add-zero-spaces-equal">
2782
- <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equals)"/>
2783
- </xsl:call-template>
2784
- </xsl:when>
2785
- <xsl:when test="contains($text, $zero-space-after-equal)">
2786
- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
2787
- <xsl:value-of select="$zero-space-after-equal"/>
2788
- <xsl:value-of select="$zero-space"/>
2789
- <xsl:call-template name="add-zero-spaces-equal">
2790
- <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
2791
- </xsl:call-template>
3336
+
3337
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3338
+
3339
+ <xsl:variable name="element">
3340
+ block
3341
+
3342
+ </xsl:variable>
3343
+ <xsl:choose>
3344
+ <xsl:when test="normalize-space($element) = 'block'">
3345
+ <fo:block xsl:use-attribute-sets="example-p-style">
3346
+
3347
+ <xsl:apply-templates/>
3348
+ </fo:block>
2792
3349
  </xsl:when>
2793
3350
  <xsl:otherwise>
2794
- <xsl:value-of select="$text"/>
3351
+ <fo:inline xsl:use-attribute-sets="example-p-style">
3352
+ <xsl:apply-templates/>
3353
+ </fo:inline>
2795
3354
  </xsl:otherwise>
2796
- </xsl:choose>
2797
- </xsl:template><xsl:template name="getSimpleTable">
2798
- <xsl:variable name="simple-table">
2799
-
2800
- <!-- Step 1. colspan processing -->
2801
- <xsl:variable name="simple-table-colspan">
2802
- <tbody>
2803
- <xsl:apply-templates mode="simple-table-colspan"/>
2804
- </tbody>
2805
- </xsl:variable>
2806
-
2807
- <!-- Step 2. rowspan processing -->
2808
- <xsl:variable name="simple-table-rowspan">
2809
- <xsl:apply-templates select="xalan:nodeset($simple-table-colspan)" mode="simple-table-rowspan"/>
3355
+ </xsl:choose>
3356
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3357
+ <fo:block xsl:use-attribute-sets="termsource-style">
3358
+ <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3359
+ <xsl:variable name="termsource_text">
3360
+ <xsl:apply-templates/>
2810
3361
  </xsl:variable>
2811
3362
 
2812
- <xsl:copy-of select="xalan:nodeset($simple-table-rowspan)"/>
3363
+ <xsl:choose>
3364
+ <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3365
+ <xsl:apply-templates/>
3366
+ </xsl:when>
3367
+ <xsl:otherwise>
2813
3368
 
2814
- <!-- <xsl:choose>
2815
- <xsl:when test="current()//*[local-name()='th'][@colspan] or current()//*[local-name()='td'][@colspan] ">
3369
+ <xsl:text>[</xsl:text>
3370
+
3371
+ <xsl:apply-templates/>
3372
+
3373
+ <xsl:text>]</xsl:text>
2816
3374
 
2817
- </xsl:when>
2818
- <xsl:otherwise>
2819
- <xsl:copy-of select="current()"/>
2820
3375
  </xsl:otherwise>
2821
- </xsl:choose> -->
2822
- </xsl:variable>
2823
- <xsl:copy-of select="$simple-table"/>
2824
- </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
2825
- <xsl:apply-templates mode="simple-table-colspan"/>
2826
- </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">
2827
- <xsl:choose>
2828
- <xsl:when test="@colspan">
2829
- <xsl:variable name="td">
2830
- <xsl:element name="td">
2831
- <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
2832
- <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
2833
- <xsl:apply-templates mode="simple-table-colspan"/>
2834
- </xsl:element>
2835
- </xsl:variable>
2836
- <xsl:call-template name="repeatNode">
2837
- <xsl:with-param name="count" select="@colspan"/>
2838
- <xsl:with-param name="node" select="$td"/>
2839
- </xsl:call-template>
2840
- </xsl:when>
2841
- <xsl:otherwise>
2842
- <xsl:element name="td">
2843
- <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
2844
- <xsl:apply-templates mode="simple-table-colspan"/>
2845
- </xsl:element>
2846
- </xsl:otherwise>
2847
- </xsl:choose>
2848
- </xsl:template><xsl:template match="@colspan" mode="simple-table-colspan"/><xsl:template match="*[local-name()='tr']" mode="simple-table-colspan">
2849
- <xsl:element name="tr">
2850
- <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
2851
- <xsl:apply-templates mode="simple-table-colspan"/>
2852
- </xsl:element>
2853
- </xsl:template><xsl:template match="@*|node()" mode="simple-table-colspan">
2854
- <xsl:copy>
2855
- <xsl:apply-templates select="@*|node()" mode="simple-table-colspan"/>
2856
- </xsl:copy>
2857
- </xsl:template><xsl:template name="repeatNode">
2858
- <xsl:param name="count"/>
2859
- <xsl:param name="node"/>
3376
+ </xsl:choose>
3377
+ </fo:block>
3378
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
3379
+ <xsl:if test="normalize-space() != ''">
3380
+ <xsl:value-of select="."/>
3381
+ </xsl:if>
3382
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
3383
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3384
+
3385
+ <fo:inline>
3386
+
3387
+ <xsl:call-template name="getTitle">
3388
+ <xsl:with-param name="name" select="'title-source'"/>
3389
+ </xsl:call-template>
3390
+ <xsl:text>: </xsl:text>
3391
+ </fo:inline>
3392
+
3393
+ <fo:inline xsl:use-attribute-sets="origin-style">
3394
+ <xsl:apply-templates/>
3395
+ </fo:inline>
3396
+ </fo:basic-link>
3397
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
3398
+ <fo:inline><xsl:apply-templates/></fo:inline>
3399
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
3400
+ <xsl:if test="normalize-space() != ''">
3401
+ <xsl:value-of select="."/>
3402
+ </xsl:if>
3403
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
3404
+ <fo:block-container margin-left="0mm">
3405
+ <xsl:if test="parent::*[local-name() = 'note']">
3406
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
3407
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
3408
+ </xsl:if>
3409
+ </xsl:if>
3410
+
3411
+ <fo:block-container margin-left="0mm">
2860
3412
 
2861
- <xsl:if test="$count &gt; 0">
2862
- <xsl:call-template name="repeatNode">
2863
- <xsl:with-param name="count" select="$count - 1"/>
2864
- <xsl:with-param name="node" select="$node"/>
2865
- </xsl:call-template>
2866
- <xsl:copy-of select="$node"/>
3413
+ <fo:block xsl:use-attribute-sets="quote-style">
3414
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3415
+ </fo:block>
3416
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3417
+ <fo:block xsl:use-attribute-sets="quote-source-style">
3418
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
3419
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
3420
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
3421
+ </fo:block>
3422
+ </xsl:if>
3423
+
3424
+ </fo:block-container>
3425
+ </fo:block-container>
3426
+ </xsl:template><xsl:template match="*[local-name() = 'source']">
3427
+ <xsl:if test="../*[local-name() = 'author']">
3428
+ <xsl:text>, </xsl:text>
2867
3429
  </xsl:if>
2868
- </xsl:template><xsl:template match="@*|node()" mode="simple-table-rowspan">
2869
- <xsl:copy>
2870
- <xsl:apply-templates select="@*|node()" mode="simple-table-rowspan"/>
2871
- </xsl:copy>
2872
- </xsl:template><xsl:template match="tbody" mode="simple-table-rowspan">
2873
- <xsl:copy>
2874
- <xsl:copy-of select="tr[1]"/>
2875
- <xsl:apply-templates select="tr[2]" mode="simple-table-rowspan">
2876
- <xsl:with-param name="previousRow" select="tr[1]"/>
2877
- </xsl:apply-templates>
2878
- </xsl:copy>
2879
- </xsl:template><xsl:template match="tr" mode="simple-table-rowspan">
2880
- <xsl:param name="previousRow"/>
2881
- <xsl:variable name="currentRow" select="."/>
2882
-
2883
- <xsl:variable name="normalizedTDs">
2884
- <xsl:for-each select="xalan:nodeset($previousRow)//td">
2885
- <xsl:choose>
2886
- <xsl:when test="@rowspan &gt; 1">
2887
- <xsl:copy>
2888
- <xsl:attribute name="rowspan">
2889
- <xsl:value-of select="@rowspan - 1"/>
2890
- </xsl:attribute>
2891
- <xsl:copy-of select="@*[not(name() = 'rowspan')]"/>
2892
- <xsl:copy-of select="node()"/>
2893
- </xsl:copy>
2894
- </xsl:when>
2895
- <xsl:otherwise>
2896
- <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
2897
- </xsl:otherwise>
2898
- </xsl:choose>
2899
- </xsl:for-each>
3430
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3431
+ <xsl:apply-templates/>
3432
+ </fo:basic-link>
3433
+ </xsl:template><xsl:template match="*[local-name() = 'author']">
3434
+ <xsl:text>— </xsl:text>
3435
+ <xsl:apply-templates/>
3436
+ </xsl:template><xsl:template match="*[local-name() = 'eref']">
3437
+ <fo:inline xsl:use-attribute-sets="eref-style">
3438
+ <xsl:if test="@type = 'footnote'">
3439
+
3440
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
3441
+ <xsl:attribute name="font-size">80%</xsl:attribute>
3442
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3443
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
3444
+
3445
+
3446
+ </xsl:if>
3447
+
3448
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3449
+
3450
+ <xsl:if test="@type = 'inline'">
3451
+
3452
+ <xsl:attribute name="color">blue</xsl:attribute>
3453
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
3454
+
3455
+
3456
+
3457
+ </xsl:if>
3458
+
3459
+
3460
+ <xsl:apply-templates/>
3461
+ </fo:basic-link>
3462
+ </fo:inline>
3463
+ </xsl:template><xsl:template match="*[local-name() = 'tab']">
3464
+ <!-- zero-space char -->
3465
+ <xsl:variable name="depth">
3466
+ <xsl:call-template name="getLevel">
3467
+ <xsl:with-param name="depth" select="../@depth"/>
3468
+ </xsl:call-template>
3469
+ </xsl:variable>
3470
+
3471
+ <xsl:variable name="padding">
3472
+
3473
+
3474
+ <xsl:choose>
3475
+ <xsl:when test="$depth &gt;= 3">3</xsl:when>
3476
+ <xsl:when test="$depth = 1">3</xsl:when>
3477
+ <xsl:otherwise>2</xsl:otherwise>
3478
+ </xsl:choose>
3479
+
3480
+
3481
+
3482
+
3483
+
3484
+
3485
+
3486
+
3487
+
3488
+
3489
+
3490
+
3491
+
3492
+
3493
+
3494
+
3495
+
2900
3496
  </xsl:variable>
2901
-
2902
- <xsl:variable name="newRow">
2903
- <xsl:copy>
2904
- <xsl:copy-of select="$currentRow/@*"/>
2905
- <xsl:copy-of select="xalan:nodeset($normalizedTDs)"/>
2906
- </xsl:copy>
3497
+
3498
+ <xsl:variable name="padding-right">
3499
+ <xsl:choose>
3500
+ <xsl:when test="normalize-space($padding) = ''">0</xsl:when>
3501
+ <xsl:otherwise>
3502
+ <xsl:value-of select="normalize-space($padding)"/>
3503
+ </xsl:otherwise>
3504
+ </xsl:choose>
2907
3505
  </xsl:variable>
2908
- <xsl:copy-of select="$newRow"/>
2909
-
2910
- <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
2911
- <xsl:with-param name="previousRow" select="$newRow"/>
2912
- </xsl:apply-templates>
2913
- </xsl:template><xsl:template name="getLang">
3506
+
2914
3507
  <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3508
+
2915
3509
  <xsl:choose>
2916
- <xsl:when test="$language = 'English'">en</xsl:when>
2917
- <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
2918
- </xsl:choose>
2919
- </xsl:template><xsl:template name="capitalizeWords">
2920
- <xsl:param name="str"/>
2921
- <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
2922
- <xsl:choose>
2923
- <xsl:when test="contains($str2, ' ')">
2924
- <xsl:variable name="substr" select="substring-before($str2, ' ')"/>
2925
- <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
2926
- <xsl:value-of select="substring($substr, 2)"/> -->
2927
- <xsl:call-template name="capitalize">
2928
- <xsl:with-param name="str" select="$substr"/>
2929
- </xsl:call-template>
2930
- <xsl:text> </xsl:text>
2931
- <xsl:call-template name="capitalizeWords">
2932
- <xsl:with-param name="str" select="substring-after($str2, ' ')"/>
2933
- </xsl:call-template>
3510
+ <xsl:when test="$language = 'zh'">
3511
+ <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
3512
+ </xsl:when>
3513
+ <xsl:when test="../../@inline-header = 'true'">
3514
+ <fo:inline font-size="90%">
3515
+ <xsl:call-template name="insertNonBreakSpaces">
3516
+ <xsl:with-param name="count" select="$padding-right"/>
3517
+ </xsl:call-template>
3518
+ </fo:inline>
2934
3519
  </xsl:when>
2935
3520
  <xsl:otherwise>
2936
- <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
2937
- <xsl:value-of select="substring($str2, 2)"/> -->
2938
- <xsl:call-template name="capitalize">
2939
- <xsl:with-param name="str" select="$str2"/>
2940
- </xsl:call-template>
3521
+ <fo:inline padding-right="{$padding-right}mm">​</fo:inline>
2941
3522
  </xsl:otherwise>
2942
3523
  </xsl:choose>
2943
- </xsl:template><xsl:template name="capitalize">
2944
- <xsl:param name="str"/>
2945
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2946
- <xsl:value-of select="substring($str, 2)"/>
2947
- </xsl:template><xsl:template match="mathml:math">
2948
- <fo:inline font-family="STIX2Math">
2949
- <fo:instream-foreign-object fox:alt-text="Math">
2950
- <xsl:copy-of select="."/>
2951
- </fo:instream-foreign-object>
2952
- </fo:inline>
2953
- </xsl:template><xsl:template match="*[local-name()='localityStack']">
2954
- <xsl:for-each select="*[local-name()='locality']">
2955
- <xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
2956
- <xsl:apply-templates select="."/>
2957
- <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
2958
- </xsl:for-each>
2959
- </xsl:template><xsl:template match="*[local-name()='link']" name="link">
2960
- <xsl:variable name="target">
2961
- <xsl:choose>
2962
- <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
2963
- <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
2964
- </xsl:when>
2965
- <xsl:otherwise>
2966
- <xsl:value-of select="normalize-space(@target)"/>
2967
- </xsl:otherwise>
2968
- </xsl:choose>
2969
- </xsl:variable>
2970
- <fo:inline xsl:use-attribute-sets="link-style">
2971
- <xsl:choose>
2972
- <xsl:when test="$target = ''">
2973
- <xsl:apply-templates/>
2974
- </xsl:when>
2975
- <xsl:otherwise>
2976
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
2977
- <xsl:choose>
2978
- <xsl:when test="normalize-space(.) = ''">
2979
- <xsl:value-of select="$target"/>
2980
- </xsl:when>
2981
- <xsl:otherwise>
2982
- <xsl:apply-templates/>
2983
- </xsl:otherwise>
2984
- </xsl:choose>
2985
- </fo:basic-link>
2986
- </xsl:otherwise>
2987
- </xsl:choose>
2988
- </fo:inline>
2989
- </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
2990
- <fo:block xsl:use-attribute-sets="sourcecode-style">
2991
- <!-- <xsl:choose>
2992
- <xsl:when test="@lang = 'en'"></xsl:when>
2993
- <xsl:otherwise> -->
2994
- <xsl:attribute name="white-space">pre</xsl:attribute>
2995
- <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2996
- <!-- </xsl:otherwise>
2997
- </xsl:choose> -->
3524
+
3525
+ </xsl:template><xsl:template name="insertNonBreakSpaces">
3526
+ <xsl:param name="count"/>
3527
+ <xsl:if test="$count &gt; 0">
3528
+ <xsl:text> </xsl:text>
3529
+ <xsl:call-template name="insertNonBreakSpaces">
3530
+ <xsl:with-param name="count" select="$count - 1"/>
3531
+ </xsl:call-template>
3532
+ </xsl:if>
3533
+ </xsl:template><xsl:template match="*[local-name() = 'domain']">
3534
+ <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
3535
+ <xsl:text> </xsl:text>
3536
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']">
3537
+ <fo:block xsl:use-attribute-sets="admitted-style">
2998
3538
  <xsl:apply-templates/>
2999
3539
  </fo:block>
3000
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
3001
- <fo:inline id="{@id}"/>
3002
- </xsl:template><xsl:template match="*[local-name()='appendix']">
3003
- <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3004
- <xsl:variable name="title-appendix">
3005
- <xsl:call-template name="getTitle">
3006
- <xsl:with-param name="name" select="'title-appendix'"/>
3007
- </xsl:call-template>
3008
- </xsl:variable>
3009
- <fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline>
3010
- <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
3540
+ </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3541
+ <xsl:variable name="title-deprecated">
3542
+ <xsl:call-template name="getTitle">
3543
+ <xsl:with-param name="name" select="'title-deprecated'"/>
3544
+ </xsl:call-template>
3545
+ </xsl:variable>
3546
+ <fo:block xsl:use-attribute-sets="deprecates-style">
3547
+ <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
3548
+ </fo:block>
3549
+ </xsl:template><xsl:template match="*[local-name() = 'definition']">
3550
+ <fo:block xsl:use-attribute-sets="definition-style">
3551
+ <xsl:apply-templates/>
3011
3552
  </fo:block>
3553
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
3012
3554
  <xsl:apply-templates/>
3013
- </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3014
- <fo:inline><xsl:apply-templates/></fo:inline>
3015
- </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']">
3016
- <fo:block xsl:use-attribute-sets="appendix-example-style">
3017
- <xsl:variable name="claims_id" select="ancestor::*[local-name()='clause'][1]/@id"/>
3018
- <xsl:variable name="title-example">
3019
- <xsl:call-template name="getTitle">
3020
- <xsl:with-param name="name" select="'title-example'"/>
3021
- </xsl:call-template>
3022
- </xsl:variable>
3023
- <xsl:value-of select="$title-example"/>
3024
- <xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) &gt; 1">
3025
- <xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
3555
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
3556
+ <fo:inline> <xsl:apply-templates/></fo:inline>
3557
+ <fo:block> </fo:block>
3558
+ </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
3559
+
3560
+ <fo:block>
3561
+ <xsl:call-template name="setId"/>
3562
+
3563
+
3564
+ <xsl:variable name="pos"><xsl:number count="csd:sections/csd:clause | csd:sections/csd:terms"/></xsl:variable>
3565
+ <xsl:if test="$pos &gt;= 2">
3566
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
3026
3567
  </xsl:if>
3027
- <xsl:if test="*[local-name()='name']">
3028
- <xsl:text>— </xsl:text><xsl:apply-templates select="*[local-name()='name']" mode="process"/>
3029
- </xsl:if>
3568
+
3569
+
3570
+
3571
+
3572
+
3573
+
3574
+
3575
+
3576
+
3577
+ <xsl:apply-templates/>
3578
+ </fo:block>
3579
+
3580
+
3581
+
3582
+ </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
3583
+ <fo:block break-after="page"/>
3584
+ <fo:block>
3585
+ <xsl:call-template name="setId"/>
3586
+ <xsl:apply-templates/>
3587
+ </fo:block>
3588
+ </xsl:template><xsl:template match="*[local-name() = 'clause']">
3589
+ <fo:block>
3590
+ <xsl:call-template name="setId"/>
3591
+ <xsl:apply-templates/>
3592
+ </fo:block>
3593
+ </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3594
+ <fo:block id="{@id}">
3595
+ <xsl:apply-templates/>
3596
+ </fo:block>
3597
+ </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3598
+
3599
+ <fo:block id="{@id}">
3600
+ <xsl:apply-templates/>
3601
+ </fo:block>
3602
+ </xsl:template><xsl:template match="*[local-name() = 'annex']">
3603
+ <fo:block break-after="page"/>
3604
+ <fo:block id="{@id}">
3605
+
3030
3606
  </fo:block>
3031
3607
  <xsl:apply-templates/>
3032
- </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']"/><xsl:template match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']" mode="process">
3033
- <fo:inline><xsl:apply-templates/></fo:inline>
3034
- </xsl:template><xsl:template match="*[local-name() = 'callout']">
3035
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
3036
- </xsl:template><xsl:template match="*[local-name() = 'annotation']">
3037
- <xsl:variable name="annotation-id" select="@id"/>
3038
- <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
3039
- <fo:block id="{$annotation-id}" white-space="nowrap">
3040
- <fo:inline>
3041
- <xsl:apply-templates>
3042
- <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
3043
- </xsl:apply-templates>
3044
- </fo:inline>
3045
- </fo:block>
3046
- </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
3047
- <xsl:param name="callout"/>
3048
- <fo:inline id="{@id}">
3049
- <!-- for first p in annotation, put <x> -->
3050
- <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
3608
+ </xsl:template><xsl:template match="*[local-name() = 'review']">
3609
+ <!-- comment 2019-11-29 -->
3610
+ <!-- <fo:block font-weight="bold">Review:</fo:block>
3611
+ <xsl:apply-templates /> -->
3612
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3613
+ <!-- 0xA0 to space replacement -->
3614
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3615
+ </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3616
+ <xsl:choose>
3617
+ <xsl:when test="parent::*[local-name() = 'note']">
3618
+ <fo:block-container>
3619
+ <xsl:attribute name="margin-left">
3620
+ <xsl:choose>
3621
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3622
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3623
+ </xsl:choose>
3624
+ </xsl:attribute>
3625
+
3626
+ <fo:block-container margin-left="0mm">
3627
+ <fo:block>
3628
+ <xsl:apply-templates select="." mode="ul_ol"/>
3629
+ </fo:block>
3630
+ </fo:block-container>
3631
+ </fo:block-container>
3632
+ </xsl:when>
3633
+ <xsl:otherwise>
3634
+ <fo:block>
3635
+ <xsl:apply-templates select="." mode="ul_ol"/>
3636
+ </fo:block>
3637
+ </xsl:otherwise>
3638
+ </xsl:choose>
3639
+ </xsl:template><xsl:template match="*[local-name() = 'errata']">
3640
+ <!-- <row>
3641
+ <date>05-07-2013</date>
3642
+ <type>Editorial</type>
3643
+ <change>Changed CA-9 Priority Code from P1 to P2 in <xref target="tabled2"/>.</change>
3644
+ <pages>D-3</pages>
3645
+ </row>
3646
+ -->
3647
+ <fo:table table-layout="fixed" width="100%" font-size="10pt" border="1pt solid black">
3648
+ <fo:table-column column-width="20mm"/>
3649
+ <fo:table-column column-width="23mm"/>
3650
+ <fo:table-column column-width="107mm"/>
3651
+ <fo:table-column column-width="15mm"/>
3652
+ <fo:table-body>
3653
+ <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
3654
+ <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
3655
+ <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
3656
+ <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
3657
+ <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
3658
+ </fo:table-row>
3659
+ <xsl:apply-templates/>
3660
+ </fo:table-body>
3661
+ </fo:table>
3662
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']">
3663
+ <fo:table-row>
3051
3664
  <xsl:apply-templates/>
3052
- </fo:inline>
3053
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
3054
- <xsl:variable name="title-modified">
3055
- <xsl:call-template name="getTitle">
3056
- <xsl:with-param name="name" select="'title-modified'"/>
3057
- </xsl:call-template>
3058
- </xsl:variable>
3665
+ </fo:table-row>
3666
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
3667
+ <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3668
+ <fo:block><xsl:apply-templates/></fo:block>
3669
+ </fo:table-cell>
3670
+ </xsl:template><xsl:template name="processBibitem">
3671
+
3672
+
3673
+
3674
+
3675
+ </xsl:template><xsl:template name="processBibitemDocId">
3676
+ <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')]"/>
3059
3677
  <xsl:choose>
3060
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3061
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> </xsl:text></xsl:otherwise>
3678
+ <xsl:when test="normalize-space($_doc_ident) != ''">
3679
+ <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"/>
3680
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
3681
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3682
+ </xsl:if>
3683
+ <xsl:value-of select="$_doc_ident"/>
3684
+ </xsl:when>
3685
+ <xsl:otherwise>
3686
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
3687
+ <xsl:if test="$type != ''">
3688
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3689
+ </xsl:if>
3690
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
3691
+ </xsl:otherwise>
3062
3692
  </xsl:choose>
3063
- <xsl:apply-templates/>
3693
+ </xsl:template><xsl:template name="processPersonalAuthor">
3694
+ <xsl:choose>
3695
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
3696
+ <author>
3697
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
3698
+ </author>
3699
+ </xsl:when>
3700
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
3701
+ <author>
3702
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3703
+ <xsl:text> </xsl:text>
3704
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
3705
+ </author>
3706
+ </xsl:when>
3707
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
3708
+ <author>
3709
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3710
+ <xsl:text> </xsl:text>
3711
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
3712
+ </author>
3713
+ </xsl:when>
3714
+ <xsl:otherwise>
3715
+ <xsl:apply-templates/>
3716
+ </xsl:otherwise>
3717
+ </xsl:choose>
3718
+ </xsl:template><xsl:template name="renderDate">
3719
+ <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
3720
+ <xsl:value-of select="*[local-name() = 'on']"/>
3721
+ </xsl:if>
3722
+ <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
3723
+ <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
3724
+ </xsl:if>
3725
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
3726
+ <xsl:value-of select="translate(.,'. ','')"/>
3727
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
3728
+ <xsl:value-of select="substring(.,1,1)"/>
3064
3729
  </xsl:template><xsl:template name="convertDate">
3065
3730
  <xsl:param name="date"/>
3066
3731
  <xsl:param name="format" select="'short'"/>
@@ -3191,27 +3856,49 @@
3191
3856
  </xsl:otherwise>
3192
3857
  </xsl:choose>
3193
3858
  </xsl:template><xsl:template name="getLevel">
3194
- <xsl:variable name="level_total" select="count(ancestor::*)"/>
3195
- <xsl:variable name="level">
3196
- <xsl:choose>
3197
- <xsl:when test="ancestor::*[local-name() = 'preface']">
3198
- <xsl:value-of select="$level_total - 2"/>
3199
- </xsl:when>
3200
- <xsl:when test="ancestor::*[local-name() = 'sections']">
3201
- <xsl:value-of select="$level_total - 2"/>
3202
- </xsl:when>
3203
- <xsl:when test="ancestor::*[local-name() = 'bibliography']">
3204
- <xsl:value-of select="$level_total - 2"/>
3205
- </xsl:when>
3206
- <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
3207
- <xsl:otherwise>
3208
- <xsl:value-of select="$level_total - 1"/>
3209
- </xsl:otherwise>
3210
- </xsl:choose>
3211
- </xsl:variable>
3212
- <xsl:value-of select="$level"/>
3213
- </xsl:template><xsl:template name="getSubSection">
3214
- <xsl:number format=".1" level="multiple" count="*[local-name() = 'clause']/*[local-name() = 'clause'] | *[local-name() = 'clause']/*[local-name() = 'terms'] | *[local-name() = 'terms']/*[local-name() = 'term'] | *[local-name() = 'clause']/*[local-name() = 'term'] | *[local-name() = 'terms']/*[local-name() = 'clause'] | *[local-name() = 'terms']/*[local-name() = 'definitions'] | *[local-name() = 'definitions']/*[local-name() = 'clause'] | *[local-name() = 'clause']/*[local-name() = 'definitions'] | *[local-name() = 'definitions']/*[local-name() = 'definitions'] | *[local-name() = 'clause']/*[local-name() = 'references']"/>
3859
+ <xsl:param name="depth"/>
3860
+ <xsl:choose>
3861
+ <xsl:when test="normalize-space(@depth) != ''">
3862
+ <xsl:value-of select="@depth"/>
3863
+ </xsl:when>
3864
+ <xsl:when test="normalize-space($depth) != ''">
3865
+ <xsl:value-of select="$depth"/>
3866
+ </xsl:when>
3867
+ <xsl:otherwise>
3868
+ <xsl:variable name="level_total" select="count(ancestor::*)"/>
3869
+ <xsl:variable name="level">
3870
+ <xsl:choose>
3871
+ <xsl:when test="parent::*[local-name() = 'preface']">
3872
+ <xsl:value-of select="$level_total - 1"/>
3873
+ </xsl:when>
3874
+ <xsl:when test="ancestor::*[local-name() = 'preface']">
3875
+ <xsl:value-of select="$level_total - 2"/>
3876
+ </xsl:when>
3877
+ <!-- <xsl:when test="parent::*[local-name() = 'sections']">
3878
+ <xsl:value-of select="$level_total - 1"/>
3879
+ </xsl:when> -->
3880
+ <xsl:when test="ancestor::*[local-name() = 'sections']">
3881
+ <xsl:value-of select="$level_total - 1"/>
3882
+ </xsl:when>
3883
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">
3884
+ <xsl:value-of select="$level_total - 1"/>
3885
+ </xsl:when>
3886
+ <xsl:when test="parent::*[local-name() = 'annex']">
3887
+ <xsl:value-of select="$level_total - 1"/>
3888
+ </xsl:when>
3889
+ <xsl:when test="ancestor::*[local-name() = 'annex']">
3890
+ <xsl:value-of select="$level_total"/>
3891
+ </xsl:when>
3892
+ <xsl:when test="local-name() = 'annex'">1</xsl:when>
3893
+ <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
3894
+ <xsl:otherwise>
3895
+ <xsl:value-of select="$level_total - 1"/>
3896
+ </xsl:otherwise>
3897
+ </xsl:choose>
3898
+ </xsl:variable>
3899
+ <xsl:value-of select="$level"/>
3900
+ </xsl:otherwise>
3901
+ </xsl:choose>
3215
3902
  </xsl:template><xsl:template name="split">
3216
3903
  <xsl:param name="pText" select="."/>
3217
3904
  <xsl:param name="sep" select="','"/>
@@ -3242,7 +3929,9 @@
3242
3929
 
3243
3930
 
3244
3931
 
3245
-
3932
+
3933
+
3934
+
3246
3935
  </xsl:variable>
3247
3936
  <xsl:if test="$documentNS != $XSLNS">
3248
3937
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3257,4 +3946,32 @@
3257
3946
  <xsl:when test="$language = 'cn'">Chinese</xsl:when>
3258
3947
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
3259
3948
  </xsl:choose>
3949
+ </xsl:template><xsl:template name="setId">
3950
+ <xsl:attribute name="id">
3951
+ <xsl:choose>
3952
+ <xsl:when test="@id">
3953
+ <xsl:value-of select="@id"/>
3954
+ </xsl:when>
3955
+ <xsl:otherwise>
3956
+ <xsl:value-of select="generate-id()"/>
3957
+ </xsl:otherwise>
3958
+ </xsl:choose>
3959
+ </xsl:attribute>
3960
+ </xsl:template><xsl:template name="add-letter-spacing">
3961
+ <xsl:param name="text"/>
3962
+ <xsl:param name="letter-spacing" select="'0.15'"/>
3963
+ <xsl:if test="string-length($text) &gt; 0">
3964
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
3965
+ <fo:inline padding-right="{$letter-spacing}mm">
3966
+ <xsl:if test="$char = '®'">
3967
+ <xsl:attribute name="font-size">58%</xsl:attribute>
3968
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
3969
+ </xsl:if>
3970
+ <xsl:value-of select="$char"/>
3971
+ </fo:inline>
3972
+ <xsl:call-template name="add-letter-spacing">
3973
+ <xsl:with-param name="text" select="substring($text, 2)"/>
3974
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
3975
+ </xsl:call-template>
3976
+ </xsl:if>
3260
3977
  </xsl:template></xsl:stylesheet>