metanorma-cc 1.5.1 → 1.5.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b777189df0dcda0fc49be5e385efb30eba5cc182f5cd0461adf8bd5d05c2ed78
4
- data.tar.gz: 698ee6cae298e5f62b5685f91f3e98065d1eddf60ef2c7c5ca0a839677219774
3
+ metadata.gz: d512119733aec0e381d969a3bb23f3908caaa3953cc1ed7524a9d3e727e639c0
4
+ data.tar.gz: f26c2d06edb3a888bc8bc2b1214e897eca07e0d3fa6acdc9ae94b745f44fc328
5
5
  SHA512:
6
- metadata.gz: d7f991613a144f45a42794374726472da11a6471b221cb99fa23f11cd07098620b33473c3f464bfce4950fcf52c90cb4034f15c7fd91c12d095bb7b00ab79869
7
- data.tar.gz: 5d842773cad0f757cd80074a8a8cbf4620d634066ced880298f2d1e73198c96fc7b3f0d86b8eafb0eebd5f787d1b14d6a39d802d3482b23ffe8a5379bfd0d04f
6
+ metadata.gz: d5187f1fbe65adb3644ae800c8b47be62e7be2c24d8c43266ff50cc01bbb060889cea81c1bd3173d510606ca924fa9054222762d66582974b3226af256dd2078
7
+ data.tar.gz: 03c5867a2464256d539ef13936be713653bc512a1cdb447af78de3dc0378508e31d7ab8d52cf34acc71af9f70f6aef9614ddfe55775902bed9b923886e01c8b4
@@ -0,0 +1,44 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: rake
4
+
5
+ on:
6
+ push:
7
+ branches: [ master ]
8
+ pull_request:
9
+
10
+ jobs:
11
+ rake:
12
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
13
+ runs-on: ${{ matrix.os }}
14
+ continue-on-error: ${{ matrix.experimental }}
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ ruby: [ '2.6', '2.5', '2.4' ]
19
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
20
+ experimental: [ false ]
21
+ include:
22
+ - ruby: '2.7'
23
+ os: 'ubuntu-latest'
24
+ experimental: true
25
+ - ruby: '2.7'
26
+ os: 'windows-latest'
27
+ experimental: true
28
+ - ruby: '2.7'
29
+ os: 'macos-latest'
30
+ experimental: true
31
+ steps:
32
+ - uses: actions/checkout@master
33
+
34
+ - name: Use Ruby
35
+ uses: ruby/setup-ruby@v1
36
+ with:
37
+ ruby-version: ${{ matrix.ruby }}
38
+ bundler-cache: true
39
+
40
+ - name: Update gems
41
+ run: bundle install --jobs 4 --retry 3
42
+
43
+ - name: Run specs
44
+ run: bundle exec rake
@@ -402,6 +402,16 @@
402
402
  </choice>
403
403
  </attribute>
404
404
  </optional>
405
+ <optional>
406
+ <attribute name="valign">
407
+ <choice>
408
+ <value>top</value>
409
+ <value>middle</value>
410
+ <value>bottom</value>
411
+ <value>baseline</value>
412
+ </choice>
413
+ </attribute>
414
+ </optional>
405
415
  <choice>
406
416
  <zeroOrMore>
407
417
  <ref name="TextElement"/>
@@ -429,6 +439,16 @@
429
439
  </choice>
430
440
  </attribute>
431
441
  </optional>
442
+ <optional>
443
+ <attribute name="valign">
444
+ <choice>
445
+ <value>top</value>
446
+ <value>middle</value>
447
+ <value>bottom</value>
448
+ <value>baseline</value>
449
+ </choice>
450
+ </attribute>
451
+ </optional>
432
452
  <choice>
433
453
  <zeroOrMore>
434
454
  <ref name="TextElement"/>
@@ -998,6 +1018,9 @@
998
1018
  <value>alphabet_upper</value>
999
1019
  </choice>
1000
1020
  </attribute>
1021
+ <optional>
1022
+ <attribute name="start"/>
1023
+ </optional>
1001
1024
  <oneOrMore>
1002
1025
  <ref name="li"/>
1003
1026
  </oneOrMore>
@@ -96,6 +96,13 @@
96
96
  </include>
97
97
  <define name="csd-standard">
98
98
  <element name="csd-standard">
99
+ <attribute name="version"/>
100
+ <attribute name="type">
101
+ <choice>
102
+ <value>semantic</value>
103
+ <value>presentation</value>
104
+ </choice>
105
+ </attribute>
99
106
  <ref name="bibdata"/>
100
107
  <zeroOrMore>
101
108
  <ref name="termdocsource"/>
@@ -57,6 +57,7 @@ module Asciidoctor
57
57
  end
58
58
 
59
59
  def pdf_converter(node)
60
+ return if node.attr("no-pdf")
60
61
  IsoDoc::CC::PdfConvert.new(html_extract_attributes(node))
61
62
  end
62
63
 
@@ -33,7 +33,7 @@ module Asciidoctor
33
33
 
34
34
  def prefix_id(node)
35
35
  prefix = "CC"
36
- typesuffix = ::Metanorma::CC::DOCSUFFIX[node.attr("doctype")] || ""
36
+ typesuffix = ::Metanorma::CC::DOCSUFFIX[doctype(node)] || ""
37
37
  prefix += "/#{typesuffix}" unless typesuffix.empty?
38
38
  status = ::Metanorma::CC::DOCSTATUS[node.attr("status")] || ""
39
39
  prefix += "/#{status}" unless status.empty?
@@ -50,11 +50,14 @@ module Asciidoctor
50
50
  xml.docnumber node.attr("docnumber")
51
51
  end
52
52
 
53
+ @log_doctype = false
54
+
53
55
  def doctype(node)
54
- d = node.attr("doctype")
55
- unless ::Metanorma::CC::DOCSUFFIX.keys.include?(d)
56
+ d = super
57
+ unless ::Metanorma::CC::DOCSUFFIX.keys.include?(d) && !@log_doctype
56
58
  @log.add("Document Attributes", nil,
57
59
  "#{d} is not a legal document type: reverting to 'standard'")
60
+ @log_doctype = true
58
61
  d = "standard"
59
62
  end
60
63
  d
@@ -43,7 +43,9 @@
43
43
  <define name="xref">
44
44
  <element name="xref">
45
45
  <attribute name="target">
46
- <data type="IDREF"/>
46
+ <data type="string">
47
+ <param name="pattern">\i\c*|\c+#\c+</param>
48
+ </data>
47
49
  </attribute>
48
50
  <optional>
49
51
  <attribute name="type">
@@ -61,6 +63,11 @@
61
63
  </choice>
62
64
  </attribute>
63
65
  </optional>
66
+ <optional>
67
+ <attribute name="droploc">
68
+ <data type="boolean"/>
69
+ </attribute>
70
+ </optional>
64
71
  <text/>
65
72
  </element>
66
73
  </define>
@@ -578,6 +585,8 @@
578
585
  <ref name="ol"/>
579
586
  <ref name="dl"/>
580
587
  <ref name="formula"/>
588
+ <ref name="quote"/>
589
+ <ref name="sourcecode"/>
581
590
  </choice>
582
591
  </oneOrMore>
583
592
  </element>
@@ -661,6 +670,16 @@
661
670
  </choice>
662
671
  </attribute>
663
672
  </optional>
673
+ <optional>
674
+ <attribute name="valign">
675
+ <choice>
676
+ <value>top</value>
677
+ <value>middle</value>
678
+ <value>bottom</value>
679
+ <value>baseline</value>
680
+ </choice>
681
+ </attribute>
682
+ </optional>
664
683
  <choice>
665
684
  <zeroOrMore>
666
685
  <choice>
@@ -697,6 +716,16 @@
697
716
  </choice>
698
717
  </attribute>
699
718
  </optional>
719
+ <optional>
720
+ <attribute name="valign">
721
+ <choice>
722
+ <value>top</value>
723
+ <value>middle</value>
724
+ <value>bottom</value>
725
+ <value>baseline</value>
726
+ </choice>
727
+ </attribute>
728
+ </optional>
700
729
  <choice>
701
730
  <zeroOrMore>
702
731
  <choice>
@@ -834,6 +863,13 @@
834
863
  </define>
835
864
  <define name="standard-document">
836
865
  <element name="standard-document">
866
+ <attribute name="version"/>
867
+ <attribute name="type">
868
+ <choice>
869
+ <value>semantic</value>
870
+ <value>presentation</value>
871
+ </choice>
872
+ </attribute>
837
873
  <ref name="bibdata"/>
838
874
  <optional>
839
875
  <ref name="boilerplate"/>
@@ -855,7 +891,7 @@
855
891
  <oneOrMore>
856
892
  <choice>
857
893
  <ref name="content"/>
858
- <ref name="preface_abstract"/>
894
+ <ref name="abstract"/>
859
895
  <ref name="foreword"/>
860
896
  <ref name="introduction"/>
861
897
  <ref name="acknowledgements"/>
@@ -1049,14 +1085,17 @@
1049
1085
  <ref name="section-title"/>
1050
1086
  </optional>
1051
1087
  <group>
1052
- <group>
1053
- <zeroOrMore>
1054
- <ref name="BasicBlock"/>
1055
- </zeroOrMore>
1056
- <zeroOrMore>
1057
- <ref name="note"/>
1058
- </zeroOrMore>
1059
- </group>
1088
+ <choice>
1089
+ <group>
1090
+ <zeroOrMore>
1091
+ <ref name="BasicBlock"/>
1092
+ </zeroOrMore>
1093
+ <zeroOrMore>
1094
+ <ref name="note"/>
1095
+ </zeroOrMore>
1096
+ </group>
1097
+ <ref name="amend"/>
1098
+ </choice>
1060
1099
  <zeroOrMore>
