metanorma-csa 1.6.0 → 1.6.5

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: 5d40ac7d7960480cf04f0bc223679aeeda06119c46aaa4b752205ba5a6614bde
4
- data.tar.gz: ce53937b6d118d5efc1a8d862bbf57e5d487d5433f52ddfd48f7ad650932c023
3
+ metadata.gz: b39b8dc480981f588fa326b12c646f7ed4e40967f18a5614e23032dde195fccb
4
+ data.tar.gz: 41e2d38150cb17f451786e0f753b51094097c43694c847ddcd9f193e7881b8a2
5
5
  SHA512:
6
- metadata.gz: 4631e7f00ba44d538964e85211deaeab9d83ad236bef782fc18a674f4a28364ce09c109f724d37a93f0a5ee62b949a67e536531578233cd5a59d678ea7331b4c
7
- data.tar.gz: 784bc3a5f21d4daf5b7cbcbfd416744f7b802258188981bbe9d3e4f6f7dc0ac12d6eda940e13a3e2d6ec127cb0db6e118e1b3d3b34fea1429ea596eed6985acd
6
+ metadata.gz: f08298b4edade5b2ec79b7ba3a711ebf47707671f0b31cfda119cb3689c6b092264196535694b04946d59464b32edef2be13405009292c1d4b193ed45f4ff3dd
7
+ data.tar.gz: 9007cbedf8e94f4cbd5e65163e8dfefe4659539b5aafd76306fe66a01c8401c5f88fffcae2a1e158f13b9e0e169ab6bfdd3b7f1aaa3744cff46f62e38398c0a6
@@ -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>
@@ -7,6 +7,7 @@
7
7
 
8
8
  {% if unpublished %}
9
9
  <license-statement>
10
+ <clause>
10
11
  <title>Warning for Drafts</title>
11
12
 
12
13
  <p>This document is not a CSA Standard. It is distributed for review and
@@ -15,6 +16,7 @@
15
16
  comments, notification of any relevant patent rights of which they are aware
16
17
  and to provide supporting documentation.
17
18
  </p>
19
+ </clause>
18
20
  </license-statement>
19
21
  {% endif %}
20
22
 
@@ -22,21 +22,14 @@ module Asciidoctor
22
22
 
23
23
  register_for CSA_TYPE
24
24
 
25
- def metadata_author(node, xml)
26
- xml.contributor do |c|
27
- c.role **{ type: "author" }
28
- c.organization do |a|
29
- a.name "Cloud Security Alliance"
30
- end
31
- end
25
+ def default_publisher
26
+ "Cloud Security Alliance"
32
27
  end
33
28
 
34
- def metadata_publisher(node, xml)
35
- xml.contributor do |c|
36
- c.role **{ type: "publisher" }
37
- c.organization do |a|
38
- a.name "Cloud Security Alliance"
39
- end
29
+ def personal_role(node, c, suffix)
30
+ role = node.attr("role#{suffix}")&.downcase || "full author"
31
+ c.role **{ type: role == "editor" ? "editor" : "author" } do |r|
32
+ r.description role.strip.gsub(/\s/, "-")
40
33
  end
41
34
  end
42
35
 
@@ -67,24 +60,12 @@ module Asciidoctor
67
60
  xml.docnumber { |i| i << node.attr('docnumber') }
68
61
  end
69
62
 
70
- def metadata_copyright(node, xml)
71
- from = node.attr('copyright-year') || Date.today.year
72
- xml.copyright do |c|
73
- c.from from
74
- c.owner do |owner|
75
- owner.organization do |o|
76
- o.name 'Cloud Security Alliance'
77
- end
78
- end
79
- end
80
- end
81
-
82
63
  def title_validate(root)
83
64
  nil
84
65
  end
85
66
 
86
67
  def doctype(node)
87
- d = node.attr('doctype')
68
+ d = super
88
69
  unless %w{guidance proposal standard report whitepaper charter policy
89
70
  glossary case-study}.include? d