1061
1100
  <choice>
1062
1101
  <ref name="clause-subsection"/>
@@ -1125,49 +1164,7 @@
1125
1164
  </define>
1126
1165
  <define name="annex">
1127
1166
  <element name="annex">
1128
- <optional>
1129
- <attribute name="id">
1130
- <data type="ID"/>
1131
- </attribute>
1132
- </optional>
1133
- <optional>
1134
- <attribute name="language"/>
1135
- </optional>
1136
- <optional>
1137
- <attribute name="script"/>
1138
- </optional>
1139
- <optional>
1140
- <attribute name="inline-header">
1141
- <data type="boolean"/>
1142
- </attribute>
1143
- </optional>
1144
- <attribute name="obligation">
1145
- <choice>
1146
- <value>normative</value>
1147
- <value>informative</value>
1148
- </choice>
1149
- </attribute>
1150
- <optional>
1151
- <ref name="section-title"/>
1152
- </optional>
1153
- <group>
1154
- <group>
1155
- <zeroOrMore>
1156
- <ref name="BasicBlock"/>
1157
- </zeroOrMore>
1158
- <zeroOrMore>
1159
- <ref name="note"/>
1160
- </zeroOrMore>
1161
- </group>
1162
- <zeroOrMore>
1163
- <choice>
1164
- <ref name="annex-subsection"/>
1165
- <ref name="terms"/>
1166
- <ref name="definitions"/>
1167
- <ref name="references"/>
1168
- </choice>
1169
- </zeroOrMore>
1170
- </group>
1167
+ <ref name="Annex-Section"/>
1171
1168
  </element>
1172
1169
  </define>
1173
1170
  <define name="terms">
@@ -1453,11 +1450,6 @@
1453
1450
  </optional>
1454
1451
  </element>
1455
1452
  </define>
1456
- <define name="preface_abstract">
1457
- <element name="abstract">
1458
- <ref name="Basic-Section"/>
1459
- </element>
1460
- </define>
1461
1453
  <define name="term-clause">
1462
1454
  <element name="clause">
1463
1455
  <optional>
@@ -1507,4 +1499,79 @@
1507
1499
  <ref name="CitationType"/>
1508
1500
  </element>
1509
1501
  </define>
1502
+ <define name="amend">
1503
+ <element name="amend">
1504
+ <optional>
1505
+ <attribute name="id">
1506
+ <data type="ID"/>
1507
+ </attribute>
1508
+ </optional>
1509
+ <attribute name="change">
1510
+ <choice>
1511
+ <value>add</value>
1512
+ <value>modify</value>
1513
+ <value>delete</value>
1514
+ </choice>
1515
+ </attribute>
1516
+ <optional>
1517
+ <attribute name="path"/>
1518
+ </optional>
1519
+ <optional>
1520
+ <attribute name="path_end"/>
1521
+ </optional>
1522
+ <optional>
1523
+ <attribute name="title"/>
1524
+ </optional>
1525
+ <optional>
1526
+ <element name="location">
1527
+ <zeroOrMore>
1528
+ <ref name="locality"/>
1529
+ </zeroOrMore>
1530
+ </element>
1531
+ </optional>
1532
+ <zeroOrMore>
1533
+ <ref name="autonumber"/>
1534
+ </zeroOrMore>
1535
+ <optional>
1536
+ <element name="description">
1537
+ <zeroOrMore>
1538
+ <ref name="BasicBlock"/>
1539
+ </zeroOrMore>
1540
+ </element>
1541
+ </optional>
1542
+ <optional>
1543
+ <element name="newcontent">
1544
+ <zeroOrMore>
1545
+ <ref name="BasicBlock"/>
1546
+ </zeroOrMore>
1547
+ </element>
1548
+ </optional>
1549
+ <optional>
1550
+ <element name="description">
1551
+ <zeroOrMore>
1552
+ <ref name="BasicBlock"/>
1553
+ </zeroOrMore>
1554
+ </element>
1555
+ </optional>
1556
+ </element>
1557
+ </define>
1558
+ <define name="autonumber">
1559
+ <element name="autonumber">
1560
+ <attribute name="type">
1561
+ <choice>
1562
+ <value>requirement</value>
1563
+ <value>recommendation</value>
1564
+ <value>permission</value>
1565
+ <value>table</value>
1566
+ <value>figure</value>
1567
+ <value>admonition</value>
1568
+ <value>formula</value>
1569
+ <value>sourcecode</value>
1570
+ <value>example</value>
1571
+ <value>note</value>
1572
+ </choice>
1573
+ </attribute>
1574
+ <text/>
1575
+ </element>
1576
+ </define>
1510
1577
  </grammar>
@@ -37,7 +37,7 @@
37
37
 
38
38
  <xsl:template match="/">
39
39
  <xsl:call-template name="namespaceCheck"/>
40
- <fo:root font-family="SourceSansPro, STIX2Math, HanSans" font-size="10.5pt" xml:lang="{$lang}">
40
+ <fo:root font-family="SourceSansPro, STIX Two Math, HanSans" font-size="10.5pt" xml:lang="{$lang}">
41
41
  <fo:layout-master-set>
42
42
  <!-- Cover page -->
43
43
  <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
@@ -108,7 +108,10 @@
108
108
  </fo:layout-master-set>
109
109
 
110
110
  <xsl:call-template name="addPDFUAmeta"/>
111
-
111
+
112
+ <xsl:call-template name="addBookmarks">
113
+ <xsl:with-param name="contents" select="$contents"/>
114
+ </xsl:call-template>
112
115
 
113
116
  <!-- Cover Page -->
114
117
  <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
@@ -225,7 +228,7 @@
225
228
  </xsl:variable>
226
229
  <fo:block font-size="14pt" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
227
230
 
228
- <xsl:for-each select="xalan:nodeset($contents)//item"><!-- [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 -->
229
232
 
230
233
  <fo:block>
231
234
  <xsl:if test="@level = 1">
@@ -249,8 +252,8 @@
249
252
  </fo:list-item-label>
250
253
  <fo:list-item-body start-indent="body-start()">
251
254
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
252
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
253
- <xsl:apply-templates/>
255
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
256
+ <xsl:apply-templates select="title"/>
254
257
  <fo:inline keep-together.within-line="always">
255
258
  <fo:leader leader-pattern="dots"/>
256
259
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
@@ -315,14 +318,20 @@
315
318
 
316
319
  <xsl:variable name="display">
317
320
  <xsl:choose>
318
- <xsl:when test="ancestor-or-self::csd:bibitem">false</xsl:when>
319
- <xsl:when test="ancestor-or-self::csd:term">false</xsl:when>
320
321
  <xsl:when test="$level &gt; 2">false</xsl:when>
321
322
  <xsl:otherwise>true</xsl:otherwise>
322
323
  </xsl:choose>
323
324
  </xsl:variable>
324
325
 
325
- <xsl:if test="$display = 'true'">
326
+ <xsl:variable name="skip">
327
+ <xsl:choose>
328
+ <xsl:when test="ancestor-or-self::csd:bibitem">true</xsl:when>
329
+ <xsl:when test="ancestor-or-self::csd:term">true</xsl:when>
330
+ <xsl:otherwise>false</xsl:otherwise>
331
+ </xsl:choose>
332
+ </xsl:variable>
333
+
334
+ <xsl:if test="$skip = 'false'">
326
335
 
327
336
  <xsl:variable name="section">
328
337
  <xsl:call-template name="getSection"/>
@@ -332,10 +341,12 @@
332
341
  <xsl:call-template name="getName"/>
333
342
  </xsl:variable>
334
343
 
335
- <item id="{@id}" level="{$level}" section="{$section}">
336
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
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"/>
337
349
  </item>
338
- <xsl:apply-templates mode="contents"/>
339
350
  </xsl:if>
340
351
 
341
352
  </xsl:template>
@@ -567,7 +578,7 @@
567
578
 
568
579
 
569
580
 
570
- <xsl:template match="csd:ul | csd:ol">
581
+ <xsl:template match="csd:ul | csd:ol" mode="ul_ol">
571
582
  <fo:list-block provisional-distance-between-starts="6.5mm" margin-bottom="12pt">
572
583
  <xsl:if test="ancestor::csd:ol">
573
584
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
@@ -803,6 +814,12 @@
803
814
 
804
815
  </title-edition>
805
816
 
817
+ <title-edition lang="fr">
818
+
819
+ <xsl:text>Édition </xsl:text>
820
+
821
+ </title-edition>
822
+
806
823
 
807
824
  <title-toc lang="en">
808
825
 
@@ -811,7 +828,12 @@
811
828
 
812
829
 
813
830
  </title-toc>
814
- <title-toc lang="fr">Sommaire</title-toc>
831
+ <title-toc lang="fr">
832
+
833
+ <xsl:text>Sommaire</xsl:text>
834
+
835
+
836
+ </title-toc>
815
837
 
816
838
  <title-toc lang="zh">Contents</title-toc>
817
839
 
@@ -845,7 +867,12 @@
845
867
 
846
868
 
847
869
 
848
- <title-source lang="en">SOURCE</title-source>
870
+ <title-source lang="en">
871
+
872
+ <xsl:text>SOURCE</xsl:text>
873
+
874
+
875
+ </title-source>
849
876
 
850
877
  <title-keywords lang="en">Keywords</title-keywords>
851
878
 
@@ -888,12 +915,25 @@
888
915
  <title-warning lang="zh">警告</title-warning>
889
916
 
890
917
  <title-amendment lang="en">AMENDMENT</title-amendment>
918
+
919
+ <title-continued lang="en">(continued)</title-continued>
920
+ <title-continued lang="fr">(continué)</title-continued>
921
+
891
922
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
892
923
  <xsl:param name="name"/>
893
- <xsl:variable name="lang">
894
- <xsl:call-template name="getLang"/>
924
+ <xsl:param name="lang"/>
925
+ <xsl:variable name="lang_">
926
+ <xsl:choose>
927
+ <xsl:when test="$lang != ''">
928
+ <xsl:value-of select="$lang"/>
929
+ </xsl:when>
930
+ <xsl:otherwise>
931
+ <xsl:call-template name="getLang"/>
932
+ </xsl:otherwise>
933
+ </xsl:choose>
895
934
  </xsl:variable>
896
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
935
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
936
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
897
937
  <xsl:choose>
898
938
  <xsl:when test="normalize-space($title_) != ''">
899
939
  <xsl:value-of select="$title_"/>
@@ -902,20 +942,22 @@
902
942
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
903
943
  </xsl:otherwise>
904
944
  </xsl:choose>
905
- </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">
945
+ </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">
946
+
947
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
906
948
 
907
949
  <xsl:attribute name="color">blue</xsl:attribute>
908
950
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
909
951
 
910
952
 
953
+
911
954
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
912
955
  <xsl:attribute name="white-space">pre</xsl:attribute>
913
956
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
914
957
 
915
958
 
916
959
 
917
- <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
918
- <xsl:attribute name="font-size">10pt</xsl:attribute>
960
+ <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
919
961
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
920
962
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
921
963
 
@@ -924,6 +966,7 @@
924
966
 
925
967
 
926
968
 
969
+
927
970
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
928
971
 
929
972
  </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
@@ -970,6 +1013,7 @@
970
1013
 
971
1014
 
972
1015
 
1016
+
973
1017
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
974
1018
 
975
1019
 
@@ -994,6 +1038,7 @@
994
1038
 
995
1039
 
996
1040
 
1041
+
997
1042
 
998
1043
 
999
1044
 
@@ -1038,6 +1083,7 @@
1038
1083
 
1039
1084
 
1040
1085
 
1086
+
1041
1087
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1042
1088
 
1043
1089
  <xsl:attribute name="font-size">12pt</xsl:attribute>
@@ -1057,7 +1103,8 @@
1057
1103
 
1058
1104
  </xsl:attribute-set><xsl:attribute-set name="xref-style">
1059
1105
 
1060
-
1106
+
1107
+
1061
1108
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1062
1109
 
1063
1110
 
@@ -1065,6 +1112,7 @@
1065
1112
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1066
1113
 
1067
1114
 
1115
+
1068
1116
  </xsl:attribute-set><xsl:attribute-set name="note-style">
1069
1117
 
1070
1118
 
@@ -1083,8 +1131,7 @@
1083
1131
 
1084
1132
 
1085
1133
 
1086
-
1087
- </xsl:attribute-set><xsl:attribute-set name="note-name-style">
1134
+ </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">
1088
1135
 
1089
1136
 
1090
1137
  <xsl:attribute name="padding-right">6mm</xsl:attribute>
@@ -1095,7 +1142,9 @@
1095
1142
 
1096
1143
 
1097
1144
 
1098
-
1145
+
1146
+
1147
+
1099
1148
 
1100
1149
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1101
1150
 
@@ -1122,6 +1171,8 @@
1122
1171
 
1123
1172
 
1124
1173
 
1174
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1175
+
1125
1176
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1126
1177
 
1127
1178
 
@@ -1151,12 +1202,14 @@
1151
1202
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1152
1203
 
1153
1204
 
1205
+
1154
1206
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1155
1207
 
1156
1208
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1157
1209
 
1158
1210
 
1159
1211
 
1212
+
1160
1213
 
1161
1214
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1162
1215
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -1199,8 +1252,8 @@
1199
1252
 
1200
1253
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
1201
1254
 
1202
- <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
1203
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1255
+ <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
1256
+
1204
1257
 
1205
1258
 
1206
1259
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
@@ -1208,6 +1261,8 @@
1208
1261
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1209
1262
  <xsl:attribute name="text-align">center</xsl:attribute>
1210
1263
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1264
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1265
+
1211
1266
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
1212
1267
 
1213
1268
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -1273,6 +1328,10 @@
1273
1328
 
1274
1329
 
1275
1330
 
1331
+
1332
+
1333
+ <!-- $namespace = 'iso' or -->
1334
+
1276
1335
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1277
1336
 
1278
1337
 
@@ -1308,6 +1367,7 @@
1308
1367
  <xsl:with-param name="table" select="$simple-table"/>
1309
1368
  </xsl:call-template>
1310
1369
  </xsl:variable>
1370
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1311
1371
 
1312
1372
  <!-- <xsl:variable name="colwidths2">
1313
1373
  <xsl:call-template name="calculate-column-widths">
@@ -1328,28 +1388,52 @@
1328
1388
 
1329
1389
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1330
1390
 
1391
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1331
1392
 
1332
1393
 
1394
+
1395
+
1396
+
1333
1397
 
1334
1398
 
1399
+
1335
1400
 
1336
1401
 
1337
1402
 
1338
1403
 
1339
- <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">
1340
-
1341
-
1342
-
1343
-
1404
+
1405
+
1406
+
1407
+ <xsl:variable name="table_attributes">
1408
+ <attribute name="table-layout">fixed</attribute>
1409
+ <attribute name="width">100%</attribute>
1410
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1411
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1344
1412
 
1345
1413
 
1346
1414
 
1347
1415
 
1416
+
1417
+
1418
+
1348
1419
 
1349
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1420
+
1350
1421
 
1422
+ </xsl:variable>
1423
+
1424
+
1425
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1351
1426
 
1427
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1428
+ <xsl:attribute name="{@name}">
1429
+ <xsl:value-of select="."/>
1430
+ </xsl:attribute>
1431
+ </xsl:for-each>
1352
1432
 
1433
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1434
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1435
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1436
+ </xsl:if>
1353
1437
 
1354
1438
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1355
1439
  <xsl:choose>
@@ -1373,6 +1457,33 @@
1373
1457
 
1374
1458
  </fo:table>
1375
1459
 
1460
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1461
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1462
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1463
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1464
+ </xsl:call-template>
1465
+ </xsl:for-each>
1466
+
1467
+ <!-- insert footer as table -->
1468
+ <!-- <fo:table>
1469
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1470
+ <xsl:attribute name="{@name}">
1471
+ <xsl:value-of select="."/>
1472
+ </xsl:attribute>
1473
+ </xsl:for-each>
1474
+
1475
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1476
+ <xsl:choose>
1477
+ <xsl:when test=". = 1 or . = 0">
1478
+ <fo:table-column column-width="proportional-column-width(2)"/>
1479
+ </xsl:when>
1480
+ <xsl:otherwise>
1481
+ <fo:table-column column-width="proportional-column-width({.})"/>
1482
+ </xsl:otherwise>
1483
+ </xsl:choose>
1484
+ </xsl:for-each>
1485
+ </fo:table>-->
1486
+
1376
1487
 
1377
1488
 
1378
1489
 
@@ -1381,8 +1492,9 @@
1381
1492
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1382
1493
  <xsl:if test="normalize-space() != ''">
1383
1494
  <fo:block xsl:use-attribute-sets="table-name-style">
1384
- <xsl:apply-templates/>
1385
- </fo:block>
1495
+
1496
+ <xsl:apply-templates/>
1497
+ </fo:block>
1386
1498
  </xsl:if>
1387
1499
  </xsl:template><xsl:template name="calculate-columns-numbers">
1388
1500
  <xsl:param name="table-row"/>
@@ -1436,6 +1548,13 @@
1436
1548
  <xsl:for-each select="xalan:nodeset($table)//tr">
1437
1549
  <xsl:variable name="td_text">
1438
1550
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1551
+
1552
+ <!-- <xsl:if test="$namespace = 'bipm'">
1553
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1554
+ <word><xsl:value-of select="normalize-space(.)"/></word>
1555
+ </xsl:for-each>
1556
+ </xsl:if> -->
1557
+
1439
1558
  </xsl:variable>
1440
1559
  <xsl:variable name="words">
1441
1560
  <xsl:variable name="string_with_added_zerospaces">
@@ -1495,13 +1614,31 @@
1495
1614
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1496
1615
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1497
1616
  <xsl:value-of select="@target"/>
1617
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1618
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
1619
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1498
1620
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1499
1621
  <xsl:param name="cols-count"/>
1500
1622
  <!-- font-weight="bold" -->
1501
- <fo:table-header>
1623
+ <fo:table-header>
1502
1624
 
1503
1625
  <xsl:apply-templates/>
1504
1626
  </fo:table-header>
1627
+ </xsl:template><xsl:template name="table-header-title">
1628
+ <xsl:param name="cols-count"/>
1629
+ <!-- row for title -->
1630
+ <fo:table-row>
1631
+ <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">
1632
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1633
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1634
+ <xsl:call-template name="fn_name_display"/>
1635
+ </xsl:for-each>
1636
+ <fo:block text-align="right" font-style="italic">
1637
+ <xsl:text> </xsl:text>
1638
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1639
+ </fo:block>
1640
+ </fo:table-cell>
1641
+ </fo:table-row>
1505
1642
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
1506
1643
  <fo:table-body>
1507
1644
  <xsl:apply-templates/>
@@ -1509,6 +1646,13 @@
1509
1646
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1510
1647
  <xsl:apply-templates/>
1511
1648
  </xsl:template><xsl:template name="insertTableFooter">
1649
+ <xsl:param name="cols-count"/>
1650
+ <xsl:if test="../*[local-name()='tfoot']">
1651
+ <fo:table-footer>
1652
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1653
+ </fo:table-footer>
1654
+ </xsl:if>
1655
+ </xsl:template><xsl:template name="insertTableFooter2">
1512
1656
  <xsl:param name="cols-count"/>
1513
1657
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1514
1658
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -1530,11 +1674,29 @@
1530
1674
  <!-- fn will be processed inside 'note' processing -->
1531
1675
 
1532
1676
 
1677
+
1678
+
1679
+
1680
+
1533
1681
  <!-- except gb -->
1534
1682
 
1535
1683
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1536
1684
 
1537
1685
 
1686
+ <!-- show Note under table in preface (ex. abstract) sections -->
1687
+ <!-- empty, because notes show at page side in main sections -->
1688
+ <!-- <xsl:if test="$namespace = 'bipm'">
1689
+ <xsl:choose>
1690
+ <xsl:when test="ancestor::*[local-name()='preface']">
1691
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1692
+ </xsl:when>
1693
+ <xsl:otherwise>
1694
+ <fo:block/>
1695
+ </xsl:otherwise>
1696
+ </xsl:choose>
1697
+ </xsl:if> -->
1698
+
1699
+
1538
1700
  <!-- horizontal row separator -->
1539
1701
 
1540
1702
 
@@ -1548,6 +1710,88 @@
1548
1710
  </fo:table-footer>
1549
1711
 
1550
1712
  </xsl:if>
1713
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1714
+ <xsl:param name="table_attributes"/>
1715
+ <xsl:param name="colwidths"/>
1716
+
1717
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1718
+
1719
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1720
+
1721
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1722
+
1723
+ <fo:table keep-with-previous="always">
1724
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1725
+ <xsl:choose>
1726
+ <xsl:when test="@name = 'border-top'">
1727
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
1728
+ </xsl:when>
1729
+ <xsl:when test="@name = 'border'">
1730
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1731
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
1732
+ </xsl:when>
1733
+ <xsl:otherwise>
1734
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1735
+ </xsl:otherwise>
1736
+ </xsl:choose>
1737
+ </xsl:for-each>
1738
+
1739
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1740
+ <xsl:choose>
1741
+ <xsl:when test=". = 1 or . = 0">
1742
+ <fo:table-column column-width="proportional-column-width(2)"/>
1743
+ </xsl:when>
1744
+ <xsl:otherwise>
1745
+ <fo:table-column column-width="proportional-column-width({.})"/>
1746
+ </xsl:otherwise>
1747
+ </xsl:choose>
1748
+ </xsl:for-each>
1749
+
1750
+ <fo:table-body>
1751
+ <fo:table-row>
1752
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
1753
+
1754
+
1755
+
1756
+ <!-- fn will be processed inside 'note' processing -->
1757
+
1758
+
1759
+
1760
+
1761
+
1762
+
1763
+
1764
+ <!-- except gb -->
1765
+
1766
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1767
+
1768
+
1769
+ <!-- <xsl:if test="$namespace = 'bipm'">
1770
+ <xsl:choose>
1771
+ <xsl:when test="ancestor::*[local-name()='preface']">
1772
+ show Note under table in preface (ex. abstract) sections
1773
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1774
+ </xsl:when>
1775
+ <xsl:otherwise>
1776
+ empty, because notes show at page side in main sections
1777
+ <fo:block/>
1778
+ </xsl:otherwise>
1779
+ </xsl:choose>
1780
+ </xsl:if> -->
1781
+
1782
+
1783
+ <!-- horizontal row separator -->
1784
+
1785
+
1786
+ <!-- fn processing -->
1787
+ <xsl:call-template name="fn_display"/>
1788
+
1789
+ </fo:table-cell>
1790
+ </fo:table-row>
1791
+ </fo:table-body>
1792
+
1793
+ </fo:table>
1794
+ </xsl:if>
1551
1795
  </xsl:template><xsl:template match="*[local-name()='tbody']">
1552
1796
 
1553
1797
  <xsl:variable name="cols-count">
@@ -1565,6 +1809,8 @@
1565
1809
  </xsl:choose>
1566
1810
  </xsl:variable>
1567
1811
 
1812
+
1813
+
1568
1814
  <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
1569
1815
  <xsl:with-param name="cols-count" select="$cols-count"/>
1570
1816
  </xsl:apply-templates>
@@ -1574,6 +1820,8 @@
1574
1820
  </xsl:call-template>
1575
1821
 
1576
1822
  <fo:table-body>
1823
+
1824
+
1577
1825
  <xsl:apply-templates/>
1578
1826
  <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
1579
1827
 
@@ -1597,6 +1845,11 @@
1597
1845
  </xsl:if>
1598
1846
 
1599
1847
 
1848
+
1849
+ <!-- <xsl:if test="$namespace = 'bipm'">
1850
+ <xsl:attribute name="height">8mm</xsl:attribute>
1851
+ </xsl:if> -->
1852
+
1600
1853
  <xsl:apply-templates/>
1601
1854
  </fo:table-row>
1602
1855
  </xsl:template><xsl:template match="*[local-name()='th']">
@@ -1618,6 +1871,8 @@
1618
1871
 
1619
1872
 
1620
1873
 
1874
+
1875
+
1621
1876
  <xsl:if test="@colspan">
1622
1877
  <xsl:attribute name="number-columns-spanned">
1623
1878
  <xsl:value-of select="@colspan"/>
@@ -1628,10 +1883,22 @@
1628
1883
  <xsl:value-of select="@rowspan"/>
1629
1884
  </xsl:attribute>
1630
1885
  </xsl:if>
1886
+ <xsl:call-template name="display-align"/>
1631
1887
  <fo:block>
1632
1888
  <xsl:apply-templates/>
1633
1889
  </fo:block>
1634
1890
  </fo:table-cell>
1891
+ </xsl:template><xsl:template name="display-align">
1892
+ <xsl:if test="@valign">
1893
+ <xsl:attribute name="display-align">
1894
+ <xsl:choose>
1895
+ <xsl:when test="@valign = 'top'">before</xsl:when>
1896
+ <xsl:when test="@valign = 'middle'">center</xsl:when>
1897
+ <xsl:when test="@valign = 'bottom'">after</xsl:when>
1898
+ <xsl:otherwise>before</xsl:otherwise>
1899
+ </xsl:choose>
1900
+ </xsl:attribute>
1901
+ </xsl:if>
1635
1902
  </xsl:template><xsl:template match="*[local-name()='td']">
1636
1903
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
1637
1904
  <xsl:attribute name="text-align">
@@ -1645,7 +1912,9 @@
1645
1912
 
1646
1913
 
1647
1914
 
1648
-
1915
+
1916
+
1917
+
1649
1918
 
1650
1919
 
1651
1920
 
@@ -1661,8 +1930,8 @@
1661
1930
  <xsl:value-of select="@rowspan"/>
1662
1931
  </xsl:attribute>
1663
1932
  </xsl:if>
1664
- <fo:block>
1665
-
1933
+ <xsl:call-template name="display-align"/>
1934
+ <fo:block>
1666
1935
  <xsl:apply-templates/>
1667
1936
  </fo:block>
1668
1937
  </fo:table-cell>
@@ -1674,14 +1943,17 @@
1674
1943
 
1675
1944
 
1676
1945
 
1946
+
1947
+
1677
1948
  <fo:inline padding-right="2mm">
1678
1949
 
1679
1950
 
1680
1951
 
1681
-
1952
+
1682
1953
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1683
1954
 
1684
1955
  </fo:inline>
1956
+
1685
1957
  <xsl:apply-templates mode="process"/>
1686
1958
  </fo:block>
1687
1959
 
@@ -1705,6 +1977,7 @@
1705
1977
 
1706
1978
 
1707
1979
 
1980
+
1708
1981
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
1709
1982
 
1710
1983
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -1714,12 +1987,15 @@
1714
1987
 
1715
1988
 
1716
1989
 
1990
+
1717
1991
  <xsl:value-of select="@reference"/>
1718
1992
 
1993
+
1719
1994
  </fo:inline>
1720
1995
  <fo:inline>
1721
1996
 
1722
- <xsl:apply-templates/>
1997
+ <!-- <xsl:apply-templates /> -->
1998
+ <xsl:copy-of select="./node()"/>
1723
1999
  </fo:inline>
1724
2000
  </fo:block>
1725
2001
  </xsl:if>
@@ -1756,7 +2032,20 @@
1756
2032
  <xsl:variable name="following_dl_colwidths">
1757
2033
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
1758
2034
  <xsl:variable name="html-table">
1759
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2035
+ <xsl:variable name="doc_ns">
2036
+
2037
+ </xsl:variable>
2038
+ <xsl:variable name="ns">
2039
+ <xsl:choose>
2040
+ <xsl:when test="normalize-space($doc_ns) != ''">
2041
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2042
+ </xsl:when>
2043
+ <xsl:otherwise>
2044
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2045
+ </xsl:otherwise>
2046
+ </xsl:choose>
2047
+ </xsl:variable>
2048
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
1760
2049
  <xsl:element name="{$ns}:table">
1761
2050
  <xsl:for-each select="*[local-name() = 'dl'][1]">
1762
2051
  <tbody>
@@ -1821,7 +2110,8 @@
1821
2110
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
1822
2111
  </xsl:if>
1823
2112
 
1824
- <xsl:apply-templates/>
2113
+ <!-- <xsl:apply-templates /> -->
2114
+ <xsl:copy-of select="./node()"/>
1825
2115
  </fo:block>
1826
2116
  </fo:table-cell>
1827
2117
  </fo:table-row>
@@ -1839,9 +2129,13 @@
1839
2129
 
1840
2130
 
1841
2131
 
2132
+
2133
+
1842
2134
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
1843
2135
 
2136
+
1844
2137
  <xsl:value-of select="@reference"/>
2138
+
1845
2139
  </fo:basic-link>
1846
2140
  </fo:inline>
1847
2141
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -1849,115 +2143,142 @@
1849
2143
  <xsl:apply-templates/>
1850
2144
  </fo:inline>
1851
2145
  </xsl:template><xsl:template match="*[local-name()='dl']">
1852
- <xsl:variable name="parent" select="local-name(..)"/>
1853
-
1854
- <xsl:variable name="key_iso">
1855
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
1856
- </xsl:variable>
1857
-
1858
- <xsl:choose>
1859
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
1860
-
1861
-
1862
- <fo:block margin-bottom="12pt" text-align="left">
1863
-
1864
- <xsl:variable name="title-where">
1865
- <xsl:call-template name="getTitle">
1866
- <xsl:with-param name="name" select="'title-where'"/>
1867
- </xsl:call-template>
1868
- </xsl:variable>
1869
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
1870
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
1871
- <xsl:text/>
1872
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
1873
- </fo:block>
1874
-
1875
- </xsl:when>
1876
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
1877
- <fo:block margin-bottom="12pt" text-align="left">
1878
-
1879
-
1880
-
1881
-
1882
- <xsl:variable name="title-where">
1883
- <xsl:call-template name="getTitle">
1884
- <xsl:with-param name="name" select="'title-where'"/>
1885
- </xsl:call-template>
1886
- </xsl:variable>
1887
- <xsl:value-of select="$title-where"/>
1888
- </fo:block>
1889
- </xsl:when>
1890
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
1891
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
1892
-
1893
-
1894
-
1895
- <xsl:variable name="title-key">
1896
- <xsl:call-template name="getTitle">
1897
- <xsl:with-param name="name" select="'title-key'"/>
1898
- </xsl:call-template>
1899
- </xsl:variable>
1900
- <xsl:value-of select="$title-key"/>
1901
- </fo:block>
1902
- </xsl:when>
1903
- </xsl:choose>
1904
-
1905
- <!-- a few components -->
1906
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
1907
- <fo:block>
1908
-
2146
+ <fo:block-container margin-left="0mm">
2147
+ <xsl:if test="parent::*[local-name() = 'note']">
2148
+ <xsl:attribute name="margin-left">
2149
+ <xsl:choose>
2150
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2151
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2152
+ </xsl:choose>
2153
+ </xsl:attribute>
1909
2154
 
2155
+ </xsl:if>
2156
+ <fo:block-container margin-left="0mm">
2157
+
2158
+ <xsl:variable name="parent" select="local-name(..)"/>
1910
2159
 
2160
+ <xsl:variable name="key_iso">
2161
+ <!-- and (not(../@class) or ../@class !='pseudocode') -->
2162
+ </xsl:variable>
1911
2163
 
1912
- <fo:block>
1913
-
1914
-
1915
-
1916
-
1917
- <fo:table width="95%" table-layout="fixed">
2164
+ <xsl:choose>
2165
+ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
1918
2166
 
1919
- <xsl:choose>
1920
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
1921
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
1922
- </xsl:when>
1923
- <xsl:when test="normalize-space($key_iso) = 'true'">
1924
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2167
+
2168
+ <fo:block margin-bottom="12pt" text-align="left">
1925
2169
 
1926
- </xsl:when>
1927
- </xsl:choose>
1928
- <!-- create virtual html table for dl/[dt and dd] -->
1929
- <xsl:variable name="html-table">
1930
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
1931
- <xsl:element name="{$ns}:table">
1932
- <tbody>
1933
- <xsl:apply-templates mode="dl"/>
1934
- </tbody>
1935
- </xsl:element>
1936
- </xsl:variable>
1937
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
1938
- <xsl:variable name="colwidths">
1939
- <xsl:call-template name="calculate-column-widths">
1940
- <xsl:with-param name="cols-count" select="2"/>
1941
- <xsl:with-param name="table" select="$html-table"/>
1942
- </xsl:call-template>
1943
- </xsl:variable>
1944
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
1945
- <xsl:variable name="maxlength_dt">
1946
- <xsl:call-template name="getMaxLength_dt"/>
1947
- </xsl:variable>
1948
- <xsl:call-template name="setColumnWidth_dl">
1949
- <xsl:with-param name="colwidths" select="$colwidths"/>
1950
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
1951
- </xsl:call-template>
1952
- <fo:table-body>
1953
- <xsl:apply-templates>
1954
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
1955
- </xsl:apply-templates>
1956
- </fo:table-body>
1957
- </fo:table>
1958
- </fo:block>
1959
- </fo:block>
1960
- </xsl:if>
2170
+ <xsl:variable name="title-where">
2171
+ <xsl:call-template name="getTitle">
2172
+ <xsl:with-param name="name" select="'title-where'"/>
2173
+ </xsl:call-template>
2174
+ </xsl:variable>
2175
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2176
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
2177
+ <xsl:text/>
2178
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2179
+ </fo:block>
2180
+
2181
+ </xsl:when>
2182
+ <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2183
+ <fo:block margin-bottom="12pt" text-align="left">
2184
+
2185
+
2186
+
2187
+
2188
+ <xsl:variable name="title-where">
2189
+ <xsl:call-template name="getTitle">
2190
+ <xsl:with-param name="name" select="'title-where'"/>
2191
+ </xsl:call-template>
2192
+ </xsl:variable>
2193
+ <xsl:value-of select="$title-where"/>
2194
+ </fo:block>
2195
+ </xsl:when>
2196
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2197
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2198
+
2199
+
2200
+
2201
+ <xsl:variable name="title-key">
2202
+ <xsl:call-template name="getTitle">
2203
+ <xsl:with-param name="name" select="'title-key'"/>
2204
+ </xsl:call-template>
2205
+ </xsl:variable>
2206
+ <xsl:value-of select="$title-key"/>
2207
+ </fo:block>
2208
+ </xsl:when>
2209
+ </xsl:choose>
2210
+
2211
+ <!-- a few components -->
2212
+ <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2213
+ <fo:block>
2214
+
2215
+
2216
+
2217
+
2218
+ <fo:block>
2219
+
2220
+
2221
+
2222
+
2223
+ <fo:table width="95%" table-layout="fixed">
2224
+
2225
+ <xsl:choose>
2226
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2227
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2228
+ </xsl:when>
2229
+ <xsl:when test="normalize-space($key_iso) = 'true'">
2230
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2231
+
2232
+ </xsl:when>
2233
+ </xsl:choose>
2234
+ <!-- create virtual html table for dl/[dt and dd] -->
2235
+ <xsl:variable name="html-table">
2236
+ <xsl:variable name="doc_ns">
2237
+
2238
+ </xsl:variable>
2239
+ <xsl:variable name="ns">
2240
+ <xsl:choose>
2241
+ <xsl:when test="normalize-space($doc_ns) != ''">
2242
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2243
+ </xsl:when>
2244
+ <xsl:otherwise>
2245
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2246
+ </xsl:otherwise>
2247
+ </xsl:choose>
2248
+ </xsl:variable>
2249
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2250
+ <xsl:element name="{$ns}:table">
2251
+ <tbody>
2252
+ <xsl:apply-templates mode="dl"/>
2253
+ </tbody>
2254
+ </xsl:element>
2255
+ </xsl:variable>
2256
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
2257
+ <xsl:variable name="colwidths">
2258
+ <xsl:call-template name="calculate-column-widths">
2259
+ <xsl:with-param name="cols-count" select="2"/>
2260
+ <xsl:with-param name="table" select="$html-table"/>
2261
+ </xsl:call-template>
2262
+ </xsl:variable>
2263
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2264
+ <xsl:variable name="maxlength_dt">
2265
+ <xsl:call-template name="getMaxLength_dt"/>
2266
+ </xsl:variable>
2267
+ <xsl:call-template name="setColumnWidth_dl">
2268
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2269
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2270
+ </xsl:call-template>
2271
+ <fo:table-body>
2272
+ <xsl:apply-templates>
2273
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2274
+ </xsl:apply-templates>
2275
+ </fo:table-body>
2276
+ </fo:table>
2277
+ </fo:block>
2278
+ </fo:block>
2279
+ </xsl:if>
2280
+ </fo:block-container>
2281
+ </fo:block-container>
1961
2282
  </xsl:template><xsl:template name="setColumnWidth_dl">
1962
2283
  <xsl:param name="colwidths"/>
1963
2284
  <xsl:param name="maxlength_dt"/>
@@ -2054,6 +2375,7 @@
2054
2375
  <xsl:param name="key_iso"/>
2055
2376
 
2056
2377
  <fo:table-row>
2378
+
2057
2379
  <fo:table-cell>
2058
2380
 
2059
2381
  <fo:block margin-top="6pt">
@@ -2070,6 +2392,7 @@
2070
2392
 
2071
2393
 
2072
2394
 
2395
+
2073
2396
  <xsl:apply-templates/>
2074
2397
  <!-- <xsl:if test="$namespace = 'gb'">
2075
2398
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2081,14 +2404,36 @@
2081
2404
  <fo:table-cell>
2082
2405
  <fo:block>
2083
2406
 
2084
-
2407
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2408
+ <xsl:if test="local-name(*[1]) != 'stem'">
2409
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2410
+ </xsl:if>
2411
+ </xsl:if> -->
2085
2412
 
2086
2413
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2087
2414
 
2088
2415
  </fo:block>
2089
2416
  </fo:table-cell>
2090
2417
  </fo:table-row>
2091
-
2418
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2419
+ <xsl:if test="local-name(*[1]) = 'stem'">
2420
+ <fo:table-row>
2421
+ <fo:table-cell>
2422
+ <fo:block margin-top="6pt">
2423
+ <xsl:if test="normalize-space($key_iso) = 'true'">
2424
+ <xsl:attribute name="margin-top">0</xsl:attribute>
2425
+ </xsl:if>
2426
+ <xsl:text>&#xA0;</xsl:text>
2427
+ </fo:block>
2428
+ </fo:table-cell>
2429
+ <fo:table-cell>
2430
+ <fo:block>
2431
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2432
+ </fo:block>
2433
+ </fo:table-cell>
2434
+ </fo:table-row>
2435
+ </xsl:if>
2436
+ </xsl:if> -->
2092
2437
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2093
2438
  <xsl:apply-templates/>
2094
2439
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
@@ -2113,6 +2458,31 @@
2113
2458
  </fo:inline>
2114
2459
  </xsl:template><xsl:template match="*[local-name()='tt']">
2115
2460
  <fo:inline xsl:use-attribute-sets="tt-style">
2461
+ <xsl:variable name="_font-size">
2462
+
2463
+ 10
2464
+
2465
+
2466
+
2467
+
2468
+
2469
+
2470
+
2471
+
2472
+
2473
+
2474
+
2475
+
2476
+ </xsl:variable>
2477
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
2478
+ <xsl:if test="$font-size != ''">
2479
+ <xsl:attribute name="font-size">
2480
+ <xsl:choose>
2481
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
2482
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
2483
+ </xsl:choose>
2484
+ </xsl:attribute>
2485
+ </xsl:if>
2116
2486
  <xsl:apply-templates/>
2117
2487
  </fo:inline>
2118
2488
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -2438,11 +2808,24 @@
2438
2808
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2439
2809
  <xsl:value-of select="substring($str, 2)"/>
2440
2810
  </xsl:template><xsl:template match="mathml:math">
2441
- <fo:inline font-family="STIX2Math">
2442
- <fo:instream-foreign-object fox:alt-text="Math">
2443
- <xsl:copy-of select="."/>
2444
- </fo:instream-foreign-object>
2811
+ <fo:inline font-family="STIX Two Math"> <!-- -->
2812
+ <xsl:variable name="mathml">
2813
+ <xsl:apply-templates select="." mode="mathml"/>
2814
+ </xsl:variable>
2815
+ <fo:instream-foreign-object fox:alt-text="Math">
2816
+ <!-- <xsl:copy-of select="."/> -->
2817
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
2818
+ </fo:instream-foreign-object>
2445
2819
  </fo:inline>
2820
+ </xsl:template><xsl:template match="@*|node()" mode="mathml">
2821
+ <xsl:copy>
2822
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
2823
+ </xsl:copy>
2824
+ </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
2825
+ <xsl:copy>
2826
+ <!-- replace start and end spaces to non-break space -->
2827
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
2828
+ </xsl:copy>
2446
2829
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2447
2830
  <xsl:variable name="target">
2448
2831
  <xsl:choose>
@@ -2519,13 +2902,26 @@
2519
2902
  <xsl:apply-templates/>
2520
2903
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
2521
2904
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2522
-
2905
+
2523
2906
  <xsl:apply-templates/>
2524
2907
  </fo:basic-link>
2525
2908
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2526
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2527
- <xsl:apply-templates/>
2528
- </fo:block>
2909
+ <fo:block-container margin-left="0mm">
2910
+ <xsl:if test="parent::*[local-name() = 'note']">
2911
+ <xsl:attribute name="margin-left">
2912
+ <xsl:choose>
2913
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2914
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2915
+ </xsl:choose>
2916
+ </xsl:attribute>
2917
+
2918
+ </xsl:if>
2919
+ <fo:block-container margin-left="0mm">
2920
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2921
+ <xsl:apply-templates/>
2922
+ </fo:block>
2923
+ </fo:block-container>
2924
+ </fo:block-container>
2529
2925
  </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2530
2926
  <fo:inline>
2531
2927
  <xsl:apply-templates/>
@@ -2559,6 +2955,8 @@
2559
2955
 
2560
2956
 
2561
2957
 
2958
+
2959
+
2562
2960
  <fo:inline xsl:use-attribute-sets="note-name-style">
2563
2961
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2564
2962
  </fo:inline>
@@ -2585,7 +2983,9 @@
2585
2983
  </xsl:choose>
2586
2984
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2587
2985
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2588
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2986
+ <fo:inline xsl:use-attribute-sets="termnote-name-style">
2987
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2988
+ </fo:inline>
2589
2989
  <xsl:apply-templates/>
2590
2990
  </fo:block>
2591
2991
  </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">
@@ -2680,15 +3080,109 @@
2680
3080
 
2681
3081
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2682
3082
  </fo:block>
2683
- </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">
3083
+ </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">
2684
3084
  <xsl:apply-templates mode="contents"/>
2685
3085
  <xsl:text> </xsl:text>
2686
- </xsl:template><xsl:template match="text()" mode="contents">
3086
+ </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">
3087
+ <xsl:apply-templates mode="bookmarks"/>
3088
+ <xsl:text> </xsl:text>
3089
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
3090
+ <xsl:value-of select="."/>
3091
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
2687
3092
  <xsl:value-of select="."/>
2688
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3093
+ </xsl:template><xsl:template match="node()" mode="contents">
3094
+ <xsl:apply-templates mode="contents"/>
3095
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
3096
+ <xsl:apply-templates mode="bookmarks"/>
3097
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3098
+ <xsl:apply-templates select="."/>
3099
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3100
+ <xsl:apply-templates mode="bookmarks"/>
3101
+ </xsl:template><xsl:template name="addBookmarks">
3102
+ <xsl:param name="contents"/>
3103
+ <xsl:if test="xalan:nodeset($contents)//item">
3104
+ <fo:bookmark-tree>
3105
+ <xsl:choose>
3106
+ <xsl:when test="xalan:nodeset($contents)/doc">
3107
+ <xsl:choose>
3108
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3109
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3110
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3111
+ <fo:bookmark-title>
3112
+ <xsl:variable name="bookmark-title_">
3113
+ <xsl:call-template name="getLangVersion">
3114
+ <xsl:with-param name="lang" select="@lang"/>
3115
+ </xsl:call-template>
3116
+ </xsl:variable>
3117
+ <xsl:choose>
3118
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3119
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3120
+ </xsl:when>
3121
+ <xsl:otherwise>
3122
+ <xsl:choose>
3123
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3124
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3125
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3126
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3127
+ </xsl:choose>
3128
+ </xsl:otherwise>
3129
+ </xsl:choose>
3130
+ </fo:bookmark-title>
3131
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3132
+ </fo:bookmark>
3133
+
3134
+ </xsl:for-each>
3135
+ </xsl:when>
3136
+ <xsl:otherwise>
3137
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3138
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3139
+ </xsl:for-each>
3140
+ </xsl:otherwise>
3141
+ </xsl:choose>
3142
+ </xsl:when>
3143
+ <xsl:otherwise>
3144
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
3145
+ </xsl:otherwise>
3146
+ </xsl:choose>
3147
+
3148
+
3149
+
3150
+
3151
+
3152
+
3153
+
3154
+
3155
+ </fo:bookmark-tree>
3156
+ </xsl:if>
3157
+ </xsl:template><xsl:template name="getLangVersion">
3158
+ <xsl:param name="lang"/>
3159
+ <xsl:choose>
3160
+ <xsl:when test="$lang = 'en'">
3161
+
3162
+
3163
+ </xsl:when>
3164
+ <xsl:when test="$lang = 'fr'">
3165
+
3166
+
3167
+ </xsl:when>
3168
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3169
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3170
+ </xsl:choose>
3171
+ </xsl:template><xsl:template match="item" mode="bookmark">
3172
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
3173
+ <fo:bookmark-title>
3174
+ <xsl:if test="@section != ''">
3175
+ <xsl:value-of select="@section"/>
3176
+ <xsl:text> </xsl:text>
3177
+ </xsl:if>
3178
+ <xsl:value-of select="normalize-space(title)"/>
3179
+ </fo:bookmark-title>
3180
+ <xsl:apply-templates mode="bookmark"/>
3181
+ </fo:bookmark>
3182
+ </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">
2689
3183
  <xsl:if test="normalize-space() != ''">
2690
3184
  <fo:block xsl:use-attribute-sets="figure-name-style">
2691
-
3185
+
2692
3186
  <xsl:apply-templates/>
2693
3187
  </fo:block>
2694
3188
  </xsl:if>
@@ -2743,7 +3237,7 @@
2743
3237
  <xsl:apply-templates/>
2744
3238
  </xsl:otherwise>
2745
3239
  </xsl:choose>
2746
- </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
3240
+ </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">
2747
3241
  <xsl:text> </xsl:text>
2748
3242
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
2749
3243
  <xsl:copy>
@@ -2752,21 +3246,61 @@
2752
3246
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
2753
3247
  <xsl:text> </xsl:text>
2754
3248
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
2755
- <fo:block xsl:use-attribute-sets="sourcecode-style">
2756
- <xsl:apply-templates/>
2757
- </fo:block>
2758
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2759
- </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
3249
+
3250
+ <fo:block-container margin-left="0mm">
3251
+ <xsl:if test="parent::*[local-name() = 'note']">
3252
+ <xsl:attribute name="margin-left">
3253
+ <xsl:choose>
3254
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3255
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3256
+ </xsl:choose>
3257
+ </xsl:attribute>
3258
+
3259
+ </xsl:if>
3260
+ <fo:block-container margin-left="0mm">
3261
+
3262
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
3263
+ <xsl:variable name="_font-size">
3264
+
3265
+ 10
3266
+
3267
+
3268
+
3269
+
3270
+
3271
+
3272
+
3273
+
3274
+
3275
+
3276
+
3277
+
3278
+ </xsl:variable>
3279
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3280
+ <xsl:if test="$font-size != ''">
3281
+ <xsl:attribute name="font-size">
3282
+ <xsl:choose>
3283
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3284
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3285
+ </xsl:choose>
3286
+ </xsl:attribute>
3287
+ </xsl:if>
3288
+ <xsl:apply-templates/>
3289
+ </fo:block>
3290
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3291
+
3292
+ </fo:block-container>
3293
+ </fo:block-container>
3294
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
2760
3295
  <xsl:variable name="text">
2761
3296
  <xsl:call-template name="add-zero-spaces-equal"/>
2762
3297
  </xsl:variable>
2763
- <xsl:call-template name="add-zero-spaces">
3298
+ <xsl:call-template name="add-zero-spaces-java">
2764
3299
  <xsl:with-param name="text" select="$text"/>
2765
3300
  </xsl:call-template>
2766
3301
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
2767
3302
  <xsl:if test="normalize-space() != ''">
2768
- <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2769
-
3303
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2770
3304
  <xsl:apply-templates/>
2771
3305
  </fo:block>
2772
3306
  </xsl:if>
@@ -2836,22 +3370,30 @@
2836
3370
  </fo:block>
2837
3371
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
2838
3372
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
3373
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3374
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3375
+ </xsl:if>
2839
3376
  <fo:block-container margin-left="0mm" margin-right="0mm">
2840
- <fo:table id="{@id}" table-layout="fixed" width="100%" border="0pt solid black">
3377
+ <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
3378
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3379
+ <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
3380
+ </xsl:if>
2841
3381
  <xsl:variable name="simple-table">
2842
3382
  <xsl:call-template name="getSimpleTable"/>
2843
3383
  </xsl:variable>
2844
3384
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2845
3385
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
2846
- <fo:table-column column-width="35mm"/>
2847
- <fo:table-column column-width="115mm"/>
3386
+ <!-- <fo:table-column column-width="35mm"/>
3387
+ <fo:table-column column-width="115mm"/> -->
3388
+ <fo:table-column column-width="30%"/>
3389
+ <fo:table-column column-width="70%"/>
2848
3390
  </xsl:if>
2849
3391
  <xsl:apply-templates mode="requirement"/>
2850
3392
  </fo:table>
2851
3393
  <!-- fn processing -->
2852
3394
  <xsl:if test=".//*[local-name() = 'fn']">
2853
3395
  <xsl:for-each select="*[local-name() = 'tbody']">
2854
- <fo:block font-size="90%" border-bottom="1.pt solid black">
3396
+ <fo:block font-size="90%" border-bottom="1pt solid black">
2855
3397
  <xsl:call-template name="fn_display"/>
2856
3398
  </fo:block>
2857
3399
  </xsl:for-each>
@@ -2867,17 +3409,27 @@
2867
3409
  <xsl:apply-templates mode="requirement"/>
2868
3410
  </fo:table-body>
2869
3411
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
2870
- <fo:table-row>
3412
+ <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
3413
+ <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
3414
+ <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
3415
+ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
3416
+ </xsl:if>
3417
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
3418
+ <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
3419
+ </xsl:if>
3420
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
3421
+ <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
3422
+ </xsl:if>
2871
3423
  <xsl:apply-templates mode="requirement"/>
2872
3424
  </fo:table-row>
2873
3425
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
2874
- <fo:table-cell text-align="{@align}">
3426
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
2875
3427
  <xsl:attribute name="text-align">
2876
3428
  <xsl:choose>
2877
3429
  <xsl:when test="@align">
2878
3430
  <xsl:value-of select="@align"/>
2879
3431
  </xsl:when>
2880
- <xsl:otherwise>center</xsl:otherwise>
3432
+ <xsl:otherwise>left</xsl:otherwise>
2881
3433
  </xsl:choose>
2882
3434
  </xsl:attribute>
2883
3435
  <xsl:if test="@colspan">
@@ -2890,22 +3442,27 @@
2890
3442
  <xsl:value-of select="@rowspan"/>
2891
3443
  </xsl:attribute>
2892
3444
  </xsl:if>
3445
+ <xsl:call-template name="display-align"/>
2893
3446
 
2894
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3447
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
2895
3448
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2896
3449
  <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
2897
3450
  </xsl:if>
2898
3451
  <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
2899
3452
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2900
3453
  <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
2901
- </xsl:if>
3454
+ </xsl:if> -->
2902
3455
 
2903
3456
  <fo:block>
2904
3457
  <xsl:apply-templates/>
2905
3458
  </fo:block>
2906
3459
  </fo:table-cell>
2907
3460
  </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
2908
- <fo:table-cell text-align="{@align}">
3461
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3462
+ <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3463
+ <xsl:attribute name="padding">0mm</xsl:attribute>
3464
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
3465
+ </xsl:if>
2909
3466
  <xsl:attribute name="text-align">
2910
3467
  <xsl:choose>
2911
3468
  <xsl:when test="@align">
@@ -2914,6 +3471,9 @@
2914
3471
  <xsl:otherwise>left</xsl:otherwise>
2915
3472
  </xsl:choose>
2916
3473
  </xsl:attribute>
3474
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
3475
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3476
+ </xsl:if>
2917
3477
  <xsl:if test="@colspan">
2918
3478
  <xsl:attribute name="number-columns-spanned">
2919
3479
  <xsl:value-of select="@colspan"/>
@@ -2924,25 +3484,27 @@
2924
3484
  <xsl:value-of select="@rowspan"/>
2925
3485
  </xsl:attribute>
2926
3486
  </xsl:if>
3487
+ <xsl:call-template name="display-align"/>
2927
3488
 
2928
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3489
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
2929
3490
  <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
2930
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2931
- <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])"> <!-- 2nd line and below -->
3491
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3492
+ <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
2932
3493
  <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