90
71
  @log.add("Document Attributes", nil,
@@ -95,6 +95,13 @@
95
95
  </include>
96
96
  <define name="csand-standard">
97
97
  <element name="csa-standard">
98
+ <attribute name="version"/>
99
+ <attribute name="type">
100
+ <choice>
101
+ <value>semantic</value>
102
+ <value>presentation</value>
103
+ </choice>
104
+ </attribute>
98
105
  <ref name="bibdata"/>
99
106
  <zeroOrMore>
100
107
  <ref name="termdocsource"/>
@@ -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"/>
@@ -1453,11 +1492,6 @@
1453
1492
  </optional>
1454
1493
  </element>
1455
1494
  </define>
1456
- <define name="preface_abstract">
1457
- <element name="abstract">
1458
- <ref name="Basic-Section"/>
1459
- </element>
1460
- </define>
1461
1495
  <define name="term-clause">
1462
1496
  <element name="clause">
1463
1497
  <optional>
@@ -1507,4 +1541,79 @@
1507
1541
  <ref name="CitationType"/>
1508
1542
  </element>
1509
1543
  </define>
1544
+ <define name="amend">
1545
+ <element name="amend">
1546
+ <optional>
1547
+ <attribute name="id">
1548
+ <data type="ID"/>
1549
+ </attribute>
1550
+ </optional>
1551
+ <attribute name="change">
1552
+ <choice>
1553
+ <value>add</value>
1554
+ <value>modify</value>
1555
+ <value>delete</value>
1556
+ </choice>
1557
+ </attribute>
1558
+ <optional>
1559
+ <attribute name="path"/>
1560
+ </optional>
1561
+ <optional>
1562
+ <attribute name="path_end"/>
1563
+ </optional>
1564
+ <optional>
1565
+ <attribute name="title"/>
1566
+ </optional>
1567
+ <optional>
1568
+ <element name="location">
1569
+ <zeroOrMore>
1570
+ <ref name="locality"/>
1571
+ </zeroOrMore>
1572
+ </element>
1573
+ </optional>
1574
+ <zeroOrMore>
1575
+ <ref name="autonumber"/>
1576
+ </zeroOrMore>
1577
+ <optional>
1578
+ <element name="description">
1579
+ <zeroOrMore>
1580
+ <ref name="BasicBlock"/>
1581
+ </zeroOrMore>
1582
+ </element>
1583
+ </optional>
1584
+ <optional>
1585
+ <element name="newcontent">
1586
+ <zeroOrMore>
1587
+ <ref name="BasicBlock"/>
1588
+ </zeroOrMore>
1589
+ </element>
1590
+ </optional>
1591
+ <optional>
1592
+ <element name="description">
1593
+ <zeroOrMore>
1594
+ <ref name="BasicBlock"/>
1595
+ </zeroOrMore>
1596
+ </element>
1597
+ </optional>
1598
+ </element>
1599
+ </define>
1600
+ <define name="autonumber">
1601
+ <element name="autonumber">
1602
+ <attribute name="type">
1603
+ <choice>
1604
+ <value>requirement</value>
1605
+ <value>recommendation</value>
1606
+ <value>permission</value>
1607
+ <value>table</value>
1608
+ <value>figure</value>
1609
+ <value>admonition</value>
1610
+ <value>formula</value>
1611
+ <value>sourcecode</value>
1612
+ <value>example</value>
1613
+ <value>note</value>
1614
+ </choice>
1615
+ </attribute>
1616
+ <text/>
1617
+ </element>
1618
+ </define>
1510
1619
  </grammar>
@@ -8,6 +8,7 @@ module Asciidoctor
8
8
 
9
9
  def bibdata_validate(doc)
10
10
  stage_validate(doc)
11
+ role_validate(doc)
11
12
  end
12
13
 
13
14
  def stage_validate(xmldoc)
@@ -17,6 +18,16 @@ module Asciidoctor
17
18
  @log.add("Document Attributes", nil,
18
19
  "#{stage} is not a recognised status")
19
20
  end
21
+
22
+ def role_validate(doc)
23
+ doc&.xpath("//bibdata/contributor/role[description]")&.each do |r|
24
+ r["type"] == "author" or next
25
+ role = r.at("./description").text
26
+ %w{full-author contributor staff reviewer}.include?(role) or
27
+ @log.add("Document Attributes", nil,
28
+ "#{role} is not a recognised role")
29
+ end
30
+ end
20
31
  end
21
32
  end
22
33
  end
@@ -18,51 +18,12 @@
18
18
  <xsl:text>, Cloud Security Alliance. All rights reserved.</xsl:text>
19
19
  </xsl:variable>
20
20
 
21
- <xsl:variable name="color-header-cover">rgb(55, 243, 244)</xsl:variable>
22
21
  <xsl:variable name="color-header-document">rgb(79, 201, 204)</xsl:variable>
23
- <xsl:variable name="color-link">rgb(33, 94, 159)</xsl:variable>
24
-
25
- <xsl:variable name="copyright_short">
26
- <xsl:text>© </xsl:text>
27
- <xsl:value-of select="/csa:csa-standard/csa:bibdata/csa:copyright/csa:from"/>
28
- <xsl:text> </xsl:text>
29
- <xsl:value-of select="/csa:csa-standard/csa:bibdata/csa:contributor/csa:organization/csa:name"/>
30
- </xsl:variable>
31
-
32
- <xsl:variable name="doctitle" select="/csa:csa-standard/csa:bibdata/csa:title[@language = 'en']"/>
33
-
34
- <xsl:variable name="doctype">
35
- <xsl:call-template name="capitalizeWords">
36
- <xsl:with-param name="str" select="/csa:csa-standard/csa:bibdata/csa:ext/csa:doctype"/>
37
- </xsl:call-template>
38
- </xsl:variable>
39
-
40
- <xsl:variable name="header">
41
- <xsl:text>Open Geospatial Consortium </xsl:text>
42
- <xsl:value-of select="/csa:csa-standard/csa:bibdata/csa:docidentifier[@type = 'csa-internal']"/>
43
- <xsl:text>:</xsl:text>
44
- <xsl:value-of select="/csa:csa-standard/csa:bibdata/csa:copyright/csa:from"/>
45
- </xsl:variable>
46
22
 
47
23
  <xsl:variable name="contents">
48
- <contents>
49
-
50
- <xsl:apply-templates select="/csa:csa-standard/csa:preface/*" mode="contents"/>
51
-
52
- <xsl:apply-templates select="/csa:csa-standard/csa:sections/csa:clause[@id='_scope']" mode="contents"/>
53
-
54
- <!-- Normative references -->
55
- <xsl:apply-templates select="/csa:csa-standard/csa:bibliography/csa:references[@id = '_normative_references' or @id = '_references']" mode="contents"/>
56
-
57
- <xsl:apply-templates select="/csa:csa-standard/csa:sections/csa:terms" mode="contents"/> <!-- Terms and definitions -->
58
-
59
- <xsl:apply-templates select="/csa:csa-standard/csa:sections/*[local-name() != 'terms' and not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]" mode="contents"/>
60
-
61
- <xsl:apply-templates select="/csa:csa-standard/csa:annex" mode="contents"/>
62
-
63
- <!-- Bibliography -->
64
- <xsl:apply-templates select="/csa:csa-standard/csa:bibliography/csa:references[@id != '_normative_references' and @id != '_references']" mode="contents"/>
65
-
24
+ <contents>
25
+ <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
26
+ <xsl:call-template name="processMainSectionsDefault_Contents"/>
66
27
  </contents>
67
28
  </xsl:variable>
68
29
 
@@ -72,7 +33,7 @@
72
33
 
73
34
  <xsl:template match="/">
74
35
  <xsl:call-template name="namespaceCheck"/>
75
- <fo:root font-family="AzoSans, STIX2Math" font-size="10pt" xml:lang="{$lang}">
36
+ <fo:root font-family="AzoSans, STIX Two Math" font-size="10pt" xml:lang="{$lang}">
76
37
  <fo:layout-master-set>
77
38
  <!-- Cover page -->
78
39
  <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
@@ -93,6 +54,10 @@
93
54
 
94
55
  <xsl:call-template name="addPDFUAmeta"/>
95
56
 
57
+ <xsl:call-template name="addBookmarks">
58
+ <xsl:with-param name="contents" select="$contents"/>
59
+ </xsl:call-template>
60
+
96
61
  <!-- Cover Page -->
97
62
  <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
98
63
  <fo:static-content flow-name="xsl-footnote-separator">
@@ -101,7 +66,7 @@
101
66
  </fo:block>
102
67
  </fo:static-content>
103
68
  <fo:static-content flow-name="cover-page-header">
104
- <fo:block-container height="2.5mm" background-color="{$color-header-cover}">
69
+ <fo:block-container height="2.5mm" background-color="rgb(55, 243, 244)">
105
70
  <fo:block font-size="1pt"> </fo:block>
106
71
  </fo:block-container>
107
72
  <fo:block-container position="absolute" top="2.5mm" height="{279.4 - 2.5}mm" width="100%" background-color="rgb(80, 203, 205)">
@@ -113,7 +78,7 @@
113
78
 
114
79
  <fo:block-container width="136mm" margin-bottom="12pt">
115
80
  <fo:block font-size="36pt" font-weight="bold" color="rgb(54, 59, 74)">
116
- <xsl:value-of select="$doctitle"/>
81
+ <xsl:value-of select="/csa:csa-standard/csa:bibdata/csa:title[@language = 'en']"/>
117
82
  </fo:block>
118
83
  </fo:block-container>
119
84
 
@@ -173,16 +138,57 @@
173
138
  </xsl:variable>
174
139
  <fo:block font-size="26pt" margin-bottom="18pt"><xsl:value-of select="$title-acknowledgements"/></fo:block>
175
140
 
176
- <fo:block font-size="18pt" font-weight="bold" margin-bottom="12pt" color="rgb(3, 115, 200)">Lead Authors:</fo:block>
177
- <fo:block>Ronald Tse</fo:block>
178
- <fo:block font-size="18pt" font-weight="bold" margin-top="16pt" margin-bottom="12pt" color="rgb(3, 115, 200)">Contributors:</fo:block>
179
- <fo:block>Michael Roza</fo:block>
180
- <fo:block>Sean Heide</fo:block>
181
- <fo:block>David Lewis</fo:block>
182
- <fo:block>Eric Gauthier</fo:block>
183
- <fo:block font-size="18pt" font-weight="bold" margin-top="16pt" margin-bottom="12pt" color="rgb(3, 115, 200)">CSA Staff:</fo:block>
184
- <fo:block>Sean Heide</fo:block>
141
+ <xsl:variable name="persons">
142
+ <xsl:for-each select="/csa:csa-standard/csa:bibdata/csa:contributor[csa:person]">
143
+ <contributor>
144
+ <xsl:attribute name="type">
145
+ <xsl:choose>
146
+ <xsl:when test="csa:role/@type='author'">
147
+ <xsl:value-of select="csa:role/csa:description"/>
148
+ </xsl:when>
149
+ <xsl:otherwise>
150
+ <xsl:value-of select="csa:role/@type"/>
151
+ </xsl:otherwise>
152
+ </xsl:choose>
153
+ </xsl:attribute>
154
+ <xsl:value-of select="csa:person/csa:name/csa:completename"/>
155
+ </contributor>
156
+ </xsl:for-each>
157
+ </xsl:variable>
158
+
159
+ <xsl:variable name="contributors">
160
+ <contributor title="Author" pluraltitle="Authors">full-author</contributor>
161
+ <contributor title="Contributor" pluraltitle="Contributors">contributor</contributor>
162
+ <contributor title="Staff" pluraltitle="Staff">staff</contributor>
163
+ <contributor title="Reviewer" pluraltitle="Reviewers">reviewer</contributor>
164
+ <contributor title="Editor" pluraltitle="Editors">editor</contributor>
165
+ </xsl:variable>
166
+
167
+ <!-- The sequence of author types is: full-author (omitted), Contributor, Staff, Reviewer -->
168
+
169
+ <xsl:for-each select="xalan:nodeset($contributors)/*">
170
+ <xsl:variable name="type" select="."/>
171
+ <xsl:variable name="title" select="@title"/>
172
+ <xsl:variable name="pluraltitle" select="@pluraltitle"/>
173
+ <xsl:for-each select="xalan:nodeset($persons)/contributor[@type = $type]">
174
+ <xsl:if test="position() = 1">
175
+ <fo:block font-size="18pt" font-weight="bold" margin-top="16pt" margin-bottom="12pt" color="rgb(3, 115, 200)">
176
+ <xsl:choose>
177
+ <xsl:when test="following-sibling::contributor[@type = $type]">
178
+ <xsl:value-of select="$pluraltitle"/>
179
+ </xsl:when>
180
+ <xsl:otherwise>
181
+ <xsl:value-of select="$title"/>
182
+ </xsl:otherwise>
183
+ </xsl:choose>
184
+ <xsl:text>:</xsl:text>
185
+ </fo:block>
186
+ </xsl:if>
187
+ <fo:block><xsl:value-of select="."/></fo:block>
188
+ </xsl:for-each>
189
+ </xsl:for-each>
185
190
 
191
+
186
192
  <fo:block break-after="page"/>
187
193
 
188
194
  <fo:block-container font-size="12pt" line-height="170%" color="rgb(7, 72, 156)">
@@ -194,7 +200,7 @@
194
200
  <fo:block font-size="26pt" color="black" margin-top="2pt" margin-bottom="30pt"><xsl:value-of select="$title-toc"/></fo:block>
195
201
 
196
202
  <fo:block margin-left="-3mm">
197
- <xsl:for-each select="xalan:nodeset($contents)//item">
203
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
198
204
  <fo:block>
199
205
  <fo:list-block>
200
206
  <xsl:attribute name="provisional-distance-between-starts">
@@ -209,9 +215,9 @@
209
215
  </fo:list-item-label>
210
216
  <fo:list-item-body start-indent="body-start()">
211
217
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
212
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
218
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
213
219
  <fo:inline padding-right="2mm"><xsl:value-of select="@section"/></fo:inline>
214
- <xsl:apply-templates/>
220
+ <xsl:apply-templates select="title"/>
215
221
  <fo:inline keep-together.within-line="always">
216
222
  <fo:leader leader-pattern="dots"/>
217
223
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
@@ -229,20 +235,8 @@
229
235
  <fo:block break-after="page"/>
230
236
 
231
237
  <fo:block line-height="145%">
232
- <xsl:apply-templates select="/csa:csa-standard/csa:preface/*"/>
233
-
234
- <xsl:apply-templates select="/csa:csa-standard/csa:sections/csa:clause[@id='_scope']"/>
235
-
236
- <!-- Normative references -->
237
- <xsl:apply-templates select="/csa:csa-standard/csa:bibliography/csa:references[@id = '_normative_references' or @id = '_references']"/>
238
-
239
- <xsl:apply-templates select="/csa:csa-standard/csa:sections/csa:terms"/> <!-- Terms and definitions -->
240
-
241
- <xsl:apply-templates select="/csa:csa-standard/csa:sections/*[local-name() != 'terms' and not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"/>
242
-
243
- <xsl:apply-templates select="/csa:csa-standard/csa:annex"/>
244
- <xsl:apply-templates select="/csa:csa-standard/csa:bibliography/csa:references[@id != '_normative_references' and @id != '_references']"/>
245
-
238
+ <xsl:call-template name="processPrefaceSectionsDefault"/>
239
+ <xsl:call-template name="processMainSectionsDefault"/>
246
240
  </fo:block>
247
241
 
248
242
 
@@ -271,17 +265,24 @@
271
265
  <xsl:with-param name="depth" select="csa:title/@depth"/>
272
266
  </xsl:call-template>
273
267
  </xsl:variable>
268
+
269
+
274
270
  <xsl:variable name="display">
275
- <xsl:choose>
276
- <xsl:when test="ancestor-or-self::csa:bibitem">false</xsl:when>
277
- <xsl:when test="ancestor-or-self::csa:term">false</xsl:when>
271
+ <xsl:choose>
278
272
  <xsl:when test="$level &gt;= 3">false</xsl:when>
279
273
  <xsl:otherwise>true</xsl:otherwise>
280
274
  </xsl:choose>
281
275
  </xsl:variable>
282
276
 
283
- <xsl:if test="$display = 'true'">
277
+ <xsl:variable name="skip">
278
+ <xsl:choose>
279
+ <xsl:when test="ancestor-or-self::csa:bibitem">true</xsl:when>
280
+ <xsl:when test="ancestor-or-self::csa:term">true</xsl:when>
281
+ <xsl:otherwise>false</xsl:otherwise>
282
+ </xsl:choose>
283
+ </xsl:variable>
284
284
 
285
+ <xsl:if test="$skip = 'false'">
285
286
  <xsl:variable name="section">
286
287
  <xsl:call-template name="getSection"/>
287
288
  </xsl:variable>
@@ -290,10 +291,12 @@
290
291
  <xsl:call-template name="getName"/>
291
292
  </xsl:variable>
292
293
 
293
- <item id="{@id}" level="{$level}" section="{$section}">
294
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
294
+ <item id="{@id}" level="{$level}" section="{$section}" display="{$display}">
295
+ <title>
296
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
297
+ </title>
298
+ <xsl:apply-templates mode="contents"/>
295
299
  </item>
296
- <xsl:apply-templates mode="contents"/>
297
300
  </xsl:if>
298
301
  </xsl:template>
299
302
 
@@ -610,7 +613,7 @@
610
613
 
611
614
 
612
615
 
613
- <xsl:template match="csa:ul | csa:ol">
616
+ <xsl:template match="csa:ul | csa:ol" mode="ul_ol">
614
617
  <xsl:choose>
615
618
  <xsl:when test="not(ancestor::csa:ul) and not(ancestor::csa:ol)">
616
619
  <fo:block-container border-left="0.75mm solid {$color-header-document}" margin-left="1mm" margin-bottom="12pt">
@@ -622,7 +625,13 @@
622
625
  </fo:block-container>
623
626
  </xsl:when>
624
627
  <xsl:otherwise>
625
- <xsl:call-template name="listProcessing"/>
628
+ <fo:block-container>
629
+ <fo:block-container margin-left="7mm">
630
+ <fo:block margin-left="-7mm">
631
+ <xsl:call-template name="listProcessing"/>
632
+ </fo:block>
633
+ </fo:block-container>
634
+ </fo:block-container>
626
635
  </xsl:otherwise>
627
636
  </xsl:choose>
628
637
  </xsl:template>
@@ -712,7 +721,7 @@
712
721
 
713
722
 
714
723
  <!-- [position() &gt; 1] -->
715
- <xsl:template match="csa:references[@id != '_normative_references' and @id != '_references']">
724
+ <xsl:template match="csa:references[not(@normative='true')]">
716
725
  <fo:block break-after="page"/>
717
726
  <fo:block id="{@id}" line-height="145%">
718
727
  <xsl:apply-templates/>
@@ -722,7 +731,7 @@
722
731
 
723
732
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
724
733
  <!-- <xsl:template match="csa:references[@id = '_bibliography']/csa:bibitem"> [position() &gt; 1] -->
725
- <xsl:template match="csa:references[@id != '_normative_references' and @id != '_references']/csa:bibitem">
734
+ <xsl:template match="csa:references[not(@normative='true')]/csa:bibitem">
726
735
  <fo:block margin-bottom="12pt" line-height="145%">
727
736
  <fo:inline id="{@id}">
728
737
  <xsl:number format="[1]"/>
@@ -785,10 +794,10 @@
785
794
  </xsl:template>
786
795
 
787
796
  <!-- <xsl:template match="csa:references[@id = '_bibliography']/csa:bibitem" mode="contents"/> [position() &gt; 1] -->
788
- <xsl:template match="csa:references[@id != '_normative_references' and @id != '_references']/csa:bibitem" mode="contents"/>
797
+ <xsl:template match="csa:references[not(@normative='true')]/csa:bibitem" mode="contents"/>
789
798
 
790
799
  <!-- <xsl:template match="csa:references[@id = '_bibliography']/csa:bibitem/csa:title"> [position() &gt; 1]-->
791
- <xsl:template match="csa:references[@id != '_normative_references' and @id != '_references']/csa:bibitem/csa:title">
800
+ <xsl:template match="csa:references[not(@normative='true')]/csa:bibitem/csa:title">
792
801
  <fo:inline font-style="italic">
793
802
  <xsl:apply-templates/>
794
803
  </fo:inline>
@@ -880,6 +889,12 @@
880
889
 
881
890
  </title-edition>
882
891
 
892
+ <title-edition lang="fr">
893
+
894
+ <xsl:text>Édition </xsl:text>
895
+
896
+ </title-edition>
897
+
883
898
 
884
899
  <title-toc lang="en">
885
900
 
@@ -888,7 +903,12 @@
888
903
 
889
904
 
890
905
  </title-toc>
891
- <title-toc lang="fr">Sommaire</title-toc>
906
+ <title-toc lang="fr">
907
+
908
+ <xsl:text>Sommaire</xsl:text>
909
+
910
+
911
+ </title-toc>
892
912
 
893
913
  <title-toc lang="zh">Contents</title-toc>
894
914
 
@@ -922,7 +942,12 @@
922
942
 
923
943
 
924
944
 
925
- <title-source lang="en">SOURCE</title-source>
945
+ <title-source lang="en">
946
+
947
+ <xsl:text>SOURCE</xsl:text>
948
+
949
+
950
+ </title-source>
926
951
 
927
952
  <title-keywords lang="en">Keywords</title-keywords>
928
953
 
@@ -965,12 +990,25 @@
965
990
  <title-warning lang="zh">警告</title-warning>
966
991
 
967
992
  <title-amendment lang="en">AMENDMENT</title-amendment>
993
+
994
+ <title-continued lang="en">(continued)</title-continued>
995
+ <title-continued lang="fr">(continué)</title-continued>
996
+
968
997
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
969
998
  <xsl:param name="name"/>
970
- <xsl:variable name="lang">
971
- <xsl:call-template name="getLang"/>
999
+ <xsl:param name="lang"/>
1000
+ <xsl:variable name="lang_">
1001
+ <xsl:choose>
1002
+ <xsl:when test="$lang != ''">
1003
+ <xsl:value-of select="$lang"/>
1004
+ </xsl:when>
1005
+ <xsl:otherwise>
1006
+ <xsl:call-template name="getLang"/>
1007
+ </xsl:otherwise>
1008
+ </xsl:choose>
972
1009
  </xsl:variable>
973
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
1010
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
1011
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
974
1012
  <xsl:choose>
975
1013
  <xsl:when test="normalize-space($title_) != ''">
976
1014
  <xsl:value-of select="$title_"/>
@@ -979,7 +1017,10 @@
979
1017
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
980
1018
  </xsl:otherwise>
981
1019
  </xsl:choose>
982
- </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">
1020
+ </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">
1021
+
1022
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
1023
+
983
1024
 
984
1025
 
985
1026
  <xsl:attribute name="color">rgb(33, 94, 159)</xsl:attribute>
@@ -990,8 +1031,7 @@
990
1031
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
991
1032
 
992
1033
 
993
- <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
994
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1034
+ <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
995
1035
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
996
1036
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
997
1037
  <xsl:attribute name="line-height">113%</xsl:attribute>
@@ -1002,6 +1042,7 @@
1002
1042
 
1003
1043
 
1004
1044
 
1045
+
1005
1046
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
1006
1047
 
1007
1048
  </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
@@ -1048,12 +1089,14 @@
1048
1089
 
1049
1090
 
1050
1091
 
1092
+
1051
1093
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1052
1094
 
1053
1095
  <xsl:attribute name="margin-left">12.5mm</xsl:attribute>
1054
1096
  <xsl:attribute name="margin-right">12.5mm</xsl:attribute>
1055
1097
 
1056
1098
 
1099
+
1057
1100
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1058
1101
 
1059
1102
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1074,6 +1117,9 @@
1074
1117
 
1075
1118
 
1076
1119
 
1120
+
1121
+
1122
+
1077
1123
 
1078
1124
  </xsl:attribute-set><xsl:attribute-set name="example-p-style">
1079
1125
 
@@ -1089,6 +1135,8 @@
1089
1135
 
1090
1136
 
1091
1137
 
1138
+
1139
+
1092
1140
  </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
1093
1141
 
1094
1142
  <xsl:attribute name="padding-right">10mm</xsl:attribute>
@@ -1108,6 +1156,8 @@
1108
1156
 
1109
1157
 
1110
1158
 
1159
+
1160
+
1111
1161
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1112
1162
 
1113
1163
 
@@ -1120,7 +1170,8 @@
1120
1170
 
1121
1171
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1122
1172
 
1123
-
1173
+
1174
+
1124
1175
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1125
1176
 
1126
1177
  <xsl:attribute name="color">rgb(33, 94, 159)</xsl:attribute>
@@ -1128,6 +1179,7 @@
1128
1179
 
1129
1180
 
1130
1181
 
1182
+
1131
1183
  </xsl:attribute-set><xsl:attribute-set name="note-style">
1132
1184
 
1133
1185
  <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -1147,11 +1199,12 @@
1147
1199
 
1148
1200
 
1149
1201
 
1202
+ </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">
1203
+
1204
+ <xsl:attribute name="padding-right">4mm</xsl:attribute>
1150
1205
 
1151
1206
 
1152
- </xsl:attribute-set><xsl:attribute-set name="note-name-style">
1153
1207
 
1154
- <xsl:attribute name="padding-right">4mm</xsl:attribute>
1155
1208
 
1156
1209
 
1157
1210
 
@@ -1160,7 +1213,6 @@
1160
1213
 
1161
1214
 
1162
1215
 
1163
-
1164
1216
 
1165
1217
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1166
1218
 
@@ -1188,6 +1240,8 @@
1188
1240
 
1189
1241
 
1190
1242
 
1243
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1244
+
1191
1245
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1192
1246
 
1193
1247
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1221,6 +1275,7 @@
1221
1275
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1222
1276
 
1223
1277
 
1278
+
1224
1279
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1225
1280
 
1226
1281
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
@@ -1247,6 +1302,7 @@
1247
1302
 
1248
1303
 
1249
1304
 
1305
+
1250
1306
  </xsl:attribute-set><xsl:attribute-set name="formula-style">
1251
1307
 
1252
1308
  </xsl:attribute-set><xsl:attribute-set name="image-style">
@@ -1270,8 +1326,8 @@
1270
1326
 
1271
1327
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
1272
1328
 
1273
- <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
1274
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1329
+ <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
1330
+
1275
1331
 
1276
1332
 
1277
1333
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
@@ -1279,6 +1335,8 @@
1279
1335
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1280
1336
  <xsl:attribute name="text-align">center</xsl:attribute>
1281
1337
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1338
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1339
+
1282
1340
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
1283
1341
 
1284
1342
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -1291,7 +1349,43 @@
1291
1349
  <xsl:attribute name="space-after">6pt</xsl:attribute>
1292
1350
 
1293
1351
 
1294
- </xsl:attribute-set><xsl:template match="text()">
1352
+ </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
1353
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1354
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1355
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1356
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1357
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1358
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1359
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1360
+
1361
+ <!-- Normative references -->
1362
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1363
+ <!-- Terms and definitions -->
1364
+ <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"/>
1365
+ <!-- Another main sections -->
1366
+ <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"/>
1367
+ <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1368
+ <!-- Bibliography -->
1369
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1370
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1371
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1372
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1373
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1374
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1375
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1376
+ </xsl:template><xsl:template name="processMainSectionsDefault">
1377
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1378
+
1379
+ <!-- Normative references -->
1380
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
1381
+ <!-- Terms and definitions -->
1382
+ <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']]"/>
1383
+ <!-- Another main sections -->
1384
+ <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'])]"/>
1385
+ <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1386
+ <!-- Bibliography -->
1387
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1388
+ </xsl:template><xsl:template match="text()">
1295
1389
  <xsl:value-of select="."/>
1296
1390
  </xsl:template><xsl:template match="*[local-name()='br']">
1297
1391
  <xsl:value-of select="$linebreak"/>
@@ -1308,6 +1402,10 @@
1308
1402
 
1309
1403
 
1310
1404
 
1405
+
1406
+
1407
+ <!-- $namespace = 'iso' or -->
1408
+
1311
1409
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1312
1410
 
1313
1411
 
@@ -1341,6 +1439,7 @@
1341
1439
  <xsl:with-param name="table" select="$simple-table"/>
1342
1440
  </xsl:call-template>
1343
1441
  </xsl:variable>
1442
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1344
1443
 
1345
1444
  <!-- <xsl:variable name="colwidths2">
1346
1445
  <xsl:call-template name="calculate-column-widths">
@@ -1362,23 +1461,49 @@
1362
1461
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1363
1462
 
1364
1463
 
1464
+
1465
+
1466
+
1365
1467
 
1366
1468
 
1469
+
1367
1470
 
1368
1471
 
1369
1472
 
1370
1473
 
1371
- <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">
1372
-
1373
-
1474
+
1475
+
1476
+
1477
+ <xsl:variable name="table_attributes">
1478
+ <attribute name="table-layout">fixed</attribute>
1479
+ <attribute name="width">100%</attribute>
1480
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1481
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1374
1482
 
1375
1483
 
1376
1484
 
1377
1485
 
1486
+
1487
+
1488
+
1378
1489
 
1490
+
1379
1491
 
1492
+ </xsl:variable>
1493
+
1494
+
1495
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1380
1496
 
1497
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1498
+ <xsl:attribute name="{@name}">
1499
+ <xsl:value-of select="."/>
1500
+ </xsl:attribute>
1501
+ </xsl:for-each>
1381
1502
 
1503
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1504
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1505
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1506
+ </xsl:if>
1382
1507
 
1383
1508
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1384
1509
  <xsl:choose>
@@ -1402,6 +1527,33 @@
1402
1527
 
1403
1528
  </fo:table>
1404
1529
 
1530
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1531
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1532
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1533
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1534
+ </xsl:call-template>
1535
+ </xsl:for-each>
1536
+
1537
+ <!-- insert footer as table -->
1538
+ <!-- <fo:table>
1539
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1540
+ <xsl:attribute name="{@name}">
1541
+ <xsl:value-of select="."/>
1542
+ </xsl:attribute>
1543
+ </xsl:for-each>
1544
+
1545
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1546
+ <xsl:choose>
1547
+ <xsl:when test=". = 1 or . = 0">
1548
+ <fo:table-column column-width="proportional-column-width(2)"/>
1549
+ </xsl:when>
1550
+ <xsl:otherwise>
1551
+ <fo:table-column column-width="proportional-column-width({.})"/>
1552
+ </xsl:otherwise>
1553
+ </xsl:choose>
1554
+ </xsl:for-each>
1555
+ </fo:table>-->
1556
+
1405
1557
 
1406
1558
 
1407
1559
 
@@ -1410,8 +1562,9 @@
1410
1562
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1411
1563
  <xsl:if test="normalize-space() != ''">
1412
1564
  <fo:block xsl:use-attribute-sets="table-name-style">
1413
- <xsl:apply-templates/>
1414
- </fo:block>
1565
+
1566
+ <xsl:apply-templates/>
1567
+ </fo:block>
1415
1568
  </xsl:if>
1416
1569
  </xsl:template><xsl:template name="calculate-columns-numbers">
1417
1570
  <xsl:param name="table-row"/>
@@ -1465,6 +1618,13 @@
1465
1618
  <xsl:for-each select="xalan:nodeset($table)//tr">
1466
1619
  <xsl:variable name="td_text">
1467
1620
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1621
+
1622
+ <!-- <xsl:if test="$namespace = 'bipm'">
1623
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1624
+ <word><xsl:value-of select="normalize-space(.)"/></word>
1625
+ </xsl:for-each>
1626
+ </xsl:if> -->
1627
+
1468
1628
  </xsl:variable>
1469
1629
  <xsl:variable name="words">
1470
1630
  <xsl:variable name="string_with_added_zerospaces">
@@ -1524,13 +1684,31 @@
1524
1684
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1525
1685
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1526
1686
  <xsl:value-of select="@target"/>
1687
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1688
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
1689
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1527
1690
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1528
1691
  <xsl:param name="cols-count"/>
1529
1692
  <!-- font-weight="bold" -->
1530
- <fo:table-header>
1693
+ <fo:table-header>
1531
1694
 
1532
1695
  <xsl:apply-templates/>
1533
1696
  </fo:table-header>
1697
+ </xsl:template><xsl:template name="table-header-title">
1698
+ <xsl:param name="cols-count"/>
1699
+ <!-- row for title -->
1700
+ <fo:table-row>
1701
+ <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">
1702
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1703
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1704
+ <xsl:call-template name="fn_name_display"/>
1705
+ </xsl:for-each>
1706
+ <fo:block text-align="right" font-style="italic">
1707
+ <xsl:text> </xsl:text>
1708
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1709
+ </fo:block>
1710
+ </fo:table-cell>
1711
+ </fo:table-row>
1534
1712
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
1535
1713
  <fo:table-body>
1536
1714
  <xsl:apply-templates/>
@@ -1538,6 +1716,13 @@
1538
1716
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1539
1717
  <xsl:apply-templates/>
1540
1718
  </xsl:template><xsl:template name="insertTableFooter">
1719
+ <xsl:param name="cols-count"/>
1720
+ <xsl:if test="../*[local-name()='tfoot']">
1721
+ <fo:table-footer>
1722
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1723
+ </fo:table-footer>
1724
+ </xsl:if>
1725
+ </xsl:template><xsl:template name="insertTableFooter2">
1541
1726
  <xsl:param name="cols-count"/>
1542
1727
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1543
1728
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -1559,11 +1744,15 @@
1559
1744
  <!-- fn will be processed inside 'note' processing -->
1560
1745
 
1561
1746
 
1562
- <!-- except gb -->
1747
+
1748
+ <!-- except gb and bipm -->
1563
1749
 
1564
1750
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1565
1751
 
1566
1752
 
1753
+
1754
+
1755
+
1567
1756
  <!-- horizontal row separator -->
1568
1757
 
1569
1758
 
@@ -1577,6 +1766,84 @@
1577
1766
  </fo:table-footer>
1578
1767
 
1579
1768
  </xsl:if>
1769
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1770
+ <xsl:param name="table_attributes"/>
1771
+ <xsl:param name="colwidths"/>
1772
+
1773
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1774
+
1775
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1776
+
1777
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1778
+
1779
+ <fo:table keep-with-previous="always">
1780
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1781
+ <xsl:choose>
1782
+ <xsl:when test="@name = 'border-top'">
1783
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
1784
+ </xsl:when>
1785
+ <xsl:when test="@name = 'border'">
1786
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1787
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
1788
+ </xsl:when>
1789
+ <xsl:otherwise>
1790
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1791
+ </xsl:otherwise>
1792
+ </xsl:choose>
1793
+ </xsl:for-each>
1794
+
1795
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1796
+ <xsl:choose>
1797
+ <xsl:when test=". = 1 or . = 0">
1798
+ <fo:table-column column-width="proportional-column-width(2)"/>
1799
+ </xsl:when>
1800
+ <xsl:otherwise>
1801
+ <fo:table-column column-width="proportional-column-width({.})"/>
1802
+ </xsl:otherwise>
1803
+ </xsl:choose>
1804
+ </xsl:for-each>
1805
+
1806
+ <fo:table-body>
1807
+ <fo:table-row>
1808
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
1809
+
1810
+
1811
+
1812
+ <!-- fn will be processed inside 'note' processing -->
1813
+
1814
+
1815
+
1816
+ <!-- except gb and bipm -->
1817
+
1818
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1819
+
1820
+
1821
+ <!-- <xsl:if test="$namespace = 'bipm'">
1822
+ <xsl:choose>
1823
+ <xsl:when test="ancestor::*[local-name()='preface']">
1824
+ show Note under table in preface (ex. abstract) sections
1825
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1826
+ </xsl:when>
1827
+ <xsl:otherwise>
1828
+ empty, because notes show at page side in main sections
1829
+ <fo:block/>
1830
+ </xsl:otherwise>
1831
+ </xsl:choose>
1832
+ </xsl:if> -->
1833
+
1834
+
1835
+ <!-- horizontal row separator -->
1836
+
1837
+
1838
+ <!-- fn processing -->
1839
+ <xsl:call-template name="fn_display"/>
1840
+
1841
+ </fo:table-cell>
1842
+ </fo:table-row>
1843
+ </fo:table-body>
1844
+
1845
+ </fo:table>
1846
+ </xsl:if>
1580
1847
  </xsl:template><xsl:template match="*[local-name()='tbody']">
1581
1848
 
1582
1849
  <xsl:variable name="cols-count">
@@ -1594,6 +1861,8 @@
1594
1861
  </xsl:choose>
1595
1862
  </xsl:variable>
1596
1863
 
1864
+
1865
+
1597
1866
  <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
1598
1867
  <xsl:with-param name="cols-count" select="$cols-count"/>
1599
1868
  </xsl:apply-templates>
@@ -1603,6 +1872,8 @@
1603
1872
  </xsl:call-template>
1604
1873
 
1605
1874
  <fo:table-body>
1875
+
1876
+
1606
1877
  <xsl:apply-templates/>
1607
1878
  <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
1608
1879
 
@@ -1626,10 +1897,23 @@
1626
1897
  </xsl:if>
1627
1898
 
1628
1899
 
1900
+
1901
+
1629
1902
  <xsl:apply-templates/>
1630
1903
  </fo:table-row>
1631
1904
  </xsl:template><xsl:template match="*[local-name()='th']">
1632
1905
  <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
1906
+ <xsl:attribute name="text-align">
1907
+ <xsl:choose>
1908
+ <xsl:when test="@align">
1909
+ <xsl:value-of select="@align"/>
1910
+ </xsl:when>
1911
+ <xsl:otherwise>center</xsl:otherwise>
1912
+ </xsl:choose>
1913
+ </xsl:attribute>
1914
+
1915
+
1916
+
1633
1917
 
1634
1918
 
1635
1919
 
@@ -1648,16 +1932,38 @@
1648
1932
  <xsl:value-of select="@rowspan"/>
1649
1933
  </xsl:attribute>
1650
1934
  </xsl:if>
1935
+ <xsl:call-template name="display-align"/>
1651
1936
  <fo:block>
1652
1937
  <xsl:apply-templates/>
1653
1938
  </fo:block>
1654
1939
  </fo:table-cell>
1940
+ </xsl:template><xsl:template name="display-align">
1941
+ <xsl:if test="@valign">
1942
+ <xsl:attribute name="display-align">
1943
+ <xsl:choose>
1944
+ <xsl:when test="@valign = 'top'">before</xsl:when>
1945
+ <xsl:when test="@valign = 'middle'">center</xsl:when>
1946
+ <xsl:when test="@valign = 'bottom'">after</xsl:when>
1947
+ <xsl:otherwise>before</xsl:otherwise>
1948
+ </xsl:choose>
1949
+ </xsl:attribute>
1950
+ </xsl:if>
1655
1951
  </xsl:template><xsl:template match="*[local-name()='td']">
1656
1952
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
1953
+ <xsl:attribute name="text-align">
1954
+ <xsl:choose>
1955
+ <xsl:when test="@align">
1956
+ <xsl:value-of select="@align"/>
1957
+ </xsl:when>
1958
+ <xsl:otherwise>left</xsl:otherwise>
1959
+ </xsl:choose>
1960
+ </xsl:attribute>
1961
+
1962
+
1963
+
1657
1964
 
1658
1965
 
1659
1966
 
1660
-
1661
1967
 
1662
1968
 
1663
1969
 
@@ -1673,8 +1979,8 @@
1673
1979
  <xsl:value-of select="@rowspan"/>
1674
1980
  </xsl:attribute>
1675
1981
  </xsl:if>
1676
- <fo:block>
1677
-
1982
+ <xsl:call-template name="display-align"/>
1983
+ <fo:block>
1678
1984
  <xsl:apply-templates/>
1679
1985
  </fo:block>
1680
1986
  </fo:table-cell>
@@ -1686,14 +1992,17 @@
1686
1992
 
1687
1993
 
1688
1994
 
1995
+
1996
+
1689
1997
  <fo:inline padding-right="2mm">
1690
1998
 
1691
1999
 
1692
2000
 
1693
-
2001
+
1694
2002
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1695
2003
 
1696
2004
  </fo:inline>
2005
+
1697
2006
  <xsl:apply-templates mode="process"/>
1698
2007
  </fo:block>
1699
2008
 
@@ -1717,6 +2026,7 @@
1717
2026
 
1718
2027
 
1719
2028
 
2029
+
1720
2030
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
1721
2031
 
1722
2032
 
@@ -1724,12 +2034,15 @@
1724
2034
 
1725
2035
 
1726
2036
 
2037
+
1727
2038
  <xsl:value-of select="@reference"/>
1728
2039
 
2040
+
1729
2041
  </fo:inline>
1730
2042
  <fo:inline>
1731
2043
 
1732
- <xsl:apply-templates/>
2044
+ <!-- <xsl:apply-templates /> -->
2045
+ <xsl:copy-of select="./node()"/>
1733
2046
  </fo:inline>
1734
2047
  </fo:block>
1735
2048
  </xsl:if>
@@ -1766,7 +2079,20 @@
1766
2079
  <xsl:variable name="following_dl_colwidths">
1767
2080
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
1768
2081
  <xsl:variable name="html-table">
1769
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2082
+ <xsl:variable name="doc_ns">
2083
+
2084
+ </xsl:variable>
2085
+ <xsl:variable name="ns">
2086
+ <xsl:choose>
2087
+ <xsl:when test="normalize-space($doc_ns) != ''">
2088
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2089
+ </xsl:when>
2090
+ <xsl:otherwise>
2091
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2092
+ </xsl:otherwise>
2093
+ </xsl:choose>
2094
+ </xsl:variable>
2095
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
1770
2096
  <xsl:element name="{$ns}:table">
1771
2097
  <xsl:for-each select="*[local-name() = 'dl'][1]">
1772
2098
  <tbody>
@@ -1831,7 +2157,8 @@
1831
2157
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
1832
2158
  </xsl:if>
1833
2159
 
1834
- <xsl:apply-templates/>
2160
+ <!-- <xsl:apply-templates /> -->
2161
+ <xsl:copy-of select="./node()"/>
1835
2162
  </fo:block>
1836
2163
  </fo:table-cell>
1837
2164
  </fo:table-row>
@@ -1849,9 +2176,13 @@
1849
2176
 
1850
2177
 
1851
2178
 
2179
+
2180
+
1852
2181
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
1853
2182
 
2183
+
1854
2184
  <xsl:value-of select="@reference"/>
2185
+
1855
2186
  </fo:basic-link>
1856
2187
  </fo:inline>
1857
2188
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -1859,102 +2190,142 @@
1859
2190
  <xsl:apply-templates/>
1860
2191
  </fo:inline>
1861
2192
  </xsl:template><xsl:template match="*[local-name()='dl']">
1862
- <xsl:variable name="parent" select="local-name(..)"/>
1863
-
1864
- <xsl:variable name="key_iso">
1865
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
1866
- </xsl:variable>
1867
-
1868
- <xsl:choose>
1869
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
1870
-
1871
-
1872
- </xsl:when>
1873
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
1874
- <fo:block margin-bottom="12pt" text-align="left">
1875
-
1876
-
1877
-
1878
-
1879
- <xsl:variable name="title-where">
1880
- <xsl:call-template name="getTitle">
1881
- <xsl:with-param name="name" select="'title-where'"/>
1882
- </xsl:call-template>
1883
- </xsl:variable>
1884
- <xsl:value-of select="$title-where"/>
1885
- </fo:block>
1886
- </xsl:when>
1887
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
1888
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
1889
-
1890
-
1891
-
1892
- <xsl:variable name="title-key">
1893
- <xsl:call-template name="getTitle">
1894
- <xsl:with-param name="name" select="'title-key'"/>
1895
- </xsl:call-template>
1896
- </xsl:variable>
1897
- <xsl:value-of select="$title-key"/>
1898
- </fo:block>
1899
- </xsl:when>
1900
- </xsl:choose>
1901
-
1902
- <!-- a few components -->
1903
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
1904
- <fo:block>
2193
+ <fo:block-container margin-left="0mm">
2194
+ <xsl:if test="parent::*[local-name() = 'note']">
2195
+ <xsl:attribute name="margin-left">
2196
+ <xsl:choose>
2197
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2198
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2199
+ </xsl:choose>
2200
+ </xsl:attribute>
1905
2201
 
2202
+ </xsl:if>
2203
+ <fo:block-container margin-left="0mm">
2204
+
2205
+ <xsl:variable name="parent" select="local-name(..)"/>
1906
2206
 
2207
+ <xsl:variable name="key_iso">
2208
+ <!-- and (not(../@class) or ../@class !='pseudocode') -->
2209
+ </xsl:variable>
1907
2210
 
2211
+ <xsl:choose>
2212
+ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2213
+
2214
+
2215
+ <fo:block margin-bottom="12pt" text-align="left">
2216
+
2217
+ <xsl:variable name="title-where">
2218
+ <xsl:call-template name="getTitle">
2219
+ <xsl:with-param name="name" select="'title-where'"/>
2220
+ </xsl:call-template>
2221
+ </xsl:variable>
2222
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2223
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
2224
+ <xsl:text/>
2225
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2226
+ </fo:block>
2227
+
2228
+ </xsl:when>
2229
+ <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2230
+ <fo:block margin-bottom="12pt" text-align="left">
2231
+
2232
+
2233
+
2234
+
2235
+ <xsl:variable name="title-where">
2236
+ <xsl:call-template name="getTitle">
2237
+ <xsl:with-param name="name" select="'title-where'"/>
2238
+ </xsl:call-template>
2239
+ </xsl:variable>
2240
+ <xsl:value-of select="$title-where"/>
2241
+ </fo:block>
2242
+ </xsl:when>
2243
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2244
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2245
+
2246
+
2247
+
2248
+ <xsl:variable name="title-key">
2249
+ <xsl:call-template name="getTitle">
2250
+ <xsl:with-param name="name" select="'title-key'"/>
2251
+ </xsl:call-template>
2252
+ </xsl:variable>
2253
+ <xsl:value-of select="$title-key"/>
2254
+ </fo:block>
2255
+ </xsl:when>
2256
+ </xsl:choose>
1908
2257
 
1909
- <fo:block>
1910
-
1911
-
1912
-
1913
-
1914
- <fo:table width="95%" table-layout="fixed">
2258
+ <!-- a few components -->
2259
+ <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2260
+ <fo:block>
1915
2261
 
1916
- <xsl:choose>
1917
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
1918
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
1919
- </xsl:when>
1920
- <xsl:when test="normalize-space($key_iso) = 'true'">
1921
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2262
+
2263
+
2264
+
2265
+ <fo:block>
2266
+
2267
+
2268
+
2269
+
2270
+ <fo:table width="95%" table-layout="fixed">
1922
2271
 
1923
- </xsl:when>
1924
- </xsl:choose>
1925
- <!-- create virtual html table for dl/[dt and dd] -->
1926
- <xsl:variable name="html-table">
1927
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
1928
- <xsl:element name="{$ns}:table">
1929
- <tbody>
1930
- <xsl:apply-templates mode="dl"/>
1931
- </tbody>
1932
- </xsl:element>
1933
- </xsl:variable>
1934
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
1935
- <xsl:variable name="colwidths">
1936
- <xsl:call-template name="calculate-column-widths">
1937
- <xsl:with-param name="cols-count" select="2"/>
1938
- <xsl:with-param name="table" select="$html-table"/>
1939
- </xsl:call-template>
1940
- </xsl:variable>
1941
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
1942
- <xsl:variable name="maxlength_dt">
1943
- <xsl:call-template name="getMaxLength_dt"/>
1944
- </xsl:variable>
1945
- <xsl:call-template name="setColumnWidth_dl">
1946
- <xsl:with-param name="colwidths" select="$colwidths"/>
1947
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
1948
- </xsl:call-template>
1949
- <fo:table-body>
1950
- <xsl:apply-templates>
1951
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
1952
- </xsl:apply-templates>
1953
- </fo:table-body>
1954
- </fo:table>
1955
- </fo:block>
1956
- </fo:block>
1957
- </xsl:if>
2272
+ <xsl:choose>
2273
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2274
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2275
+ </xsl:when>
2276
+ <xsl:when test="normalize-space($key_iso) = 'true'">
2277
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2278
+
2279
+ </xsl:when>
2280
+ </xsl:choose>
2281
+ <!-- create virtual html table for dl/[dt and dd] -->
2282
+ <xsl:variable name="html-table">
2283
+ <xsl:variable name="doc_ns">
2284
+
2285
+ </xsl:variable>
2286
+ <xsl:variable name="ns">
2287
+ <xsl:choose>
2288
+ <xsl:when test="normalize-space($doc_ns) != ''">
2289
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2290
+ </xsl:when>
2291
+ <xsl:otherwise>
2292
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2293
+ </xsl:otherwise>
2294
+ </xsl:choose>
2295
+ </xsl:variable>
2296
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2297
+ <xsl:element name="{$ns}:table">
2298
+ <tbody>
2299
+ <xsl:apply-templates mode="dl"/>
2300
+ </tbody>
2301
+ </xsl:element>
2302
+ </xsl:variable>
2303
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
2304
+ <xsl:variable name="colwidths">
2305
+ <xsl:call-template name="calculate-column-widths">
2306
+ <xsl:with-param name="cols-count" select="2"/>
2307
+ <xsl:with-param name="table" select="$html-table"/>
2308
+ </xsl:call-template>
2309
+ </xsl:variable>
2310
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2311
+ <xsl:variable name="maxlength_dt">
2312
+ <xsl:call-template name="getMaxLength_dt"/>
2313
+ </xsl:variable>
2314
+ <xsl:call-template name="setColumnWidth_dl">
2315
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2316
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2317
+ </xsl:call-template>
2318
+ <fo:table-body>
2319
+ <xsl:apply-templates>
2320
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2321
+ </xsl:apply-templates>
2322
+ </fo:table-body>
2323
+ </fo:table>
2324
+ </fo:block>
2325
+ </fo:block>
2326
+ </xsl:if>
2327
+ </fo:block-container>
2328
+ </fo:block-container>
1958
2329
  </xsl:template><xsl:template name="setColumnWidth_dl">
1959
2330
  <xsl:param name="colwidths"/>
1960
2331
  <xsl:param name="maxlength_dt"/>
@@ -2042,6 +2413,8 @@
2042
2413
  <td>
2043
2414
 
2044
2415
 
2416
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2417
+
2045
2418
  </td>
2046
2419
  </tr>
2047
2420
 
@@ -2049,6 +2422,7 @@
2049
2422
  <xsl:param name="key_iso"/>
2050
2423
 
2051
2424
  <fo:table-row>
2425
+
2052
2426
  <fo:table-cell>
2053
2427
 
2054
2428
  <fo:block margin-top="6pt">
@@ -2063,6 +2437,7 @@
2063
2437
 
2064
2438
 
2065
2439
 
2440
+
2066
2441
  <xsl:apply-templates/>
2067
2442
  <!-- <xsl:if test="$namespace = 'gb'">
2068
2443
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2074,12 +2449,36 @@
2074
2449
  <fo:table-cell>
2075
2450
  <fo:block>
2076
2451
 
2452
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2453
+ <xsl:if test="local-name(*[1]) != 'stem'">
2454
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2455
+ </xsl:if>
2456
+ </xsl:if> -->
2077
2457
 
2458
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2078
2459
 
2079
2460
  </fo:block>
2080
2461
  </fo:table-cell>
2081
2462
  </fo:table-row>
2082
-
2463
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2464
+ <xsl:if test="local-name(*[1]) = 'stem'">
2465
+ <fo:table-row>
2466
+ <fo:table-cell>
2467
+ <fo:block margin-top="6pt">
2468
+ <xsl:if test="normalize-space($key_iso) = 'true'">
2469
+ <xsl:attribute name="margin-top">0</xsl:attribute>
2470
+ </xsl:if>
2471
+ <xsl:text>&#xA0;</xsl:text>
2472
+ </fo:block>
2473
+ </fo:table-cell>
2474
+ <fo:table-cell>
2475
+ <fo:block>
2476
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2477
+ </fo:block>
2478
+ </fo:table-cell>
2479
+ </fo:table-row>
2480
+ </xsl:if>
2481
+ </xsl:if> -->
2083
2482
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2084
2483
  <xsl:apply-templates/>
2085
2484
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
@@ -2104,6 +2503,31 @@
2104
2503
  </fo:inline>
2105
2504
  </xsl:template><xsl:template match="*[local-name()='tt']">
2106
2505
  <fo:inline xsl:use-attribute-sets="tt-style">
2506
+ <xsl:variable name="_font-size">
2507
+ 10
2508
+
2509
+
2510
+
2511
+
2512
+
2513
+
2514
+
2515
+
2516
+
2517
+
2518
+
2519
+
2520
+
2521
+ </xsl:variable>
2522
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
2523
+ <xsl:if test="$font-size != ''">
2524
+ <xsl:attribute name="font-size">
2525
+ <xsl:choose>
2526
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
2527
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
2528
+ </xsl:choose>
2529
+ </xsl:attribute>
2530
+ </xsl:if>
2107
2531
  <xsl:apply-templates/>
2108
2532
  </fo:inline>
2109
2533
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -2429,11 +2853,24 @@
2429
2853
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2430
2854
  <xsl:value-of select="substring($str, 2)"/>
2431
2855
  </xsl:template><xsl:template match="mathml:math">
2432
- <fo:inline font-family="STIX2Math">
2433
- <fo:instream-foreign-object fox:alt-text="Math">
2434
- <xsl:copy-of select="."/>
2435
- </fo:instream-foreign-object>
2856
+ <fo:inline font-family="STIX Two Math"> <!-- -->
2857
+ <xsl:variable name="mathml">
2858
+ <xsl:apply-templates select="." mode="mathml"/>
2859
+ </xsl:variable>
2860
+ <fo:instream-foreign-object fox:alt-text="Math">
2861
+ <!-- <xsl:copy-of select="."/> -->
2862
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
2863
+ </fo:instream-foreign-object>
2436
2864
  </fo:inline>
2865
+ </xsl:template><xsl:template match="@*|node()" mode="mathml">
2866
+ <xsl:copy>
2867
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
2868
+ </xsl:copy>
2869
+ </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
2870
+ <xsl:copy>
2871
+ <!-- replace start and end spaces to non-break space -->
2872
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
2873
+ </xsl:copy>
2437
2874
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2438
2875
  <xsl:variable name="target">
2439
2876
  <xsl:choose>
@@ -2510,13 +2947,26 @@
2510
2947
  <xsl:apply-templates/>
2511
2948
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
2512
2949
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2513
-
2950
+
2514
2951
  <xsl:apply-templates/>
2515
2952
  </fo:basic-link>
2516
2953
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2517
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2518
- <xsl:apply-templates/>
2519
- </fo:block>
2954
+ <fo:block-container margin-left="0mm">
2955
+ <xsl:if test="parent::*[local-name() = 'note']">
2956
+ <xsl:attribute name="margin-left">
2957
+ <xsl:choose>
2958
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2959
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2960
+ </xsl:choose>
2961
+ </xsl:attribute>
2962
+
2963
+ </xsl:if>
2964
+ <fo:block-container margin-left="0mm">
2965
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2966
+ <xsl:apply-templates/>
2967
+ </fo:block>
2968
+ </fo:block-container>
2969
+ </fo:block-container>
2520
2970
  </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2521
2971
  <fo:inline>
2522
2972
  <xsl:apply-templates/>
@@ -2580,7 +3030,9 @@
2580
3030
  </xsl:choose>
2581
3031
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2582
3032
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2583
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3033
+ <fo:inline xsl:use-attribute-sets="termnote-name-style">
3034
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3035
+ </fo:inline>
2584
3036
  <xsl:apply-templates/>
2585
3037
  </fo:block>
2586
3038
  </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">
@@ -2675,15 +3127,109 @@
2675
3127
 
2676
3128
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2677
3129
  </fo:block>
2678
- </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">
3130
+ </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">
2679
3131
  <xsl:apply-templates mode="contents"/>
2680
3132
  <xsl:text> </xsl:text>
2681
- </xsl:template><xsl:template match="text()" mode="contents">
3133
+ </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">
3134
+ <xsl:apply-templates mode="bookmarks"/>
3135
+ <xsl:text> </xsl:text>
3136
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
3137
+ <xsl:value-of select="."/>
3138
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
2682
3139
  <xsl:value-of select="."/>
2683
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3140
+ </xsl:template><xsl:template match="node()" mode="contents">
3141
+ <xsl:apply-templates mode="contents"/>
3142
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
3143
+ <xsl:apply-templates mode="bookmarks"/>
3144
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3145
+ <xsl:apply-templates select="."/>
3146
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3147
+ <xsl:apply-templates mode="bookmarks"/>
3148
+ </xsl:template><xsl:template name="addBookmarks">
3149
+ <xsl:param name="contents"/>
3150
+ <xsl:if test="xalan:nodeset($contents)//item">
3151
+ <fo:bookmark-tree>
3152
+ <xsl:choose>
3153
+ <xsl:when test="xalan:nodeset($contents)/doc">
3154
+ <xsl:choose>
3155
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3156
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3157
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3158
+ <fo:bookmark-title>
3159
+ <xsl:variable name="bookmark-title_">
3160
+ <xsl:call-template name="getLangVersion">
3161
+ <xsl:with-param name="lang" select="@lang"/>
3162
+ </xsl:call-template>
3163
+ </xsl:variable>
3164
+ <xsl:choose>
3165
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3166
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3167
+ </xsl:when>
3168
+ <xsl:otherwise>
3169
+ <xsl:choose>
3170
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3171
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3172
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3173
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3174
+ </xsl:choose>
3175
+ </xsl:otherwise>
3176
+ </xsl:choose>
3177
+ </fo:bookmark-title>
3178
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3179
+ </fo:bookmark>
3180
+
3181
+ </xsl:for-each>
3182
+ </xsl:when>
3183
+ <xsl:otherwise>
3184
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3185
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3186
+ </xsl:for-each>
3187
+ </xsl:otherwise>
3188
+ </xsl:choose>
3189
+ </xsl:when>
3190
+ <xsl:otherwise>
3191
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
3192
+ </xsl:otherwise>
3193
+ </xsl:choose>
3194
+
3195
+
3196
+
3197
+
3198
+
3199
+
3200
+
3201
+
3202
+ </fo:bookmark-tree>
3203
+ </xsl:if>
3204
+ </xsl:template><xsl:template name="getLangVersion">
3205
+ <xsl:param name="lang"/>
3206
+ <xsl:choose>
3207
+ <xsl:when test="$lang = 'en'">
3208
+
3209
+
3210
+ </xsl:when>
3211
+ <xsl:when test="$lang = 'fr'">
3212
+
3213
+
3214
+ </xsl:when>
3215
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3216
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3217
+ </xsl:choose>
3218
+ </xsl:template><xsl:template match="item" mode="bookmark">
3219
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
3220
+ <fo:bookmark-title>
3221
+ <xsl:if test="@section != ''">
3222
+ <xsl:value-of select="@section"/>
3223
+ <xsl:text> </xsl:text>
3224
+ </xsl:if>
3225
+ <xsl:value-of select="normalize-space(title)"/>
3226
+ </fo:bookmark-title>
3227
+ <xsl:apply-templates mode="bookmark"/>
3228
+ </fo:bookmark>
3229
+ </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">
2684
3230
  <xsl:if test="normalize-space() != ''">
2685
3231
  <fo:block xsl:use-attribute-sets="figure-name-style">
2686
-
3232
+
2687
3233
  <xsl:apply-templates/>
2688
3234
  </fo:block>
2689
3235
  </xsl:if>
@@ -2738,7 +3284,7 @@
2738
3284
  <xsl:apply-templates/>
2739
3285
  </xsl:otherwise>
2740
3286
  </xsl:choose>
2741
- </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">
3287
+ </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">
2742
3288
  <xsl:text> </xsl:text>
2743
3289
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
2744
3290
  <xsl:copy>
@@ -2747,21 +3293,61 @@
2747
3293
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
2748
3294
  <xsl:text> </xsl:text>
2749
3295
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
2750
- <fo:block xsl:use-attribute-sets="sourcecode-style">
2751
- <xsl:apply-templates/>
2752
- </fo:block>
2753
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2754
- </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
3296
+
3297
+ <fo:block-container margin-left="0mm">
3298
+ <xsl:if test="parent::*[local-name() = 'note']">
3299
+ <xsl:attribute name="margin-left">
3300
+ <xsl:choose>
3301
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3302
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3303
+ </xsl:choose>
3304
+ </xsl:attribute>
3305
+
3306
+ </xsl:if>
3307
+ <fo:block-container margin-left="0mm">
3308
+
3309
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
3310
+ <xsl:variable name="_font-size">
3311
+ 10
3312
+
3313
+
3314
+
3315
+
3316
+
3317
+
3318
+
3319
+
3320
+
3321
+
3322
+
3323
+
3324
+
3325
+ </xsl:variable>
3326
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3327
+ <xsl:if test="$font-size != ''">
3328
+ <xsl:attribute name="font-size">
3329
+ <xsl:choose>
3330
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3331
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3332
+ </xsl:choose>
3333
+ </xsl:attribute>
3334
+ </xsl:if>
3335
+ <xsl:apply-templates/>
3336
+ </fo:block>
3337
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3338
+
3339
+ </fo:block-container>
3340
+ </fo:block-container>
3341
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
2755
3342
  <xsl:variable name="text">
2756
3343
  <xsl:call-template name="add-zero-spaces-equal"/>
2757
3344
  </xsl:variable>
2758
- <xsl:call-template name="add-zero-spaces">
3345
+ <xsl:call-template name="add-zero-spaces-java">
2759
3346
  <xsl:with-param name="text" select="$text"/>
2760
3347
  </xsl:call-template>
2761
3348
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
2762
3349
  <xsl:if test="normalize-space() != ''">
2763
- <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2764
-
3350
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2765
3351
  <xsl:apply-templates/>
2766
3352
  </fo:block>
2767
3353
  </xsl:if>
@@ -2829,6 +3415,145 @@
2829
3415
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
2830
3416
  <xsl:apply-templates/>
2831
3417
  </fo:block>
3418
+ </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3419
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
3420
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3421
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3422
+ </xsl:if>
3423
+ <fo:block-container margin-left="0mm" margin-right="0mm">
3424
+ <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
3425
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3426
+ <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
3427
+ </xsl:if>
3428
+ <xsl:variable name="simple-table">
3429
+ <xsl:call-template name="getSimpleTable"/>
3430
+ </xsl:variable>
3431
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
3432
+ <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
3433
+ <!-- <fo:table-column column-width="35mm"/>
3434
+ <fo:table-column column-width="115mm"/> -->
3435
+ <fo:table-column column-width="30%"/>
3436
+ <fo:table-column column-width="70%"/>
3437
+ </xsl:if>
3438
+ <xsl:apply-templates mode="requirement"/>
3439
+ </fo:table>
3440
+ <!-- fn processing -->
3441
+ <xsl:if test=".//*[local-name() = 'fn']">
3442
+ <xsl:for-each select="*[local-name() = 'tbody']">
3443
+ <fo:block font-size="90%" border-bottom="1pt solid black">
3444
+ <xsl:call-template name="fn_display"/>
3445
+ </fo:block>
3446
+ </xsl:for-each>
3447
+ </xsl:if>
3448
+ </fo:block-container>
3449
+ </fo:block-container>
3450
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="requirement">
3451
+ <fo:table-header>
3452
+ <xsl:apply-templates mode="requirement"/>
3453
+ </fo:table-header>
3454
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="requirement">
3455
+ <fo:table-body>
3456
+ <xsl:apply-templates mode="requirement"/>
3457
+ </fo:table-body>
3458
+ </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
3459
+ <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
3460
+ <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
3461
+ <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
3462
+ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
3463
+ </xsl:if>
3464
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
3465
+ <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
3466
+ </xsl:if>
3467
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
3468
+ <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
3469
+ </xsl:if>
3470
+ <xsl:apply-templates mode="requirement"/>
3471
+ </fo:table-row>
3472
+ </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
3473
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3474
+ <xsl:attribute name="text-align">
3475
+ <xsl:choose>
3476
+ <xsl:when test="@align">
3477
+ <xsl:value-of select="@align"/>
3478
+ </xsl:when>
3479
+ <xsl:otherwise>left</xsl:otherwise>
3480
+ </xsl:choose>
3481
+ </xsl:attribute>
3482
+ <xsl:if test="@colspan">
3483
+ <xsl:attribute name="number-columns-spanned">
3484
+ <xsl:value-of select="@colspan"/>
3485
+ </xsl:attribute>
3486
+ </xsl:if>
3487
+ <xsl:if test="@rowspan">
3488
+ <xsl:attribute name="number-rows-spanned">
3489
+ <xsl:value-of select="@rowspan"/>
3490
+ </xsl:attribute>
3491
+ </xsl:if>
3492
+ <xsl:call-template name="display-align"/>
3493
+
3494
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3495
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3496
+ <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
3497
+ </xsl:if>
3498
+ <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
3499
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3500
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3501
+ </xsl:if> -->
3502
+
3503
+ <fo:block>
3504
+ <xsl:apply-templates/>
3505
+ </fo:block>
3506
+ </fo:table-cell>
3507
+ </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
3508
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3509
+ <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3510
+ <xsl:attribute name="padding">0mm</xsl:attribute>
3511
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
3512
+ </xsl:if>
3513
+ <xsl:attribute name="text-align">
3514
+ <xsl:choose>
3515
+ <xsl:when test="@align">
3516
+ <xsl:value-of select="@align"/>
3517
+ </xsl:when>
3518
+ <xsl:otherwise>left</xsl:otherwise>
3519
+ </xsl:choose>
3520
+ </xsl:attribute>
3521
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
3522
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3523
+ </xsl:if>
3524
+ <xsl:if test="@colspan">
3525
+ <xsl:attribute name="number-columns-spanned">
3526
+ <xsl:value-of select="@colspan"/>
3527
+ </xsl:attribute>
3528
+ </xsl:if>
3529
+ <xsl:if test="@rowspan">
3530
+ <xsl:attribute name="number-rows-spanned">
3531
+ <xsl:value-of select="@rowspan"/>
3532
+ </xsl:attribute>
3533
+ </xsl:if>
3534
+ <xsl:call-template name="display-align"/>
3535
+
3536
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3537
+ <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
3538
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3539
+ <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
3540
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3541
+ </xsl:if>
3542
+ </xsl:if> -->
3543
+ <!-- 2nd line and below -->
3544
+
3545
+ <fo:block>
3546
+ <xsl:apply-templates/>
3547
+ </fo:block>
3548
+ </fo:table-cell>
3549
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
3550
+ <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
3551
+ <xsl:apply-templates/>
3552
+ </fo:block>
3553
+ </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
3554
+ <fo:block> <!-- margin-bottom="10pt" -->
3555
+ <xsl:apply-templates/>
3556
+ </fo:block>
2832
3557
  </xsl:template><xsl:template match="*[local-name() = 'termexample']">
2833
3558
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
2834
3559
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -2848,12 +3573,13 @@
2848
3573
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2849
3574
 
2850
3575
  <xsl:variable name="element">
2851
- block
3576
+ block
2852
3577
 
3578
+ <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
2853
3579
  </xsl:variable>
2854
3580
 
2855
3581
  <xsl:choose>
2856
- <xsl:when test="normalize-space($element) = 'block'">
3582
+ <xsl:when test="contains(normalize-space($element), 'block')">
2857
3583
  <fo:block xsl:use-attribute-sets="example-body-style">
2858
3584
  <xsl:apply-templates/>
2859
3585
  </fo:block>
@@ -2890,25 +3616,44 @@
2890
3616
  </xsl:otherwise>
2891
3617
  </xsl:choose>
2892
3618
 
2893
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
2894
- <fo:block xsl:use-attribute-sets="example-p-style">
3619
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3620
+
3621
+ <xsl:variable name="element">
3622
+ block
2895
3623
 
2896
- <xsl:apply-templates/>
2897
- </fo:block>
3624
+ </xsl:variable>
3625
+ <xsl:choose>
3626
+ <xsl:when test="normalize-space($element) = 'block'">
3627
+ <fo:block xsl:use-attribute-sets="example-p-style">
3628
+
3629
+ <xsl:apply-templates/>
3630
+ </fo:block>
3631
+ </xsl:when>
3632
+ <xsl:otherwise>
3633
+ <fo:inline xsl:use-attribute-sets="example-p-style">
3634
+ <xsl:apply-templates/>
3635
+ </fo:inline>
3636
+ </xsl:otherwise>
3637
+ </xsl:choose>
2898
3638
  </xsl:template><xsl:template match="*[local-name() = 'termsource']">
2899
3639
  <fo:block xsl:use-attribute-sets="termsource-style">
2900
3640
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
2901
3641
  <xsl:variable name="termsource_text">
2902
3642
  <xsl:apply-templates/>
2903
3643
  </xsl:variable>
3644
+
2904
3645
  <xsl:choose>
2905
3646
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
2906
3647
  <xsl:apply-templates/>
2907
3648
  </xsl:when>
2908
- <xsl:otherwise>
2909
- <xsl:text>[</xsl:text>
2910
- <xsl:apply-templates/>
2911
- <xsl:text>]</xsl:text>
3649
+ <xsl:otherwise>
3650
+
3651
+ <xsl:text>[</xsl:text>
3652
+
3653
+ <xsl:apply-templates/>
3654
+
3655
+ <xsl:text>]</xsl:text>
3656
+
2912
3657
  </xsl:otherwise>
2913
3658
  </xsl:choose>
2914
3659
  </fo:block>
@@ -2919,10 +3664,13 @@
2919
3664
  </xsl:template><xsl:template match="*[local-name() = 'origin']">
2920
3665
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
2921
3666
 
2922
- <xsl:call-template name="getTitle">
2923
- <xsl:with-param name="name" select="'title-source'"/>
2924
- </xsl:call-template>
2925
- <xsl:text>: </xsl:text>
3667
+ <fo:inline>
3668
+
3669
+ <xsl:call-template name="getTitle">
3670
+ <xsl:with-param name="name" select="'title-source'"/>
3671
+ </xsl:call-template>
3672
+ <xsl:text>: </xsl:text>
3673
+ </fo:inline>
2926
3674
 
2927
3675
  <fo:inline xsl:use-attribute-sets="origin-style">
2928
3676
  <xsl:apply-templates/>
@@ -2934,18 +3682,29 @@
2934
3682
  <xsl:if test="normalize-space() != ''">
2935
3683
  <xsl:value-of select="."/>
2936
3684
  </xsl:if>
2937
- </xsl:template><xsl:template match="*[local-name() = 'quote']">
3685
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
3686
+ <fo:block-container margin-left="0mm">
3687
+ <xsl:if test="parent::*[local-name() = 'note']">
3688
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
3689
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
3690
+ </xsl:if>
3691
+ </xsl:if>
3692
+
3693
+ <fo:block-container margin-left="0mm">
2938
3694
 
2939
- <fo:block xsl:use-attribute-sets="quote-style">
2940
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
2941
- </fo:block>
2942
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
2943
- <fo:block xsl:use-attribute-sets="quote-source-style">
2944
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
2945
- <xsl:apply-templates select="*[local-name() = 'author']"/>
2946
- <xsl:apply-templates select="*[local-name() = 'source']"/>
2947
- </fo:block>
2948
- </xsl:if>
3695
+ <fo:block xsl:use-attribute-sets="quote-style">
3696
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3697
+ </fo:block>
3698
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3699
+ <fo:block xsl:use-attribute-sets="quote-source-style">
3700
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
3701
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
3702
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
3703
+ </fo:block>
3704
+ </xsl:if>
3705
+
3706
+ </fo:block-container>
3707
+ </fo:block-container>
2949
3708
  </xsl:template><xsl:template match="*[local-name() = 'source']">
2950
3709
  <xsl:if test="../*[local-name() = 'author']">
2951
3710
  <xsl:text>, </xsl:text>
@@ -2973,6 +3732,7 @@
2973
3732
  <xsl:if test="@type = 'inline'">
2974
3733
 
2975
3734
 
3735
+
2976
3736
  </xsl:if>
2977
3737
 
2978
3738
 
@@ -3005,6 +3765,7 @@
3005
3765
 
3006
3766
 
3007
3767
 
3768
+
3008
3769
  </xsl:variable>
3009
3770
 
3010
3771
  <xsl:variable name="padding-right">
@@ -3072,7 +3833,7 @@
3072
3833
  <fo:block>
3073
3834
  <xsl:call-template name="setId"/>
3074
3835
 
3075
- <xsl:variable name="pos"><xsl:number count="csa:sections/csa:clause[not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"/></xsl:variable>
3836
+ <xsl:variable name="pos"><xsl:number count="csa:sections/csa:clause[not(@type='scope') and not(@type='conformance')]"/></xsl:variable>
3076
3837
  <xsl:if test="$pos &gt;= 2">
3077
3838
  <xsl:attribute name="space-before">18pt</xsl:attribute>
3078
3839
  </xsl:if>
@@ -3100,13 +3861,14 @@
3100
3861
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3101
3862
  <fo:block>
3102
3863
  <xsl:call-template name="setId"/>
3864
+
3103
3865
  <xsl:apply-templates/>
3104
3866
  </fo:block>
3105
3867
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3106
3868
  <fo:block id="{@id}">
3107
3869
  <xsl:apply-templates/>
3108
3870
  </fo:block>
3109
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@id = '_normative_references' or @id = '_references']">
3871
+ </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3110
3872
 