2933
3494
  </xsl:if>
2934
- </xsl:if>
3495
+ </xsl:if> -->
3496
+ <!-- 2nd line and below -->
2935
3497
 
2936
3498
  <fo:block>
2937
3499
  <xsl:apply-templates/>
2938
3500
  </fo:block>
2939
3501
  </fo:table-cell>
2940
3502
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
2941
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="4pt">
3503
+ <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
2942
3504
  <xsl:apply-templates/>
2943
3505
  </fo:block>
2944
- </xsl:template><xsl:template match="*[local-name() = 'p'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
2945
- <fo:block margin-bottom="10pt">
3506
+ </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
3507
+ <fo:block> <!-- margin-bottom="10pt" -->
2946
3508
  <xsl:apply-templates/>
2947
3509
  </fo:block>
2948
3510
  </xsl:template><xsl:template match="*[local-name() = 'termexample']">
@@ -2964,12 +3526,13 @@
2964
3526
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2965
3527
 
2966
3528
  <xsl:variable name="element">
2967
- block
3529
+ block
2968
3530
 
3531
+ <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
2969
3532
  </xsl:variable>
2970
3533
 
2971
3534
  <xsl:choose>
2972
- <xsl:when test="normalize-space($element) = 'block'">
3535
+ <xsl:when test="contains(normalize-space($element), 'block')">
2973
3536
  <fo:block xsl:use-attribute-sets="example-body-style">
2974
3537
  <xsl:apply-templates/>
2975
3538
  </fo:block>
@@ -3006,25 +3569,44 @@
3006
3569
  </xsl:otherwise>
3007
3570
  </xsl:choose>
3008
3571
 
3009
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3010
- <fo:block xsl:use-attribute-sets="example-p-style">
3572
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3573
+
3574
+ <xsl:variable name="element">
3575
+ block
3011
3576
 
3012
- <xsl:apply-templates/>
3013
- </fo:block>
3577
+ </xsl:variable>
3578
+ <xsl:choose>
3579
+ <xsl:when test="normalize-space($element) = 'block'">
3580
+ <fo:block xsl:use-attribute-sets="example-p-style">
3581
+
3582
+ <xsl:apply-templates/>
3583
+ </fo:block>
3584
+ </xsl:when>
3585
+ <xsl:otherwise>
3586
+ <fo:inline xsl:use-attribute-sets="example-p-style">
3587
+ <xsl:apply-templates/>
3588
+ </fo:inline>
3589
+ </xsl:otherwise>
3590
+ </xsl:choose>
3014
3591
  </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3015
3592
  <fo:block xsl:use-attribute-sets="termsource-style">
3016
3593
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3017
3594
  <xsl:variable name="termsource_text">
3018
3595
  <xsl:apply-templates/>