3111
3873
  <fo:block id="{@id}">
3112
3874
  <xsl:apply-templates/>
@@ -3124,6 +3886,31 @@
3124
3886
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3125
3887
  <!-- 0xA0 to space replacement -->
3126
3888
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3889
+ </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3890
+ <xsl:choose>
3891
+ <xsl:when test="parent::*[local-name() = 'note']">
3892
+ <fo:block-container>
3893
+ <xsl:attribute name="margin-left">
3894
+ <xsl:choose>
3895
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3896
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3897
+ </xsl:choose>
3898
+ </xsl:attribute>
3899
+
3900
+
3901
+ <fo:block-container margin-left="0mm">
3902
+ <fo:block>
3903
+ <xsl:apply-templates select="." mode="ul_ol"/>
3904
+ </fo:block>
3905
+ </fo:block-container>
3906
+ </fo:block-container>
3907
+ </xsl:when>
3908
+ <xsl:otherwise>
3909
+ <fo:block>
3910
+ <xsl:apply-templates select="." mode="ul_ol"/>
3911
+ </fo:block>
3912
+ </xsl:otherwise>
3913
+ </xsl:choose>
3127
3914
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3128
3915
  <!-- <row>
3129
3916
  <date>05-07-2013</date>
@@ -3155,6 +3942,65 @@
3155
3942
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3156
3943
  <fo:block><xsl:apply-templates/></fo:block>