3019
3596
  </xsl:variable>
3597
+
3020
3598
  <xsl:choose>
3021
3599
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3022
3600
  <xsl:apply-templates/>
3023
3601
  </xsl:when>
3024
- <xsl:otherwise>
3025
- <xsl:text>[</xsl:text>
3026
- <xsl:apply-templates/>
3027
- <xsl:text>]</xsl:text>
3602
+ <xsl:otherwise>
3603
+
3604
+ <xsl:text>[</xsl:text>
3605
+
3606
+ <xsl:apply-templates/>
3607
+
3608
+ <xsl:text>]</xsl:text>
3609
+
3028
3610
  </xsl:otherwise>
3029
3611
  </xsl:choose>
3030
3612
  </fo:block>
@@ -3035,10 +3617,13 @@
3035
3617
  </xsl:template><xsl:template match="*[local-name() = 'origin']">
3036
3618
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3037
3619
 
3038
- <xsl:call-template name="getTitle">
3039
- <xsl:with-param name="name" select="'title-source'"/>
3040
- </xsl:call-template>
3041
- <xsl:text>: </xsl:text>
3620
+ <fo:inline>
3621
+
3622
+ <xsl:call-template name="getTitle">
3623
+ <xsl:with-param name="name" select="'title-source'"/>
3624
+ </xsl:call-template>
3625
+ <xsl:text>: </xsl:text>
3626
+ </fo:inline>
3042
3627
 
3043
3628
  <fo:inline xsl:use-attribute-sets="origin-style">
3044
3629
  <xsl:apply-templates/>
@@ -3050,18 +3635,29 @@
3050
3635
  <xsl:if test="normalize-space() != ''">
3051
3636
  <xsl:value-of select="."/>
3052
3637
  </xsl:if>
3053
- </xsl:template><xsl:template match="*[local-name() = 'quote']">
3638
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
3639
+ <fo:block-container margin-left="0mm">
3640
+ <xsl:if test="parent::*[local-name() = 'note']">
3641
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
3642
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
3643
+ </xsl:if>
3644
+ </xsl:if>
3645
+
3646
+ <fo:block-container margin-left="0mm">
3054
3647
 
3055
- <fo:block xsl:use-attribute-sets="quote-style">
3056
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3057
- </fo:block>
3058
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3059
- <fo:block xsl:use-attribute-sets="quote-source-style">
3060
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
3061
- <xsl:apply-templates select="*[local-name() = 'author']"/>
3062
- <xsl:apply-templates select="*[local-name() = 'source']"/>
3063
- </fo:block>
3064
- </xsl:if>
3648
+ <fo:block xsl:use-attribute-sets="quote-style">
3649
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3650
+ </fo:block>
3651
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3652
+ <fo:block xsl:use-attribute-sets="quote-source-style">
3653
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
3654
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
3655
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
3656
+ </fo:block>
3657
+ </xsl:if>
3658
+
3659
+ </fo:block-container>
3660
+ </fo:block-container>
3065
3661
  </xsl:template><xsl:template match="*[local-name() = 'source']">