3157
3944
  </fo:table-cell>
3945
+ </xsl:template><xsl:template name="processBibitem">
3946
+
3947
+
3948
+
3949
+
3950
+ </xsl:template><xsl:template name="processBibitemDocId">
3951
+ <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')]"/>
3952
+ <xsl:choose>
3953
+ <xsl:when test="normalize-space($_doc_ident) != ''">
3954
+ <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"/>
3955
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
3956
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3957
+ </xsl:if>
3958
+ <xsl:value-of select="$_doc_ident"/>
3959
+ </xsl:when>
3960
+ <xsl:otherwise>
3961
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
3962
+ <xsl:if test="$type != ''">
3963
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3964
+ </xsl:if>
3965
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
3966
+ </xsl:otherwise>
3967
+ </xsl:choose>
3968
+ </xsl:template><xsl:template name="processPersonalAuthor">
3969
+ <xsl:choose>
3970
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
3971
+ <author>
3972
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
3973
+ </author>
3974
+ </xsl:when>
3975
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
3976
+ <author>
3977
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3978
+ <xsl:text> </xsl:text>
3979
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
3980
+ </author>
3981
+ </xsl:when>
3982
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
3983
+ <author>
3984
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3985
+ <xsl:text> </xsl:text>
3986
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
3987
+ </author>
3988
+ </xsl:when>
3989
+ <xsl:otherwise>
3990
+ <xsl:apply-templates/>
3991
+ </xsl:otherwise>
3992
+ </xsl:choose>
3993
+ </xsl:template><xsl:template name="renderDate">
3994
+ <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
3995
+ <xsl:value-of select="*[local-name() = 'on']"/>
3996
+ </xsl:if>
3997
+ <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
3998
+ <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
3999
+ </xsl:if>
4000
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
4001
+ <xsl:value-of select="translate(.,'. ','')"/>
4002
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
4003
+ <xsl:value-of select="substring(.,1,1)"/>
3158
4004
  </xsl:template><xsl:template name="convertDate">
3159
4005
  <xsl:param name="date"/>
3160
4006
  <xsl:param name="format" select="'short'"/>
@@ -3233,6 +4079,7 @@
3233
4079
  <dc:title>
3234
4080
  <xsl:variable name="title">
3235
4081
 
4082
+
3236
4083
 
3237
4084
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/>
3238
4085
 
@@ -3251,6 +4098,7 @@
3251
4098
  <dc:creator>
3252
4099
 
3253
4100
 
4101
+
3254
4102
  </dc:creator>
3255
4103
  <dc:description>
3256
4104
  <xsl:variable name="abstract">
@@ -3260,6 +4108,7 @@
3260
4108
 
3261
4109
  <xsl:copy-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'abstract']//text()"/>
3262
4110
 
4111
+
3263
4112
  </xsl:variable>
3264
4113
  <xsl:value-of select="normalize-space($abstract)"/>
3265
4114
  </dc:description>
@@ -3358,7 +4207,9 @@
3358
4207
 
3359
4208
 
3360
4209
 
3361
-
4210
+
4211
+
4212
+
3362
4213
  </xsl:variable>
3363
4214
  <xsl:if test="$documentNS != $XSLNS">
3364
4215
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3384,4 +4235,21 @@
3384
4235
  </xsl:otherwise>
3385
4236
  </xsl:choose>
3386
4237
  </xsl:attribute>
4238
+ </xsl:template><xsl:template name="add-letter-spacing">
4239
+ <xsl:param name="text"/>
4240
+ <xsl:param name="letter-spacing" select="'0.15'"/>
4241
+ <xsl:if test="string-length($text) &gt; 0">
4242
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
4243
+ <fo:inline padding-right="{$letter-spacing}mm">
4244
+ <xsl:if test="$char = '®'">
4245
+ <xsl:attribute name="font-size">58%</xsl:attribute>
4246
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4247
+ </xsl:if>
4248
+ <xsl:value-of select="$char"/>
4249
+ </fo:inline>
4250
+ <xsl:call-template name="add-letter-spacing">
4251
+ <xsl:with-param name="text" select="substring($text, 2)"/>
4252
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4253
+ </xsl:call-template>
4254
+ </xsl:if>
3387
4255
  </xsl:template></xsl:stylesheet>