3066
3662
  <xsl:if test="../*[local-name() = 'author']">
3067
3663
  <xsl:text>, </xsl:text>
@@ -3092,6 +3688,7 @@
3092
3688
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
3093
3689
 
3094
3690
 
3691
+
3095
3692
  </xsl:if>
3096
3693
 
3097
3694
 
@@ -3130,6 +3727,7 @@
3130
3727
 
3131
3728
 
3132
3729
 
3730
+
3133
3731
  </xsl:variable>
3134
3732
 
3135
3733
  <xsl:variable name="padding-right">
@@ -3225,6 +3823,7 @@
3225
3823
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3226
3824
  <fo:block>
3227
3825
  <xsl:call-template name="setId"/>
3826
+
3228
3827
  <xsl:apply-templates/>
3229
3828
  </fo:block>
3230
3829
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
@@ -3249,6 +3848,31 @@
3249
3848
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3250
3849
  <!-- 0xA0 to space replacement -->
3251
3850
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3851
+ </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3852
+ <xsl:choose>
3853
+ <xsl:when test="parent::*[local-name() = 'note']">
3854
+ <fo:block-container>
3855
+ <xsl:attribute name="margin-left">
3856
+ <xsl:choose>
3857
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3858
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3859
+ </xsl:choose>
3860
+ </xsl:attribute>
3861
+
3862
+
3863
+ <fo:block-container margin-left="0mm">
3864
+ <fo:block>
3865
+ <xsl:apply-templates select="." mode="ul_ol"/>
3866
+ </fo:block>
3867
+ </fo:block-container>
3868
+ </fo:block-container>
3869
+ </xsl:when>
3870
+ <xsl:otherwise>
3871
+ <fo:block>
3872
+ <xsl:apply-templates select="." mode="ul_ol"/>
3873
+ </fo:block>
3874
+ </xsl:otherwise>
3875
+ </xsl:choose>
3252
3876
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3253
3877
  <!-- <row>
3254
3878
  <date>05-07-2013</date>
@@ -3280,6 +3904,65 @@
3280
3904
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3281
3905
  <fo:block><xsl:apply-templates/></fo:block>
3282
3906
  </fo:table-cell>
3907
+ </xsl:template><xsl:template name="processBibitem">
3908
+
3909
+
3910
+
3911
+
3912
+ </xsl:template><xsl:template name="processBibitemDocId">
3913
+ <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')]"/>
3914
+ <xsl:choose>
3915
+ <xsl:when test="normalize-space($_doc_ident) != ''">
3916
+ <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"/>
3917
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
3918
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3919
+ </xsl:if>
3920
+ <xsl:value-of select="$_doc_ident"/>
3921
+ </xsl:when>
3922
+ <xsl:otherwise>
3923
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
3924
+ <xsl:if test="$type != ''">
3925
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3926
+ </xsl:if>
3927
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
3928
+ </xsl:otherwise>
3929
+ </xsl:choose>
3930
+ </xsl:template><xsl:template name="processPersonalAuthor">
3931
+ <xsl:choose>
3932
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
3933
+ <author>
3934
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
3935
+ </author>
3936
+ </xsl:when>
3937
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
3938
+ <author>
3939
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3940
+ <xsl:text> </xsl:text>
3941
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
3942
+ </author>
3943
+ </xsl:when>
3944
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
3945
+ <author>
3946
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3947
+ <xsl:text> </xsl:text>
3948
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
3949
+ </author>
3950
+ </xsl:when>
3951
+ <xsl:otherwise>
3952
+ <xsl:apply-templates/>
3953
+ </xsl:otherwise>
3954
+ </xsl:choose>
3955
+ </xsl:template><xsl:template name="renderDate">
3956
+ <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
3957
+ <xsl:value-of select="*[local-name() = 'on']"/>
3958
+ </xsl:if>
3959
+ <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
3960
+ <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
3961
+ </xsl:if>
3962
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
3963
+ <xsl:value-of select="translate(.,'. ','')"/>
3964
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
3965
+ <xsl:value-of select="substring(.,1,1)"/>
3283
3966
  </xsl:template><xsl:template name="convertDate">
3284
3967
  <xsl:param name="date"/>
3285
3968
  <xsl:param name="format" select="'short'"/>
@@ -3358,6 +4041,7 @@
3358
4041
  <dc:title>
3359
4042
  <xsl:variable name="title">
3360
4043
 
4044
+
3361
4045
 
3362
4046
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/>
3363
4047
 
@@ -3376,6 +4060,7 @@
3376
4060
  <dc:creator>
3377
4061
 
3378
4062
 
4063
+
3379
4064
  </dc:creator>
3380
4065
  <dc:description>
3381
4066
  <xsl:variable name="abstract">
@@ -3385,6 +4070,7 @@
3385
4070
 
3386
4071
 
3387
4072
 
4073
+
3388
4074
  </xsl:variable>
3389
4075
  <xsl:value-of select="normalize-space($abstract)"/>
3390
4076
  </dc:description>
@@ -3485,6 +4171,7 @@
3485
4171
 
3486
4172
 
3487
4173
 
4174
+
3488
4175
  </xsl:variable>
3489
4176
  <xsl:if test="$documentNS != $XSLNS">
3490
4177
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3510,4 +4197,21 @@
3510
4197
  </xsl:otherwise>
3511
4198
  </xsl:choose>
3512
4199
  </xsl:attribute>
4200
+ </xsl:template><xsl:template name="add-letter-spacing">
4201
+ <xsl:param name="text"/>
4202
+ <xsl:param name="letter-spacing" select="'0.15'"/>
4203
+ <xsl:if test="string-length($text) &gt; 0">
4204
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
4205
+ <fo:inline padding-right="{$letter-spacing}mm">
4206
+ <xsl:if test="$char = '®'">
4207
+ <xsl:attribute name="font-size">58%</xsl:attribute>
4208
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4209
+ </xsl:if>
4210
+ <xsl:value-of select="$char"/>
4211
+ </fo:inline>
4212
+ <xsl:call-template name="add-letter-spacing">
4213
+ <xsl:with-param name="text" select="substring($text, 2)"/>
4214
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4215
+ </xsl:call-template>
4216
+ </xsl:if>
3513
4217
  </xsl:template></xsl:stylesheet>