metanorma-nist 1.2.0 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -174,7 +174,7 @@ p.MsoFooter, li.MsoFooter, div.MsoFooter
174
174
  margin:0cm;
175
175
  margin-bottom:.0001pt;
176
176
  mso-pagination:widow-orphan;
177
- tab-stops:right 482.0pt;
177
+ tab-stops:center 3.25in;
178
178
  font-size:12pt;
179
179
  font-family:$bodyfont;
180
180
  mso-fareast-font-family:"Times New Roman";
@@ -185,7 +185,7 @@ p.MsoFooterLandscape, li.MsoFooterLandscape, div.MsoFooterLandscape
185
185
  margin:0cm;
186
186
  margin-bottom:.0001pt;
187
187
  mso-pagination:widow-orphan;
188
- tab-stops:right 9.0in;
188
+ tab-stops:center 4.5in;
189
189
  font-size:12pt;
190
190
  font-family:$bodyfont;
191
191
  mso-fareast-font-family:"Times New Roman";
@@ -425,7 +425,6 @@ h1.Annex {
425
425
  mso-style-parent:"Heading 1";
426
426
  mso-style-link:"Heading 2 Char";
427
427
  mso-style-next:Normal;
428
- text-align:center;
429
428
  margin-top:3.0pt;
430
429
  margin-right:0cm;
431
430
  margin-bottom:12.0pt;
@@ -445,6 +444,12 @@ h1.Annex {
445
444
  mso-ansi-language:EN-GB;
446
445
  mso-fareast-language:JA;
447
446
  mso-bidi-font-weight:normal;}
447
+ .h2Annex {
448
+ text-align:left;
449
+ }
450
+ .h2Preface {
451
+ text-align:center;
452
+ }
448
453
  h2
449
454
  {mso-style-priority:2;
450
455
  mso-style-unhide:no;
@@ -1288,6 +1293,72 @@ p.Tablebody, li.Tablebody, div.Tablebody
1288
1293
  mso-level-number-position:left;
1289
1294
  margin-left:162.0pt;
1290
1295
  text-indent:-18.0pt;}
1296
+ /* steps ordered list */
1297
+ @list l4
1298
+ {mso-list-id:525294608;
1299
+ mso-list-template-ids:676331812}
1300
+ @list l4:level1
1301
+ {mso-level-text:"%1\)";
1302
+ mso-level-tab-stop:none;
1303
+ mso-level-number-position:left;
1304
+ margin-left:1.4cm;
1305
+ text-indent:-1.4cm;}
1306
+ @list l4:level2
1307
+ {mso-level-text:"%2\)";
1308
+ mso-level-number-format:alpha-lower;
1309
+ mso-level-tab-stop:none;
1310
+ mso-level-number-position:left;
1311
+ margin-left:2.1cm;
1312
+ text-indent:-0.7cm;}
1313
+ @list l4:level3
1314
+ {mso-level-number-format:roman-lower;
1315
+ mso-level-text:"%3\)";
1316
+ mso-level-tab-stop:none;
1317
+ mso-level-number-position:left;
1318
+ margin-left:2.8cm;
1319
+ text-indent:-0.7cm;}
1320
+ @list l4:level4
1321
+ {mso-level-number-format:alpha-upper;
1322
+ mso-level-text:"%4\)";
1323
+ mso-level-tab-stop:none;
1324
+ mso-level-number-position:left;
1325
+ margin-left:3.5cm;
1326
+ text-indent:-0.7cm;}
1327
+ @list l4:level5
1328
+ {mso-level-number-format:roman-upper;
1329
+ mso-level-text:"%5\)";
1330
+ mso-level-tab-stop:none;
1331
+ mso-level-number-position:left;
1332
+ margin-left:4.2cm;
1333
+ text-indent:-0.7cm;}
1334
+ @list l4:level6
1335
+ {mso-level-text:"%6\)";
1336
+ mso-level-tab-stop:none;
1337
+ mso-level-number-position:left;
1338
+ margin-left:4.9cm;
1339
+ text-indent:-0.7cm;}
1340
+ @list l4:level7
1341
+ {mso-level-tab-stop:none;
1342
+ mso-level-number-format:alpha-lower;
1343
+ mso-level-text:"%7\)";
1344
+ mso-level-number-position:left;
1345
+ margin-left:5.6cm;
1346
+ text-indent:-0.7cm;}
1347
+ @list l4:level8
1348
+ {mso-level-number-format:roman-lower;
1349
+ mso-level-text:"%8\)";
1350
+ mso-level-tab-stop:none;
1351
+ mso-level-number-position:left;
1352
+ margin-left:6.3cm;
1353
+ text-indent:-0.7cm;}
1354
+ @list l4:level9
1355
+ {mso-level-number-format:alpha-upper;
1356
+ mso-level-text:"%9\)";
1357
+ mso-level-tab-stop:none;
1358
+ mso-level-number-position:left;
1359
+ margin-left:7.0cm;
1360
+ text-indent:-0.7cm;}
1361
+
1291
1362
 
1292
1363
  div.ListContLevel1
1293
1364
  {mso-style-priority:34;
@@ -167,7 +167,7 @@ p.MsoFooter, li.MsoFooter, div.MsoFooter {
167
167
  margin-right: 0cm;
168
168
  margin-bottom: 12.0pt;
169
169
  margin-left: 0cm;
170
- tab-stops: right 482.0pt;
170
+ tab-stops: center 3.25in;
171
171
  font-size: 12.0pt;
172
172
  font-family: {{bodyfont}}; }
173
173
 
@@ -177,7 +177,7 @@ p.MsoFooterLandscape, li.MsoFooterLandscape, div.MsoFooterLandscape {
177
177
  margin-right: 0cm;
178
178
  margin-bottom: 12.0pt;
179
179
  margin-left: 0cm;
180
- tab-stops: right 9.0in;
180
+ tab-stops: center 4.5in;
181
181
  font-size: 12.0pt;
182
182
  font-family: {{bodyfont}}; }
183
183
 
@@ -1050,6 +1050,81 @@ p.Tablebody, li.Tablebody, div.Tablebody {
1050
1050
  margin-left: 162.0pt;
1051
1051
  text-indent: -18.0pt; }
1052
1052
 
1053
+ /* steps ordered list */
1054
+ @list l4 {
1055
+ mso-list-id: 525294608;
1056
+ mso-list-template-ids: 676331812; }
1057
+
1058
+ @list l4:level1 {
1059
+ mso-level-text: "%1\)";
1060
+ mso-level-tab-stop: none;
1061
+ mso-level-number-position: left;
1062
+ margin-left: 1.4cm;
1063
+ text-indent: -1.4cm; }
1064
+
1065
+ @list l4:level2 {
1066
+ mso-level-text: "%2\)";
1067
+ mso-level-number-format: alpha-lower;
1068
+ mso-level-tab-stop: none;
1069
+ mso-level-number-position: left;
1070
+ margin-left: 2.1cm;
1071
+ text-indent: -0.7cm; }
1072
+
1073
+ @list l4:level3 {
1074
+ mso-level-number-format: roman-lower;
1075
+ mso-level-text: "%3\)";
1076
+ mso-level-tab-stop: none;
1077
+ mso-level-number-position: left;
1078
+ margin-left: 2.8cm;
1079
+ text-indent: -0.7cm; }
1080
+
1081
+ @list l4:level4 {
1082
+ mso-level-number-format: alpha-upper;
1083
+ mso-level-text: "%4\)";
1084
+ mso-level-tab-stop: none;
1085
+ mso-level-number-position: left;
1086
+ margin-left: 3.5cm;
1087
+ text-indent: -0.7cm; }
1088
+
1089
+ @list l4:level5 {
1090
+ mso-level-number-format: roman-upper;
1091
+ mso-level-text: "%5\)";
1092
+ mso-level-tab-stop: none;
1093
+ mso-level-number-position: left;
1094
+ margin-left: 4.2cm;
1095
+ text-indent: -0.7cm; }
1096
+
1097
+ @list l4:level6 {
1098
+ mso-level-text: "%6\)";
1099
+ mso-level-tab-stop: none;
1100
+ mso-level-number-position: left;
1101
+ margin-left: 4.9cm;
1102
+ text-indent: -0.7cm; }
1103
+
1104
+ @list l4:level7 {
1105
+ mso-level-tab-stop: none;
1106
+ mso-level-number-format: alpha-lower;
1107
+ mso-level-text: "%7\)";
1108
+ mso-level-number-position: left;
1109
+ margin-left: 5.6cm;
1110
+ text-indent: -0.7cm; }
1111
+
1112
+ @list l4:level8 {
1113
+ mso-level-number-format: roman-lower;
1114
+ mso-level-text: "%8\)";
1115
+ mso-level-tab-stop: none;
1116
+ mso-level-number-position: left;
1117
+ margin-left: 6.3cm;
1118
+ text-indent: -0.7cm; }
1119
+
1120
+ @list l4:level9 {
1121
+ mso-level-number-format: alpha-upper;
1122
+ mso-level-text: "%9\)";
1123
+ mso-level-tab-stop: none;
1124
+ mso-level-number-position: left;
1125
+ margin-left: 7.0cm;
1126
+ text-indent: -0.7cm; }
1127
+
1053
1128
  div.ListContLevel1 {
1054
1129
  mso-style-priority: 34;
1055
1130
  margin-left: 18.0pt;
@@ -149,7 +149,7 @@ p.MsoFooter, li.MsoFooter, div.MsoFooter
149
149
  margin-right:0cm;
150
150
  margin-bottom:12.0pt;
151
151
  margin-left:0cm;
152
- tab-stops:right 482.0pt;
152
+ tab-stops:center 3.25in;
153
153
  font-size:12.0pt;
154
154
  font-family:$bodyfont;}
155
155
  p.MsoFooterLandscape, li.MsoFooterLandscape, div.MsoFooterLandscape
@@ -158,7 +158,7 @@ p.MsoFooterLandscape, li.MsoFooterLandscape, div.MsoFooterLandscape
158
158
  margin-right:0cm;
159
159
  margin-bottom:12.0pt;
160
160
  margin-left:0cm;
161
- tab-stops:right 9.0in;
161
+ tab-stops:center 4.5in;
162
162
  font-size:12.0pt;
163
163
  font-family:$bodyfont;}
164
164
  span.MsoCommentReference
@@ -966,6 +966,72 @@ p.Tablebody, li.Tablebody, div.Tablebody
966
966
  mso-level-number-position:left;
967
967
  margin-left:162.0pt;
968
968
  text-indent:-18.0pt;}
969
+ /* steps ordered list */
970
+ @list l4
971
+ {mso-list-id:525294608;
972
+ mso-list-template-ids:676331812}
973
+ @list l4:level1
974
+ {mso-level-text:"%1\)";
975
+ mso-level-tab-stop:none;
976
+ mso-level-number-position:left;
977
+ margin-left:1.4cm;
978
+ text-indent:-1.4cm;}
979
+ @list l4:level2
980
+ {mso-level-text:"%2\)";
981
+ mso-level-number-format:alpha-lower;
982
+ mso-level-tab-stop:none;
983
+ mso-level-number-position:left;
984
+ margin-left:2.1cm;
985
+ text-indent:-0.7cm;}
986
+ @list l4:level3
987
+ {mso-level-number-format:roman-lower;
988
+ mso-level-text:"%3\)";
989
+ mso-level-tab-stop:none;
990
+ mso-level-number-position:left;
991
+ margin-left:2.8cm;
992
+ text-indent:-0.7cm;}
993
+ @list l4:level4
994
+ {mso-level-number-format:alpha-upper;
995
+ mso-level-text:"%4\)";
996
+ mso-level-tab-stop:none;
997
+ mso-level-number-position:left;
998
+ margin-left:3.5cm;
999
+ text-indent:-0.7cm;}
1000
+ @list l4:level5
1001
+ {mso-level-number-format:roman-upper;
1002
+ mso-level-text:"%5\)";
1003
+ mso-level-tab-stop:none;
1004
+ mso-level-number-position:left;
1005
+ margin-left:4.2cm;
1006
+ text-indent:-0.7cm;}
1007
+ @list l4:level6
1008
+ {mso-level-text:"%6\)";
1009
+ mso-level-tab-stop:none;
1010
+ mso-level-number-position:left;
1011
+ margin-left:4.9cm;
1012
+ text-indent:-0.7cm;}
1013
+ @list l4:level7
1014
+ {mso-level-tab-stop:none;
1015
+ mso-level-number-format:alpha-lower;
1016
+ mso-level-text:"%7\)";
1017
+ mso-level-number-position:left;
1018
+ margin-left:5.6cm;
1019
+ text-indent:-0.7cm;}
1020
+ @list l4:level8
1021
+ {mso-level-number-format:roman-lower;
1022
+ mso-level-text:"%8\)";
1023
+ mso-level-tab-stop:none;
1024
+ mso-level-number-position:left;
1025
+ margin-left:6.3cm;
1026
+ text-indent:-0.7cm;}
1027
+ @list l4:level9
1028
+ {mso-level-number-format:alpha-upper;
1029
+ mso-level-text:"%9\)";
1030
+ mso-level-tab-stop:none;
1031
+ mso-level-number-position:left;
1032
+ margin-left:7.0cm;
1033
+ text-indent:-0.7cm;}
1034
+
969
1035
 
970
1036
  div.ListContLevel1
971
1037
  {mso-style-priority:34;
@@ -109,6 +109,7 @@ module IsoDoc
109
109
  def make_body3(body, docxml)
110
110
  body.div **{ class: "main-section" } do |div3|
111
111
  foreword docxml, div3
112
+ preface_block docxml, div3
112
113
  abstract docxml, div3
113
114
  keywords docxml, div3
114
115
  boilerplate docxml, div3
@@ -230,6 +230,7 @@ module IsoDoc
230
230
  note = xml.at(ns("//bibdata/note[@type = "\
231
231
  "'withdrawal-announcement-link']"))&.text and
232
232
  set(:withdrawal_announcement_link, note)
233
+ super
233
234
  end
234
235
  end
235
236
  end
@@ -66,6 +66,8 @@ module IsoDoc
66
66
  when "final" then "Final"
67
67
  when "final-review" then "Under Review"
68
68
  when "final-withdrawn" then "Withdrawn"
69
+ else
70
+ super
69
71
  end
70
72
  end
71
73
 
@@ -51,7 +51,7 @@
51
51
 
52
52
  <xsl:template match="/">
53
53
  <xsl:call-template name="namespaceCheck"/>
54
- <fo:root font-family="Times New Roman, STIX2Math" font-size="12pt" xml:lang="{$lang}">
54
+ <fo:root font-family="Times New Roman, STIX Two Math" font-size="12pt" xml:lang="{$lang}">
55
55
  <fo:layout-master-set>
56
56
  <!-- Cover pages -->
57
57
  <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
@@ -83,6 +83,10 @@
83
83
  </fo:layout-master-set>
84
84
 
85
85
  <xsl:call-template name="addPDFUAmeta"/>
86
+
87
+ <xsl:call-template name="addBookmarks">
88
+ <xsl:with-param name="contents" select="$contents"/>
89
+ </xsl:call-template>
86
90
 
87
91
  <!-- cover page -->
88
92
  <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
@@ -429,9 +433,17 @@
429
433
  <xsl:otherwise>true</xsl:otherwise>
430
434
  </xsl:choose>
431
435
  </xsl:variable>
436
+
437
+
438
+ <xsl:variable name="skip">
439
+ <xsl:choose>
440
+ <xsl:when test="ancestor-or-self::nist:bibitem">true</xsl:when>
441
+ <xsl:when test="ancestor-or-self::nist:term">true</xsl:when>
442
+ <xsl:otherwise>false</xsl:otherwise>
443
+ </xsl:choose>
444
+ </xsl:variable>
432
445
 
433
-
434
- <xsl:if test="$display = 'true'">
446
+ <xsl:if test="$skip = 'false'">
435
447
 
436
448
  <xsl:variable name="section">
437
449
  <xsl:call-template name="getSection"/>
@@ -445,12 +457,13 @@
445
457
  <xsl:value-of select="local-name()"/>
446
458
  </xsl:variable>
447
459
 
448
- <item id="{@id}" level="{$level}" section="{$section}" type="{$type}">
449
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
460
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" display="{$display}">
461
+ <title>
462
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
463
+ </title>
464
+ <xsl:apply-templates mode="contents"/>
450
465
  </item>
451
- <xsl:apply-templates mode="contents"/>
452
- </xsl:if>
453
-
466
+ </xsl:if>
454
467
  </xsl:template>
455
468
 
456
469
 
@@ -699,8 +712,13 @@
699
712
  </xsl:choose>
700
713
  </xsl:variable>
701
714
  <xsl:element name="{$element-name}">
702
- <xsl:attribute name="font-family">Courier</xsl:attribute>
703
- <xsl:attribute name="font-size">10pt</xsl:attribute>
715
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
716
+ <xsl:attribute name="font-size">
717
+ <xsl:choose>
718
+ <xsl:when test="ancestor::*[local-name()='note']">9pt</xsl:when>
719
+ <xsl:otherwise>10pt</xsl:otherwise>
720
+ </xsl:choose>
721
+ </xsl:attribute>
704
722
  <xsl:attribute name="text-align">center</xsl:attribute>
705
723
  <xsl:apply-templates/>
706
724
  </xsl:element>
@@ -779,7 +797,7 @@
779
797
  <xsl:template match="nist:docidentifier"/>
780
798
 
781
799
 
782
- <xsl:template match="nist:ul | nist:ol">
800
+ <xsl:template match="nist:ul | nist:ol" mode="ul_ol">
783
801
  <fo:list-block>
784
802
  <xsl:apply-templates/>
785
803
  </fo:list-block>
@@ -787,13 +805,28 @@
787
805
  </xsl:template>
788
806
 
789
807
  <xsl:template match="nist:ul//nist:note | nist:ol//nist:note" priority="2"/>
790
- <xsl:template match="nist:ul//nist:note/nist:p | nist:ol//nist:note/nist:p" mode="process">
808
+ <xsl:template match="nist:ul//nist:note | nist:ol//nist:note" mode="process">
809
+ <fo:block id="{@id}">
810
+ <xsl:apply-templates mode="process"/>
811
+ </fo:block>
812
+ </xsl:template>
813
+
814
+
815
+ <xsl:template match="nist:ul//nist:note/nist:name | nist:ol//nist:note/nist:name" mode="process" priority="2"/>
816
+
817
+ <xsl:template match="nist:ul//nist:note/nist:p | nist:ol//nist:note/nist:p" mode="process" priority="2">
791
818
  <fo:block font-size="11pt" margin-top="4pt">
792
819
  <xsl:apply-templates select="../nist:name" mode="presentation"/>
793
820
  <xsl:apply-templates/>
794
821
  </fo:block>
795
822
  </xsl:template>
796
823
 
824
+ <xsl:template match="nist:ul//nist:note/* | nist:ol//nist:note/*" mode="process">
825
+ <fo:block font-size="11pt">
826
+ <xsl:apply-templates select="."/>
827
+ </fo:block>
828
+ </xsl:template>
829
+
797
830
  <xsl:template match="nist:li">
798
831
  <xsl:variable name="level">
799
832
  <xsl:variable name="numtmp">
@@ -812,6 +845,9 @@
812
845
  <xsl:when test="local-name(..) = 'ul'">•</xsl:when>
813
846
  <xsl:otherwise> <!-- for ordered lists -->
814
847
  <xsl:choose>
848
+ <xsl:when test="../@class = 'steps'">
849
+ <xsl:number format="1."/>
850
+ </xsl:when>
815
851
  <xsl:when test="../@type = 'arabic'">
816
852
  <xsl:number format="a)"/>
817
853
  </xsl:when>
@@ -942,10 +978,23 @@
942
978
 
943
979
 
944
980
 
945
- <xsl:template match="nist:quote" priority="2">
946
- <fo:block-container margin-left="7mm" margin-right="7mm">
947
- <xsl:apply-templates/>
948
- <xsl:apply-templates select="nist:author" mode="process"/>
981
+ <xsl:template match="nist:quote" priority="2">
982
+ <fo:block-container margin-left="0mm">
983
+ <xsl:if test="parent::*[local-name() = 'note']">
984
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
985
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
986
+ </xsl:if>
987
+ </xsl:if>
988
+ <fo:block-container margin-left="0mm">
989
+
990
+ <fo:block-container margin-left="7mm" margin-right="7mm">
991
+ <fo:block>
992
+ <xsl:apply-templates/>
993
+ <xsl:apply-templates select="nist:author" mode="process"/>
994
+ </fo:block>
995
+ </fo:block-container>
996
+
997
+ </fo:block-container>
949
998
  </fo:block-container>
950
999
  </xsl:template>
951
1000
 
@@ -1054,6 +1103,12 @@
1054
1103
 
1055
1104
  </title-edition>
1056
1105
 
1106
+ <title-edition lang="fr">
1107
+
1108
+ <xsl:text>Édition </xsl:text>
1109
+
1110
+ </title-edition>
1111
+
1057
1112
 
1058
1113
  <title-toc lang="en">
1059
1114
 
@@ -1062,7 +1117,12 @@
1062
1117
 
1063
1118
 
1064
1119
  </title-toc>
1065
- <title-toc lang="fr">Sommaire</title-toc>
1120
+ <title-toc lang="fr">
1121
+
1122
+ <xsl:text>Sommaire</xsl:text>
1123
+
1124
+
1125
+ </title-toc>
1066
1126
 
1067
1127
  <title-toc lang="zh">Contents</title-toc>
1068
1128
 
@@ -1096,7 +1156,12 @@
1096
1156
 
1097
1157
 
1098
1158
 
1099
- <title-source lang="en">SOURCE</title-source>
1159
+ <title-source lang="en">
1160
+
1161
+ <xsl:text>SOURCE</xsl:text>
1162
+
1163
+
1164
+ </title-source>
1100
1165
 
1101
1166
  <title-keywords lang="en">Keywords</title-keywords>
1102
1167
 
@@ -1139,12 +1204,25 @@
1139
1204
  <title-warning lang="zh">警告</title-warning>
1140
1205
 
1141
1206
  <title-amendment lang="en">AMENDMENT</title-amendment>
1207
+
1208
+ <title-continued lang="en">(continued)</title-continued>
1209
+ <title-continued lang="fr">(continué)</title-continued>
1210
+
1142
1211
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1143
1212
  <xsl:param name="name"/>
1144
- <xsl:variable name="lang">
1145
- <xsl:call-template name="getLang"/>
1213
+ <xsl:param name="lang"/>
1214
+ <xsl:variable name="lang_">
1215
+ <xsl:choose>
1216
+ <xsl:when test="$lang != ''">
1217
+ <xsl:value-of select="$lang"/>
1218
+ </xsl:when>
1219
+ <xsl:otherwise>
1220
+ <xsl:call-template name="getLang"/>
1221
+ </xsl:otherwise>
1222
+ </xsl:choose>
1146
1223
  </xsl:variable>
1147
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
1224
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
1225
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
1148
1226
  <xsl:choose>
1149
1227
  <xsl:when test="normalize-space($title_) != ''">
1150
1228
  <xsl:value-of select="$title_"/>
@@ -1153,7 +1231,10 @@
1153
1231
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
1154
1232
  </xsl:otherwise>
1155
1233
  </xsl:choose>
1156
- </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">
1234
+ </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">
1235
+
1236
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
1237
+
1157
1238
 
1158
1239
 
1159
1240
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
@@ -1164,14 +1245,14 @@
1164
1245
 
1165
1246
 
1166
1247
 
1167
- <xsl:attribute name="font-family">Courier</xsl:attribute>
1168
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1248
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
1169
1249
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
1170
1250
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1171
1251
 
1172
1252
 
1173
1253
 
1174
1254
 
1255
+
1175
1256
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
1176
1257
 
1177
1258
  </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
@@ -1211,6 +1292,7 @@
1211
1292
 
1212
1293
 
1213
1294
 
1295
+
1214
1296
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1215
1297
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1216
1298
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -1221,6 +1303,7 @@
1221
1303
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1222
1304
 
1223
1305
 
1306
+
1224
1307
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1225
1308
 
1226
1309
 
@@ -1241,6 +1324,9 @@
1241
1324
 
1242
1325
 
1243
1326
 
1327
+
1328
+
1329
+
1244
1330
 
1245
1331
  </xsl:attribute-set><xsl:attribute-set name="example-p-style">
1246
1332
 
@@ -1256,6 +1342,8 @@
1256
1342
 
1257
1343
 
1258
1344
 
1345
+
1346
+
1259
1347
  </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
1260
1348
 
1261
1349
 
@@ -1279,6 +1367,8 @@
1279
1367
 
1280
1368
 
1281
1369
 
1370
+
1371
+
1282
1372
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1283
1373
 
1284
1374
 
@@ -1292,11 +1382,13 @@
1292
1382
 
1293
1383
  <xsl:attribute name="color">blue</xsl:attribute>
1294
1384
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1295
-
1385
+
1386
+
1296
1387
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1297
1388
 
1298
1389
 
1299
1390
 
1391
+
1300
1392
  <xsl:attribute name="color">blue</xsl:attribute>
1301
1393
 
1302
1394
  </xsl:attribute-set><xsl:attribute-set name="note-style">
@@ -1316,9 +1408,10 @@
1316
1408
 
1317
1409
 
1318
1410
 
1411
+ </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">
1412
+
1319
1413
 
1320
1414
 
1321
- </xsl:attribute-set><xsl:attribute-set name="note-name-style">
1322
1415
 
1323
1416
 
1324
1417
 
@@ -1327,7 +1420,6 @@
1327
1420
 
1328
1421
 
1329
1422
 
1330
-
1331
1423
 
1332
1424
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1333
1425
 
@@ -1353,6 +1445,8 @@
1353
1445
  <xsl:attribute name="margin-top">4pt</xsl:attribute>
1354
1446
 
1355
1447
 
1448
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1449
+
1356
1450
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1357
1451
 
1358
1452
 
@@ -1373,6 +1467,7 @@
1373
1467
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1374
1468
 
1375
1469
 
1470
+
1376
1471
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1377
1472
 
1378
1473
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
@@ -1384,6 +1479,7 @@
1384
1479
 
1385
1480
 
1386
1481
 
1482
+
1387
1483
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1388
1484
  <xsl:attribute name="text-align">center</xsl:attribute>
1389
1485
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -1396,7 +1492,7 @@
1396
1492
 
1397
1493
 
1398
1494
 
1399
-
1495
+
1400
1496
  </xsl:attribute-set><xsl:attribute-set name="formula-style">
1401
1497
 
1402
1498
  </xsl:attribute-set><xsl:attribute-set name="image-style">
@@ -1422,11 +1518,14 @@
1422
1518
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
1423
1519
 
1424
1520
 
1521
+
1425
1522
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1426
1523
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1427
1524
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1428
1525
  <xsl:attribute name="text-align">center</xsl:attribute>
1429
1526
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1527
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1528
+
1430
1529
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
1431
1530
 
1432
1531
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -1437,7 +1536,43 @@
1437
1536
  </xsl:attribute-set><xsl:attribute-set name="definition-style">
1438
1537
 
1439
1538
 
1440
- </xsl:attribute-set><xsl:template match="text()">
1539
+ </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
1540
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1541
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1542
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1543
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1544
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1545
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1546
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1547
+
1548
+ <!-- Normative references -->
1549
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1550
+ <!-- Terms and definitions -->
1551
+ <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"/>
1552
+ <!-- Another main sections -->
1553
+ <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"/>
1554
+ <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1555
+ <!-- Bibliography -->
1556
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1557
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1558
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1559
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1560
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1561
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1562
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1563
+ </xsl:template><xsl:template name="processMainSectionsDefault">
1564
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1565
+
1566
+ <!-- Normative references -->
1567
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
1568
+ <!-- Terms and definitions -->
1569
+ <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']]"/>
1570
+ <!-- Another main sections -->
1571
+ <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'])]"/>
1572
+ <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1573
+ <!-- Bibliography -->
1574
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1575
+ </xsl:template><xsl:template match="text()">
1441
1576
  <xsl:value-of select="."/>
1442
1577
  </xsl:template><xsl:template match="*[local-name()='br']">
1443
1578
  <xsl:value-of select="$linebreak"/>
@@ -1454,6 +1589,10 @@
1454
1589
 
1455
1590
 
1456
1591
 
1592
+
1593
+
1594
+ <!-- $namespace = 'iso' or -->
1595
+
1457
1596
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1458
1597
 
1459
1598
 
@@ -1487,6 +1626,7 @@
1487
1626
  <xsl:with-param name="table" select="$simple-table"/>
1488
1627
  </xsl:call-template>
1489
1628
  </xsl:variable>
1629
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1490
1630
 
1491
1631
  <!-- <xsl:variable name="colwidths2">
1492
1632
  <xsl:call-template name="calculate-column-widths">
@@ -1507,8 +1647,25 @@
1507
1647
 
1508
1648
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1509
1649
 
1650
+
1510
1651
  <xsl:attribute name="space-after">6pt</xsl:attribute>
1511
1652
 
1653
+
1654
+
1655
+
1656
+
1657
+
1658
+ <xsl:if test="ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface']">
1659
+ <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
1660
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1661
+ </xsl:if>
1662
+ <xsl:if test="not(ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface'])">
1663
+ <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
1664
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
1665
+ </xsl:if>
1666
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1667
+
1668
+
1512
1669
 
1513
1670
 
1514
1671
 
@@ -1516,27 +1673,36 @@
1516
1673
 
1517
1674
 
1518
1675
 
1519
- <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">
1520
-
1676
+ <xsl:variable name="table_attributes">
1677
+ <attribute name="table-layout">fixed</attribute>
1678
+ <attribute name="width">100%</attribute>
1679
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1680
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1521
1681
 
1522
1682
 
1523
1683
 
1524
1684
 
1685
+
1686
+
1687
+
1525
1688
 
1526
- <xsl:if test="ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface']">
1527
- <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
1528
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1529
- </xsl:if>
1530
- <xsl:if test="not(ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface'])">
1531
- <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
1532
- <xsl:attribute name="font-size">12pt</xsl:attribute>
1533
- </xsl:if>
1534
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1535
-
1536
-
1689
+
1537
1690
 
1691
+ </xsl:variable>
1692
+
1693
+
1694
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1538
1695
 
1696
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1697
+ <xsl:attribute name="{@name}">
1698
+ <xsl:value-of select="."/>
1699
+ </xsl:attribute>
1700
+ </xsl:for-each>
1539
1701
 
1702
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1703
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1704
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1705
+ </xsl:if>
1540
1706
 
1541
1707
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1542
1708
  <xsl:choose>
@@ -1560,6 +1726,33 @@
1560
1726
 
1561
1727
  </fo:table>
1562
1728
 
1729
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1730
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1731
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1732
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1733
+ </xsl:call-template>
1734
+ </xsl:for-each>
1735
+
1736
+ <!-- insert footer as table -->
1737
+ <!-- <fo:table>
1738
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1739
+ <xsl:attribute name="{@name}">
1740
+ <xsl:value-of select="."/>
1741
+ </xsl:attribute>
1742
+ </xsl:for-each>
1743
+
1744
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1745
+ <xsl:choose>
1746
+ <xsl:when test=". = 1 or . = 0">
1747
+ <fo:table-column column-width="proportional-column-width(2)"/>
1748
+ </xsl:when>
1749
+ <xsl:otherwise>
1750
+ <fo:table-column column-width="proportional-column-width({.})"/>
1751
+ </xsl:otherwise>
1752
+ </xsl:choose>
1753
+ </xsl:for-each>
1754
+ </fo:table>-->
1755
+
1563
1756
 
1564
1757
 
1565
1758
 
@@ -1568,8 +1761,9 @@
1568
1761
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1569
1762
  <xsl:if test="normalize-space() != ''">
1570
1763
  <fo:block xsl:use-attribute-sets="table-name-style">
1571
- <xsl:apply-templates/>
1572
- </fo:block>
1764
+
1765
+ <xsl:apply-templates/>
1766
+ </fo:block>
1573
1767
  </xsl:if>
1574
1768
  </xsl:template><xsl:template name="calculate-columns-numbers">
1575
1769
  <xsl:param name="table-row"/>
@@ -1623,6 +1817,13 @@
1623
1817
  <xsl:for-each select="xalan:nodeset($table)//tr">
1624
1818
  <xsl:variable name="td_text">
1625
1819
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1820
+
1821
+ <!-- <xsl:if test="$namespace = 'bipm'">
1822
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1823
+ <word><xsl:value-of select="normalize-space(.)"/></word>
1824
+ </xsl:for-each>
1825
+ </xsl:if> -->
1826
+
1626
1827
  </xsl:variable>
1627
1828
  <xsl:variable name="words">
1628
1829
  <xsl:variable name="string_with_added_zerospaces">
@@ -1682,13 +1883,31 @@
1682
1883
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1683
1884
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1684
1885
  <xsl:value-of select="@target"/>
1886
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1887
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
1888
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1685
1889
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1686
1890
  <xsl:param name="cols-count"/>
1687
1891
  <!-- font-weight="bold" -->
1688
- <fo:table-header>
1892
+ <fo:table-header>
1689
1893
 
1690
1894
  <xsl:apply-templates/>
1691
1895
  </fo:table-header>
1896
+ </xsl:template><xsl:template name="table-header-title">
1897
+ <xsl:param name="cols-count"/>
1898
+ <!-- row for title -->
1899
+ <fo:table-row>
1900
+ <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">
1901
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1902
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1903
+ <xsl:call-template name="fn_name_display"/>
1904
+ </xsl:for-each>
1905
+ <fo:block text-align="right" font-style="italic">
1906
+ <xsl:text> </xsl:text>
1907
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1908
+ </fo:block>
1909
+ </fo:table-cell>
1910
+ </fo:table-row>
1692
1911
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
1693
1912
  <fo:table-body>
1694
1913
  <xsl:apply-templates/>
@@ -1696,6 +1915,13 @@
1696
1915
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1697
1916
  <xsl:apply-templates/>
1698
1917
  </xsl:template><xsl:template name="insertTableFooter">
1918
+ <xsl:param name="cols-count"/>
1919
+ <xsl:if test="../*[local-name()='tfoot']">
1920
+ <fo:table-footer>
1921
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1922
+ </fo:table-footer>
1923
+ </xsl:if>
1924
+ </xsl:template><xsl:template name="insertTableFooter2">
1699
1925
  <xsl:param name="cols-count"/>
1700
1926
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1701
1927
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -1717,11 +1943,15 @@
1717
1943
  <!-- fn will be processed inside 'note' processing -->
1718
1944
 
1719
1945
 
1720
- <!-- except gb -->
1946
+
1947
+ <!-- except gb and bipm -->
1721
1948
 
1722
1949
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1723
1950
 
1724
1951
 
1952
+
1953
+
1954
+
1725
1955
  <!-- horizontal row separator -->
1726
1956
 
1727
1957
 
@@ -1735,6 +1965,84 @@
1735
1965
  </fo:table-footer>
1736
1966
 
1737
1967
  </xsl:if>
1968
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1969
+ <xsl:param name="table_attributes"/>
1970
+ <xsl:param name="colwidths"/>
1971
+
1972
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1973
+
1974
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1975
+
1976
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1977
+
1978
+ <fo:table keep-with-previous="always">
1979
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1980
+ <xsl:choose>
1981
+ <xsl:when test="@name = 'border-top'">
1982
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
1983
+ </xsl:when>
1984
+ <xsl:when test="@name = 'border'">
1985
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1986
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
1987
+ </xsl:when>
1988
+ <xsl:otherwise>
1989
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1990
+ </xsl:otherwise>
1991
+ </xsl:choose>
1992
+ </xsl:for-each>
1993
+
1994
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1995
+ <xsl:choose>
1996
+ <xsl:when test=". = 1 or . = 0">
1997
+ <fo:table-column column-width="proportional-column-width(2)"/>
1998
+ </xsl:when>
1999
+ <xsl:otherwise>
2000
+ <fo:table-column column-width="proportional-column-width({.})"/>
2001
+ </xsl:otherwise>
2002
+ </xsl:choose>
2003
+ </xsl:for-each>
2004
+
2005
+ <fo:table-body>
2006
+ <fo:table-row>
2007
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
2008
+
2009
+
2010
+
2011
+ <!-- fn will be processed inside 'note' processing -->
2012
+
2013
+
2014
+
2015
+ <!-- except gb and bipm -->
2016
+
2017
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2018
+
2019
+
2020
+ <!-- <xsl:if test="$namespace = 'bipm'">
2021
+ <xsl:choose>
2022
+ <xsl:when test="ancestor::*[local-name()='preface']">
2023
+ show Note under table in preface (ex. abstract) sections
2024
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2025
+ </xsl:when>
2026
+ <xsl:otherwise>
2027
+ empty, because notes show at page side in main sections
2028
+ <fo:block/>
2029
+ </xsl:otherwise>
2030
+ </xsl:choose>
2031
+ </xsl:if> -->
2032
+
2033
+
2034
+ <!-- horizontal row separator -->
2035
+
2036
+
2037
+ <!-- fn processing -->
2038
+ <xsl:call-template name="fn_display"/>
2039
+
2040
+ </fo:table-cell>
2041
+ </fo:table-row>
2042
+ </fo:table-body>
2043
+
2044
+ </fo:table>
2045
+ </xsl:if>
1738
2046
  </xsl:template><xsl:template match="*[local-name()='tbody']">
1739
2047
 
1740
2048
  <xsl:variable name="cols-count">
@@ -1752,6 +2060,8 @@
1752
2060
  </xsl:choose>
1753
2061
  </xsl:variable>
1754
2062
 
2063
+
2064
+
1755
2065
  <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
1756
2066
  <xsl:with-param name="cols-count" select="$cols-count"/>
1757
2067
  </xsl:apply-templates>
@@ -1761,6 +2071,8 @@
1761
2071
  </xsl:call-template>
1762
2072
 
1763
2073
  <fo:table-body>
2074
+
2075
+
1764
2076
  <xsl:apply-templates/>
1765
2077
  <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
1766
2078
 
@@ -1787,10 +2099,20 @@
1787
2099
  </xsl:if>
1788
2100
 
1789
2101
 
2102
+
2103
+
1790
2104
  <xsl:apply-templates/>
1791
2105
  </fo:table-row>
1792
2106
  </xsl:template><xsl:template match="*[local-name()='th']">
1793
2107
  <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
2108
+ <xsl:attribute name="text-align">
2109
+ <xsl:choose>
2110
+ <xsl:when test="@align">
2111
+ <xsl:value-of select="@align"/>
2112
+ </xsl:when>
2113
+ <xsl:otherwise>center</xsl:otherwise>
2114
+ </xsl:choose>
2115
+ </xsl:attribute>
1794
2116
 
1795
2117
 
1796
2118
 
@@ -1803,6 +2125,9 @@
1803
2125
 
1804
2126
 
1805
2127
 
2128
+
2129
+
2130
+
1806
2131
  <xsl:if test="@colspan">
1807
2132
  <xsl:attribute name="number-columns-spanned">
1808
2133
  <xsl:value-of select="@colspan"/>
@@ -1813,16 +2138,37 @@
1813
2138
  <xsl:value-of select="@rowspan"/>
1814
2139
  </xsl:attribute>
1815
2140
  </xsl:if>
2141
+ <xsl:call-template name="display-align"/>
1816
2142
  <fo:block>
1817
2143
  <xsl:apply-templates/>
1818
2144
  </fo:block>
1819
2145
  </fo:table-cell>
2146
+ </xsl:template><xsl:template name="display-align">
2147
+ <xsl:if test="@valign">
2148
+ <xsl:attribute name="display-align">
2149
+ <xsl:choose>
2150
+ <xsl:when test="@valign = 'top'">before</xsl:when>
2151
+ <xsl:when test="@valign = 'middle'">center</xsl:when>
2152
+ <xsl:when test="@valign = 'bottom'">after</xsl:when>
2153
+ <xsl:otherwise>before</xsl:otherwise>
2154
+ </xsl:choose>
2155
+ </xsl:attribute>
2156
+ </xsl:if>
1820
2157
  </xsl:template><xsl:template match="*[local-name()='td']">
1821
2158
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
2159
+ <xsl:attribute name="text-align">
2160
+ <xsl:choose>
2161
+ <xsl:when test="@align">
2162
+ <xsl:value-of select="@align"/>
2163
+ </xsl:when>
2164
+ <xsl:otherwise>left</xsl:otherwise>
2165
+ </xsl:choose>
2166
+ </xsl:attribute>
2167
+
2168
+
1822
2169
 
1823
2170
 
1824
2171
 
1825
-
1826
2172
 
1827
2173
 
1828
2174
 
@@ -1832,6 +2178,7 @@
1832
2178
  <xsl:attribute name="font-weight">normal</xsl:attribute>
1833
2179
  </xsl:if>
1834
2180
 
2181
+
1835
2182
  <xsl:if test="@colspan">
1836
2183
  <xsl:attribute name="number-columns-spanned">
1837
2184
  <xsl:value-of select="@colspan"/>
@@ -1842,8 +2189,8 @@
1842
2189
  <xsl:value-of select="@rowspan"/>
1843
2190
  </xsl:attribute>
1844
2191
  </xsl:if>
1845
- <fo:block>
1846
-
2192
+ <xsl:call-template name="display-align"/>
2193
+ <fo:block>
1847
2194
  <xsl:apply-templates/>
1848
2195
  </fo:block>
1849
2196
  </fo:table-cell>
@@ -1855,14 +2202,17 @@
1855
2202
 
1856
2203
 
1857
2204
 
2205
+
2206
+
1858
2207
  <fo:inline padding-right="2mm">
1859
2208
 
1860
2209
 
1861
2210
 
1862
-
2211
+
1863
2212
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1864
2213
 
1865
2214
  </fo:inline>
2215
+
1866
2216
  <xsl:apply-templates mode="process"/>
1867
2217
  </fo:block>
1868
2218
 
@@ -1886,6 +2236,7 @@
1886
2236
 
1887
2237
 
1888
2238
 
2239
+
1889
2240
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
1890
2241
 
1891
2242
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -1897,14 +2248,17 @@
1897
2248
 
1898
2249
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1899
2250
 
2251
+
1900
2252
  <xsl:value-of select="@reference"/>
1901
2253
 
2254
+
1902
2255
  </fo:inline>
1903
2256
  <fo:inline>
1904
2257
 
1905
2258
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1906
2259
 
1907
- <xsl:apply-templates/>
2260
+ <!-- <xsl:apply-templates /> -->
2261
+ <xsl:copy-of select="./node()"/>
1908
2262
  </fo:inline>
1909
2263
  </fo:block>
1910
2264
  </xsl:if>
@@ -1941,7 +2295,20 @@
1941
2295
  <xsl:variable name="following_dl_colwidths">
1942
2296
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
1943
2297
  <xsl:variable name="html-table">
1944
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2298
+ <xsl:variable name="doc_ns">
2299
+
2300
+ </xsl:variable>
2301
+ <xsl:variable name="ns">
2302
+ <xsl:choose>
2303
+ <xsl:when test="normalize-space($doc_ns) != ''">
2304
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2305
+ </xsl:when>
2306
+ <xsl:otherwise>
2307
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2308
+ </xsl:otherwise>
2309
+ </xsl:choose>
2310
+ </xsl:variable>
2311
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
1945
2312
  <xsl:element name="{$ns}:table">
1946
2313
  <xsl:for-each select="*[local-name() = 'dl'][1]">
1947
2314
  <tbody>
@@ -2006,7 +2373,8 @@
2006
2373
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
2007
2374
  </xsl:if>
2008
2375
 
2009
- <xsl:apply-templates/>
2376
+ <!-- <xsl:apply-templates /> -->
2377
+ <xsl:copy-of select="./node()"/>
2010
2378
  </fo:block>
2011
2379
  </fo:table-cell>
2012
2380
  </fo:table-row>
@@ -2023,15 +2391,19 @@
2023
2391
 
2024
2392
 
2025
2393
 
2394
+
2026
2395
  <xsl:attribute name="vertical-align">super</xsl:attribute>
2027
2396
  <xsl:attribute name="color">blue</xsl:attribute>
2028
2397
 
2029
2398
 
2030
2399
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
2031
2400
 
2401
+
2032
2402
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2033
2403
 
2404
+
2034
2405
  <xsl:value-of select="@reference"/>
2406
+
2035
2407
  </fo:basic-link>
2036
2408
  </fo:inline>
2037
2409
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -2039,123 +2411,150 @@
2039
2411
  <xsl:apply-templates/>
2040
2412
  </fo:inline>
2041
2413
  </xsl:template><xsl:template match="*[local-name()='dl']">
2042
- <xsl:variable name="parent" select="local-name(..)"/>
2043
-
2044
- <xsl:variable name="key_iso">
2045
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
2046
- </xsl:variable>
2047
-
2048
- <xsl:choose>
2049
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2050
-
2051
-
2052
- <fo:block margin-bottom="12pt" text-align="left">
2053
-
2054
- <xsl:variable name="title-where">
2055
- <xsl:call-template name="getTitle">
2056
- <xsl:with-param name="name" select="'title-where'"/>
2057
- </xsl:call-template>
2058
- </xsl:variable>
2059
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2060
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
2061
- <xsl:text/>
2062
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2063
- </fo:block>
2064
-
2065
- </xsl:when>
2066
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2067
- <fo:block margin-bottom="12pt" text-align="left">
2068
-
2069
-
2070
-
2071
-
2072
- <xsl:variable name="title-where">
2073
- <xsl:call-template name="getTitle">
2074
- <xsl:with-param name="name" select="'title-where'"/>
2075
- </xsl:call-template>
2076
- </xsl:variable>
2077
- <xsl:value-of select="$title-where"/>
2078
- </fo:block>
2079
- </xsl:when>
2080
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2081
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2082
-
2083
-
2084
-
2085
- <xsl:variable name="title-key">
2086
- <xsl:call-template name="getTitle">
2087
- <xsl:with-param name="name" select="'title-key'"/>
2088
- </xsl:call-template>
2089
- </xsl:variable>
2090
- <xsl:value-of select="$title-key"/>
2091
- </fo:block>
2092
- </xsl:when>
2093
- </xsl:choose>
2094
-
2095
- <!-- a few components -->
2096
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2097
- <fo:block>
2098
-
2414
+ <fo:block-container margin-left="0mm">
2415
+ <xsl:if test="parent::*[local-name() = 'note']">
2416
+ <xsl:attribute name="margin-left">
2417
+ <xsl:choose>
2418
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2419
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2420
+ </xsl:choose>
2421
+ </xsl:attribute>
2099
2422
 
2423
+ </xsl:if>
2424
+ <fo:block-container margin-left="0mm">
2425
+
2426
+ <xsl:variable name="parent" select="local-name(..)"/>
2100
2427
 
2101
- <xsl:if test="not(.//*[local-name()='dt']//*[local-name()='stem'])">
2102
- <xsl:attribute name="margin-left">5mm</xsl:attribute>
2103
- </xsl:if>
2428
+ <xsl:variable name="key_iso">
2429
+ <!-- and (not(../@class) or ../@class !='pseudocode') -->
2430
+ </xsl:variable>
2104
2431
 
2432
+ <xsl:choose>
2433
+ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2434
+
2435
+
2436
+ <fo:block margin-bottom="12pt" text-align="left">
2437
+
2438
+ <xsl:variable name="title-where">
2439
+ <xsl:call-template name="getTitle">
2440
+ <xsl:with-param name="name" select="'title-where'"/>
2441
+ </xsl:call-template>
2442
+ </xsl:variable>
2443
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2444
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
2445
+ <xsl:text/>
2446
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2447
+ </fo:block>
2448
+
2449
+ </xsl:when>
2450
+ <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2451
+ <fo:block margin-bottom="12pt" text-align="left">
2452
+
2453
+
2454
+
2455
+
2456
+ <xsl:variable name="title-where">
2457
+ <xsl:call-template name="getTitle">
2458
+ <xsl:with-param name="name" select="'title-where'"/>
2459
+ </xsl:call-template>
2460
+ </xsl:variable>
2461
+ <xsl:value-of select="$title-where"/>
2462
+ </fo:block>
2463
+ </xsl:when>
2464
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2465
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2466
+
2467
+
2468
+
2469
+ <xsl:variable name="title-key">
2470
+ <xsl:call-template name="getTitle">
2471
+ <xsl:with-param name="name" select="'title-key'"/>
2472
+ </xsl:call-template>
2473
+ </xsl:variable>
2474
+ <xsl:value-of select="$title-key"/>
2475
+ </fo:block>
2476
+ </xsl:when>
2477
+ </xsl:choose>
2105
2478
 
2106
- <fo:block>
2107
-
2108
- <xsl:if test="not(.//*[local-name()='dt']//*[local-name()='stem'])">
2109
- <xsl:attribute name="margin-left">-2.5mm</xsl:attribute>
2110
- </xsl:if>
2111
-
2112
-
2113
-
2114
-
2115
- <fo:table width="95%" table-layout="fixed">
2479
+ <!-- a few components -->
2480
+ <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2481
+ <fo:block>
2116
2482
 
2117
- <xsl:choose>
2118
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2119
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2120
- </xsl:when>
2121
- <xsl:when test="normalize-space($key_iso) = 'true'">
2122
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2483
+
2484
+
2485
+ <xsl:if test="not(.//*[local-name()='dt']//*[local-name()='stem'])">
2486
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
2487
+ </xsl:if>
2488
+
2489
+
2490
+ <fo:block>
2491
+
2492
+ <xsl:if test="not(.//*[local-name()='dt']//*[local-name()='stem'])">
2493
+ <xsl:attribute name="margin-left">-2.5mm</xsl:attribute>
2494
+ </xsl:if>
2495
+
2496
+
2497
+
2498
+
2499
+ <fo:table width="95%" table-layout="fixed">
2123
2500
 
2124
- </xsl:when>
2125
- </xsl:choose>
2126
- <!-- create virtual html table for dl/[dt and dd] -->
2127
- <xsl:variable name="html-table">
2128
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2129
- <xsl:element name="{$ns}:table">
2130
- <tbody>
2131
- <xsl:apply-templates mode="dl"/>
2132
- </tbody>
2133
- </xsl:element>
2134
- </xsl:variable>
2135
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
2136
- <xsl:variable name="colwidths">
2137
- <xsl:call-template name="calculate-column-widths">
2138
- <xsl:with-param name="cols-count" select="2"/>
2139
- <xsl:with-param name="table" select="$html-table"/>
2140
- </xsl:call-template>
2141
- </xsl:variable>
2142
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2143
- <xsl:variable name="maxlength_dt">
2144
- <xsl:call-template name="getMaxLength_dt"/>
2145
- </xsl:variable>
2146
- <xsl:call-template name="setColumnWidth_dl">
2147
- <xsl:with-param name="colwidths" select="$colwidths"/>
2148
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2149
- </xsl:call-template>
2150
- <fo:table-body>
2151
- <xsl:apply-templates>
2152
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2153
- </xsl:apply-templates>
2154
- </fo:table-body>
2155
- </fo:table>
2156
- </fo:block>
2157
- </fo:block>
2158
- </xsl:if>
2501
+ <xsl:choose>
2502
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2503
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2504
+ </xsl:when>
2505
+ <xsl:when test="normalize-space($key_iso) = 'true'">
2506
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2507
+
2508
+ </xsl:when>
2509
+ </xsl:choose>
2510
+ <!-- create virtual html table for dl/[dt and dd] -->
2511
+ <xsl:variable name="html-table">
2512
+ <xsl:variable name="doc_ns">
2513
+
2514
+ </xsl:variable>
2515
+ <xsl:variable name="ns">
2516
+ <xsl:choose>
2517
+ <xsl:when test="normalize-space($doc_ns) != ''">
2518
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2519
+ </xsl:when>
2520
+ <xsl:otherwise>
2521
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2522
+ </xsl:otherwise>
2523
+ </xsl:choose>
2524
+ </xsl:variable>
2525
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2526
+ <xsl:element name="{$ns}:table">
2527
+ <tbody>
2528
+ <xsl:apply-templates mode="dl"/>
2529
+ </tbody>
2530
+ </xsl:element>
2531
+ </xsl:variable>
2532
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
2533
+ <xsl:variable name="colwidths">
2534
+ <xsl:call-template name="calculate-column-widths">
2535
+ <xsl:with-param name="cols-count" select="2"/>
2536
+ <xsl:with-param name="table" select="$html-table"/>
2537
+ </xsl:call-template>
2538
+ </xsl:variable>
2539
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2540
+ <xsl:variable name="maxlength_dt">
2541
+ <xsl:call-template name="getMaxLength_dt"/>
2542
+ </xsl:variable>
2543
+ <xsl:call-template name="setColumnWidth_dl">
2544
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2545
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2546
+ </xsl:call-template>
2547
+ <fo:table-body>
2548
+ <xsl:apply-templates>
2549
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2550
+ </xsl:apply-templates>
2551
+ </fo:table-body>
2552
+ </fo:table>
2553
+ </fo:block>
2554
+ </fo:block>
2555
+ </xsl:if>
2556
+ </fo:block-container>
2557
+ </fo:block-container>
2159
2558
  </xsl:template><xsl:template name="setColumnWidth_dl">
2160
2559
  <xsl:param name="colwidths"/>
2161
2560
  <xsl:param name="maxlength_dt"/>
@@ -2265,6 +2664,7 @@
2265
2664
  <xsl:param name="key_iso"/>
2266
2665
 
2267
2666
  <fo:table-row>
2667
+
2268
2668
  <fo:table-cell>
2269
2669
 
2270
2670
  <fo:block margin-top="6pt">
@@ -2282,6 +2682,7 @@
2282
2682
 
2283
2683
 
2284
2684
 
2685
+
2285
2686
  <xsl:apply-templates/>
2286
2687
  <!-- <xsl:if test="$namespace = 'gb'">
2287
2688
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2293,16 +2694,18 @@
2293
2694
  <fo:table-cell>
2294
2695
  <fo:block>
2295
2696
 
2296
-
2697
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2297
2698
  <xsl:if test="local-name(*[1]) != 'stem'">
2298
2699
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2299
2700
  </xsl:if>
2701
+ </xsl:if> -->
2300
2702
 
2703
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2301
2704
 
2302
2705
  </fo:block>
2303
2706
  </fo:table-cell>
2304
2707
  </fo:table-row>
2305
-
2708
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2306
2709
  <xsl:if test="local-name(*[1]) = 'stem'">
2307
2710
  <fo:table-row>
2308
2711
  <fo:table-cell>
@@ -2310,7 +2713,7 @@
2310
2713
  <xsl:if test="normalize-space($key_iso) = 'true'">
2311
2714
  <xsl:attribute name="margin-top">0</xsl:attribute>
2312
2715
  </xsl:if>
2313
- <xsl:text> </xsl:text>
2716
+ <xsl:text>&#xA0;</xsl:text>
2314
2717
  </fo:block>
2315
2718
  </fo:table-cell>
2316
2719
  <fo:table-cell>
@@ -2320,7 +2723,7 @@
2320
2723
  </fo:table-cell>
2321
2724
  </fo:table-row>
2322
2725
  </xsl:if>
2323
-
2726
+ </xsl:if> -->
2324
2727
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2325
2728
  <xsl:apply-templates/>
2326
2729
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
@@ -2345,6 +2748,31 @@
2345
2748
  </fo:inline>
2346
2749
  </xsl:template><xsl:template match="*[local-name()='tt']">
2347
2750
  <fo:inline xsl:use-attribute-sets="tt-style">
2751
+ <xsl:variable name="_font-size">
2752
+
2753
+
2754
+
2755
+
2756
+
2757
+
2758
+
2759
+
2760
+
2761
+
2762
+
2763
+
2764
+
2765
+
2766
+ </xsl:variable>
2767
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
2768
+ <xsl:if test="$font-size != ''">
2769
+ <xsl:attribute name="font-size">
2770
+ <xsl:choose>
2771
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
2772
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
2773
+ </xsl:choose>
2774
+ </xsl:attribute>
2775
+ </xsl:if>
2348
2776
  <xsl:apply-templates/>
2349
2777
  </fo:inline>
2350
2778
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -2670,11 +3098,24 @@
2670
3098
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2671
3099
  <xsl:value-of select="substring($str, 2)"/>
2672
3100
  </xsl:template><xsl:template match="mathml:math">
2673
- <fo:inline font-family="STIX2Math">
2674
- <fo:instream-foreign-object fox:alt-text="Math">
2675
- <xsl:copy-of select="."/>
2676
- </fo:instream-foreign-object>
3101
+ <fo:inline font-family="STIX Two Math"> <!-- -->
3102
+ <xsl:variable name="mathml">
3103
+ <xsl:apply-templates select="." mode="mathml"/>
3104
+ </xsl:variable>
3105
+ <fo:instream-foreign-object fox:alt-text="Math">
3106
+ <!-- <xsl:copy-of select="."/> -->
3107
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
3108
+ </fo:instream-foreign-object>
2677
3109
  </fo:inline>
3110
+ </xsl:template><xsl:template match="@*|node()" mode="mathml">
3111
+ <xsl:copy>
3112
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
3113
+ </xsl:copy>
3114
+ </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
3115
+ <xsl:copy>
3116
+ <!-- replace start and end spaces to non-break space -->
3117
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3118
+ </xsl:copy>
2678
3119
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2679
3120
  <xsl:variable name="target">
2680
3121
  <xsl:choose>
@@ -2751,13 +3192,26 @@
2751
3192
  <xsl:apply-templates/>
2752
3193
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
2753
3194
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2754
-
3195
+
2755
3196
  <xsl:apply-templates/>
2756
3197
  </fo:basic-link>
2757
3198
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2758
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2759
- <xsl:apply-templates/>
2760
- </fo:block>
3199
+ <fo:block-container margin-left="0mm">
3200
+ <xsl:if test="parent::*[local-name() = 'note']">
3201
+ <xsl:attribute name="margin-left">
3202
+ <xsl:choose>
3203
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3204
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3205
+ </xsl:choose>
3206
+ </xsl:attribute>
3207
+
3208
+ </xsl:if>
3209
+ <fo:block-container margin-left="0mm">
3210
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
3211
+ <xsl:apply-templates/>
3212
+ </fo:block>
3213
+ </fo:block-container>
3214
+ </fo:block-container>
2761
3215
  </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2762
3216
  <fo:inline>
2763
3217
  <xsl:apply-templates/>
@@ -2817,7 +3271,9 @@
2817
3271
  </xsl:choose>
2818
3272
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2819
3273
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2820
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3274
+ <fo:inline xsl:use-attribute-sets="termnote-name-style">
3275
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3276
+ </fo:inline>
2821
3277
  <xsl:apply-templates/>
2822
3278
  </fo:block>
2823
3279
  </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">
@@ -2916,19 +3372,113 @@
2916
3372
 
2917
3373
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2918
3374
  </fo:block>
2919
- </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">
3375
+ </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">
2920
3376
  <xsl:apply-templates mode="contents"/>
2921
3377
  <xsl:text> </xsl:text>
2922
- </xsl:template><xsl:template match="text()" mode="contents">
3378
+ </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">
3379
+ <xsl:apply-templates mode="bookmarks"/>
3380
+ <xsl:text> </xsl:text>
3381
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
3382
+ <xsl:value-of select="."/>
3383
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
2923
3384
  <xsl:value-of select="."/>
2924
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3385
+ </xsl:template><xsl:template match="node()" mode="contents">
3386
+ <xsl:apply-templates mode="contents"/>
3387
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
3388
+ <xsl:apply-templates mode="bookmarks"/>
3389
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3390
+ <xsl:apply-templates select="."/>
3391
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3392
+ <xsl:apply-templates mode="bookmarks"/>
3393
+ </xsl:template><xsl:template name="addBookmarks">
3394
+ <xsl:param name="contents"/>
3395
+ <xsl:if test="xalan:nodeset($contents)//item">
3396
+ <fo:bookmark-tree>
3397
+ <xsl:choose>
3398
+ <xsl:when test="xalan:nodeset($contents)/doc">
3399
+ <xsl:choose>
3400
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3401
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3402
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3403
+ <fo:bookmark-title>
3404
+ <xsl:variable name="bookmark-title_">
3405
+ <xsl:call-template name="getLangVersion">
3406
+ <xsl:with-param name="lang" select="@lang"/>
3407
+ </xsl:call-template>
3408
+ </xsl:variable>
3409
+ <xsl:choose>
3410
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3411
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3412
+ </xsl:when>
3413
+ <xsl:otherwise>
3414
+ <xsl:choose>
3415
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3416
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3417
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3418
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3419
+ </xsl:choose>
3420
+ </xsl:otherwise>
3421
+ </xsl:choose>
3422
+ </fo:bookmark-title>
3423
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3424
+ </fo:bookmark>
3425
+
3426
+ </xsl:for-each>
3427
+ </xsl:when>
3428
+ <xsl:otherwise>
3429
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3430
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3431
+ </xsl:for-each>
3432
+ </xsl:otherwise>
3433
+ </xsl:choose>
3434
+ </xsl:when>
3435
+ <xsl:otherwise>
3436
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
3437
+ </xsl:otherwise>
3438
+ </xsl:choose>
3439
+
3440
+
3441
+
3442
+
3443
+
3444
+
3445
+
3446
+
3447
+ </fo:bookmark-tree>
3448
+ </xsl:if>
3449
+ </xsl:template><xsl:template name="getLangVersion">
3450
+ <xsl:param name="lang"/>
3451
+ <xsl:choose>
3452
+ <xsl:when test="$lang = 'en'">
3453
+
3454
+
3455
+ </xsl:when>
3456
+ <xsl:when test="$lang = 'fr'">
3457
+
3458
+
3459
+ </xsl:when>
3460
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3461
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3462
+ </xsl:choose>
3463
+ </xsl:template><xsl:template match="item" mode="bookmark">
3464
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
3465
+ <fo:bookmark-title>
3466
+ <xsl:if test="@section != ''">
3467
+ <xsl:value-of select="@section"/>
3468
+ <xsl:text> </xsl:text>
3469
+ </xsl:if>
3470
+ <xsl:value-of select="normalize-space(title)"/>
3471
+ </fo:bookmark-title>
3472
+ <xsl:apply-templates mode="bookmark"/>
3473
+ </fo:bookmark>
3474
+ </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">
2925
3475
  <xsl:if test="normalize-space() != ''">
2926
3476
  <fo:block xsl:use-attribute-sets="figure-name-style">
2927
3477
 
2928
3478
  <xsl:if test="nist:dl">
2929
3479
  <xsl:attribute name="space-before">12pt</xsl:attribute>
2930
3480
  </xsl:if>
2931
-
3481
+
2932
3482
  <xsl:apply-templates/>
2933
3483
  </fo:block>
2934
3484
  </xsl:if>
@@ -2983,7 +3533,7 @@
2983
3533
  <xsl:apply-templates/>
2984
3534
  </xsl:otherwise>
2985
3535
  </xsl:choose>
2986
- </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">
3536
+ </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">
2987
3537
  <xsl:text> </xsl:text>
2988
3538
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
2989
3539
  <xsl:copy>
@@ -2992,21 +3542,61 @@
2992
3542
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
2993
3543
  <xsl:text> </xsl:text>
2994
3544
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
2995
- <fo:block xsl:use-attribute-sets="sourcecode-style">
2996
- <xsl:apply-templates/>
2997
- </fo:block>
2998
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2999
- </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
3545
+
3546
+ <fo:block-container margin-left="0mm">
3547
+ <xsl:if test="parent::*[local-name() = 'note']">
3548
+ <xsl:attribute name="margin-left">
3549
+ <xsl:choose>
3550
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3551
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3552
+ </xsl:choose>
3553
+ </xsl:attribute>
3554
+
3555
+ </xsl:if>
3556
+ <fo:block-container margin-left="0mm">
3557
+
3558
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
3559
+ <xsl:variable name="_font-size">
3560
+
3561
+
3562
+
3563
+
3564
+
3565
+
3566
+
3567
+
3568
+
3569
+ 10
3570
+
3571
+
3572
+
3573
+
3574
+ </xsl:variable>
3575
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3576
+ <xsl:if test="$font-size != ''">
3577
+ <xsl:attribute name="font-size">
3578
+ <xsl:choose>
3579
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3580
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3581
+ </xsl:choose>
3582
+ </xsl:attribute>
3583
+ </xsl:if>
3584
+ <xsl:apply-templates/>
3585
+ </fo:block>
3586
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3587
+
3588
+ </fo:block-container>
3589
+ </fo:block-container>
3590
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
3000
3591
  <xsl:variable name="text">
3001
3592
  <xsl:call-template name="add-zero-spaces-equal"/>
3002
3593
  </xsl:variable>
3003
- <xsl:call-template name="add-zero-spaces">
3594
+ <xsl:call-template name="add-zero-spaces-java">
3004
3595
  <xsl:with-param name="text" select="$text"/>
3005
3596
  </xsl:call-template>
3006
3597
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
3007
3598
  <xsl:if test="normalize-space() != ''">
3008
- <fo:block xsl:use-attribute-sets="sourcecode-name-style">
3009
-
3599
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
3010
3600
  <xsl:apply-templates/>
3011
3601
  </fo:block>
3012
3602
  </xsl:if>
@@ -3074,6 +3664,145 @@
3074
3664
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
3075
3665
  <xsl:apply-templates/>
3076
3666
  </fo:block>
3667
+ </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3668
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
3669
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3670
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3671
+ </xsl:if>
3672
+ <fo:block-container margin-left="0mm" margin-right="0mm">
3673
+ <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
3674
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3675
+ <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
3676
+ </xsl:if>
3677
+ <xsl:variable name="simple-table">
3678
+ <xsl:call-template name="getSimpleTable"/>
3679
+ </xsl:variable>
3680
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
3681
+ <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
3682
+ <!-- <fo:table-column column-width="35mm"/>
3683
+ <fo:table-column column-width="115mm"/> -->
3684
+ <fo:table-column column-width="30%"/>
3685
+ <fo:table-column column-width="70%"/>
3686
+ </xsl:if>
3687
+ <xsl:apply-templates mode="requirement"/>
3688
+ </fo:table>
3689
+ <!-- fn processing -->
3690
+ <xsl:if test=".//*[local-name() = 'fn']">
3691
+ <xsl:for-each select="*[local-name() = 'tbody']">
3692
+ <fo:block font-size="90%" border-bottom="1pt solid black">
3693
+ <xsl:call-template name="fn_display"/>
3694
+ </fo:block>
3695
+ </xsl:for-each>
3696
+ </xsl:if>
3697
+ </fo:block-container>
3698
+ </fo:block-container>
3699
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="requirement">
3700
+ <fo:table-header>
3701
+ <xsl:apply-templates mode="requirement"/>
3702
+ </fo:table-header>
3703
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="requirement">
3704
+ <fo:table-body>
3705
+ <xsl:apply-templates mode="requirement"/>
3706
+ </fo:table-body>
3707
+ </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
3708
+ <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
3709
+ <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
3710
+ <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
3711
+ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
3712
+ </xsl:if>
3713
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
3714
+ <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
3715
+ </xsl:if>
3716
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
3717
+ <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
3718
+ </xsl:if>
3719
+ <xsl:apply-templates mode="requirement"/>
3720
+ </fo:table-row>
3721
+ </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
3722
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3723
+ <xsl:attribute name="text-align">
3724
+ <xsl:choose>
3725
+ <xsl:when test="@align">
3726
+ <xsl:value-of select="@align"/>
3727
+ </xsl:when>
3728
+ <xsl:otherwise>left</xsl:otherwise>
3729
+ </xsl:choose>
3730
+ </xsl:attribute>
3731
+ <xsl:if test="@colspan">
3732
+ <xsl:attribute name="number-columns-spanned">
3733
+ <xsl:value-of select="@colspan"/>
3734
+ </xsl:attribute>
3735
+ </xsl:if>
3736
+ <xsl:if test="@rowspan">
3737
+ <xsl:attribute name="number-rows-spanned">
3738
+ <xsl:value-of select="@rowspan"/>
3739
+ </xsl:attribute>
3740
+ </xsl:if>
3741
+ <xsl:call-template name="display-align"/>
3742
+
3743
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3744
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3745
+ <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
3746
+ </xsl:if>
3747
+ <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
3748
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3749
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3750
+ </xsl:if> -->
3751
+
3752
+ <fo:block>
3753
+ <xsl:apply-templates/>
3754
+ </fo:block>
3755
+ </fo:table-cell>
3756
+ </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
3757
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3758
+ <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3759
+ <xsl:attribute name="padding">0mm</xsl:attribute>
3760
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
3761
+ </xsl:if>
3762
+ <xsl:attribute name="text-align">
3763
+ <xsl:choose>
3764
+ <xsl:when test="@align">
3765
+ <xsl:value-of select="@align"/>
3766
+ </xsl:when>
3767
+ <xsl:otherwise>left</xsl:otherwise>
3768
+ </xsl:choose>
3769
+ </xsl:attribute>
3770
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
3771
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3772
+ </xsl:if>
3773
+ <xsl:if test="@colspan">
3774
+ <xsl:attribute name="number-columns-spanned">
3775
+ <xsl:value-of select="@colspan"/>
3776
+ </xsl:attribute>
3777
+ </xsl:if>
3778
+ <xsl:if test="@rowspan">
3779
+ <xsl:attribute name="number-rows-spanned">
3780
+ <xsl:value-of select="@rowspan"/>
3781
+ </xsl:attribute>
3782
+ </xsl:if>
3783
+ <xsl:call-template name="display-align"/>
3784
+
3785
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3786
+ <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
3787
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3788
+ <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
3789
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3790
+ </xsl:if>
3791
+ </xsl:if> -->
3792
+ <!-- 2nd line and below -->
3793
+
3794
+ <fo:block>
3795
+ <xsl:apply-templates/>
3796
+ </fo:block>
3797
+ </fo:table-cell>
3798
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
3799
+ <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
3800
+ <xsl:apply-templates/>
3801
+ </fo:block>
3802
+ </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
3803
+ <fo:block> <!-- margin-bottom="10pt" -->
3804
+ <xsl:apply-templates/>
3805
+ </fo:block>
3077
3806
  </xsl:template><xsl:template match="*[local-name() = 'termexample']">
3078
3807
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
3079
3808
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -3093,12 +3822,13 @@
3093
3822
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3094
3823
 
3095
3824
  <xsl:variable name="element">
3096
- block
3825
+ block
3097
3826
 
3827
+ <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
3098
3828
  </xsl:variable>
3099
3829
 
3100
3830
  <xsl:choose>
3101
- <xsl:when test="normalize-space($element) = 'block'">
3831
+ <xsl:when test="contains(normalize-space($element), 'block')">
3102
3832
  <fo:block xsl:use-attribute-sets="example-body-style">
3103
3833
  <xsl:apply-templates/>
3104
3834
  </fo:block>
@@ -3135,30 +3865,49 @@
3135
3865
  </xsl:otherwise>
3136
3866
  </xsl:choose>
3137
3867
 
3138
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3139
- <fo:block xsl:use-attribute-sets="example-p-style">
3140
-
3141
- <xsl:variable name="num"><xsl:number/></xsl:variable>
3142
- <xsl:if test="$num = 1">
3143
- <xsl:attribute name="margin-left">5mm</xsl:attribute>
3144
- </xsl:if>
3868
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3869
+
3870
+ <xsl:variable name="element">
3871
+ block
3145
3872
 
3146
- <xsl:apply-templates/>
3147
- </fo:block>
3873
+ </xsl:variable>
3874
+ <xsl:choose>
3875
+ <xsl:when test="normalize-space($element) = 'block'">
3876
+ <fo:block xsl:use-attribute-sets="example-p-style">
3877
+
3878
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
3879
+ <xsl:if test="$num = 1">
3880
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
3881
+ </xsl:if>
3882
+
3883
+ <xsl:apply-templates/>
3884
+ </fo:block>
3885
+ </xsl:when>
3886
+ <xsl:otherwise>
3887
+ <fo:inline xsl:use-attribute-sets="example-p-style">
3888
+ <xsl:apply-templates/>
3889
+ </fo:inline>
3890
+ </xsl:otherwise>
3891
+ </xsl:choose>
3148
3892
  </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3149
3893
  <fo:block xsl:use-attribute-sets="termsource-style">
3150
3894
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3151
3895
  <xsl:variable name="termsource_text">
3152
3896
  <xsl:apply-templates/>
3153
3897
  </xsl:variable>
3898
+
3154
3899
  <xsl:choose>
3155
3900
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3156
3901
  <xsl:apply-templates/>
3157
3902
  </xsl:when>
3158
- <xsl:otherwise>
3159
- <xsl:text>[</xsl:text>
3160
- <xsl:apply-templates/>
3161
- <xsl:text>]</xsl:text>
3903
+ <xsl:otherwise>
3904
+
3905
+ <xsl:text>[</xsl:text>
3906
+
3907
+ <xsl:apply-templates/>
3908
+
3909
+ <xsl:text>]</xsl:text>
3910
+
3162
3911
  </xsl:otherwise>
3163
3912
  </xsl:choose>
3164
3913
  </fo:block>
@@ -3179,18 +3928,29 @@
3179
3928
  <xsl:if test="normalize-space() != ''">
3180
3929
  <xsl:value-of select="."/>
3181
3930
  </xsl:if>
3182
- </xsl:template><xsl:template match="*[local-name() = 'quote']">
3931
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
3932
+ <fo:block-container margin-left="0mm">
3933
+ <xsl:if test="parent::*[local-name() = 'note']">
3934
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
3935
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
3936
+ </xsl:if>
3937
+ </xsl:if>
3938
+
3939
+ <fo:block-container margin-left="0mm">
3183
3940
 
3184
- <fo:block xsl:use-attribute-sets="quote-style">
3185
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3186
- </fo:block>
3187
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3188
- <fo:block xsl:use-attribute-sets="quote-source-style">
3189
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
3190
- <xsl:apply-templates select="*[local-name() = 'author']"/>
3191
- <xsl:apply-templates select="*[local-name() = 'source']"/>
3192
- </fo:block>
3193
- </xsl:if>
3941
+ <fo:block xsl:use-attribute-sets="quote-style">
3942
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3943
+ </fo:block>
3944
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3945
+ <fo:block xsl:use-attribute-sets="quote-source-style">
3946
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
3947
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
3948
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
3949
+ </fo:block>
3950
+ </xsl:if>
3951
+
3952
+ </fo:block-container>
3953
+ </fo:block-container>
3194
3954
  </xsl:template><xsl:template match="*[local-name() = 'source']">
3195
3955
  <xsl:if test="../*[local-name() = 'author']">
3196
3956
  <xsl:text>, </xsl:text>
@@ -3218,6 +3978,7 @@
3218
3978
  <xsl:if test="@type = 'inline'">
3219
3979
 
3220
3980
 
3981
+
3221
3982
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
3222
3983
 
3223
3984
  </xsl:if>
@@ -3257,6 +4018,7 @@
3257
4018
 
3258
4019
 
3259
4020
 
4021
+
3260
4022
  </xsl:variable>
3261
4023
 
3262
4024
  <xsl:variable name="padding-right">
@@ -3351,13 +4113,14 @@
3351
4113
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3352
4114
  <fo:block>
3353
4115
  <xsl:call-template name="setId"/>
4116
+
3354
4117
  <xsl:apply-templates/>
3355
4118
  </fo:block>
3356
4119
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3357
4120
  <fo:block id="{@id}">
3358
4121
  <xsl:apply-templates/>
3359
4122
  </fo:block>
3360
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@id = '_normative_references' or @id = '_references']">
4123
+ </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3361
4124
 
3362
4125
  <fo:block break-after="page"/>
3363
4126
 
@@ -3377,6 +4140,31 @@
3377
4140
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3378
4141
  <!-- 0xA0 to space replacement -->
3379
4142
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
4143
+ </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
4144
+ <xsl:choose>
4145
+ <xsl:when test="parent::*[local-name() = 'note']">
4146
+ <fo:block-container>
4147
+ <xsl:attribute name="margin-left">
4148
+ <xsl:choose>
4149
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
4150
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4151
+ </xsl:choose>
4152
+ </xsl:attribute>
4153
+
4154
+
4155
+ <fo:block-container margin-left="0mm">
4156
+ <fo:block>
4157
+ <xsl:apply-templates select="." mode="ul_ol"/>
4158
+ </fo:block>
4159
+ </fo:block-container>
4160
+ </fo:block-container>
4161
+ </xsl:when>
4162
+ <xsl:otherwise>
4163
+ <fo:block>
4164
+ <xsl:apply-templates select="." mode="ul_ol"/>
4165
+ </fo:block>
4166
+ </xsl:otherwise>
4167
+ </xsl:choose>
3380
4168
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3381
4169
  <!-- <row>
3382
4170
  <date>05-07-2013</date>
@@ -3408,6 +4196,65 @@
3408
4196
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3409
4197
  <fo:block><xsl:apply-templates/></fo:block>
3410
4198
  </fo:table-cell>
4199
+ </xsl:template><xsl:template name="processBibitem">
4200
+
4201
+
4202
+
4203
+
4204
+ </xsl:template><xsl:template name="processBibitemDocId">
4205
+ <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')]"/>
4206
+ <xsl:choose>
4207
+ <xsl:when test="normalize-space($_doc_ident) != ''">
4208
+ <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"/>
4209
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
4210
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4211
+ </xsl:if>
4212
+ <xsl:value-of select="$_doc_ident"/>
4213
+ </xsl:when>
4214
+ <xsl:otherwise>
4215
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
4216
+ <xsl:if test="$type != ''">
4217
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4218
+ </xsl:if>
4219
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
4220
+ </xsl:otherwise>
4221
+ </xsl:choose>
4222
+ </xsl:template><xsl:template name="processPersonalAuthor">
4223
+ <xsl:choose>
4224
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
4225
+ <author>
4226
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
4227
+ </author>
4228
+ </xsl:when>
4229
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
4230
+ <author>
4231
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
4232
+ <xsl:text> </xsl:text>
4233
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
4234
+ </author>
4235
+ </xsl:when>
4236
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
4237
+ <author>
4238
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
4239
+ <xsl:text> </xsl:text>
4240
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
4241
+ </author>
4242
+ </xsl:when>
4243
+ <xsl:otherwise>
4244
+ <xsl:apply-templates/>
4245
+ </xsl:otherwise>
4246
+ </xsl:choose>
4247
+ </xsl:template><xsl:template name="renderDate">
4248
+ <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
4249
+ <xsl:value-of select="*[local-name() = 'on']"/>
4250
+ </xsl:if>
4251
+ <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
4252
+ <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
4253
+ </xsl:if>
4254
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
4255
+ <xsl:value-of select="translate(.,'. ','')"/>
4256
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
4257
+ <xsl:value-of select="substring(.,1,1)"/>
3411
4258
  </xsl:template><xsl:template name="convertDate">
3412
4259
  <xsl:param name="date"/>
3413
4260
  <xsl:param name="format" select="'short'"/>
@@ -3490,6 +4337,7 @@
3490
4337
 
3491
4338
 
3492
4339
 
4340
+
3493
4341
 
3494
4342
  </xsl:variable>
3495
4343
  <xsl:choose>
@@ -3504,6 +4352,7 @@
3504
4352
  <dc:creator>
3505
4353
 
3506
4354
 
4355
+
3507
4356
  <xsl:for-each select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
3508
4357
  <xsl:value-of select="*[local-name() = 'person']/*[local-name() = 'name']/*[local-name() = 'completename']"/>
3509
4358
  <xsl:if test="position() != last()">; </xsl:if>
@@ -3518,6 +4367,7 @@
3518
4367
  <xsl:copy-of select="/*/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
3519
4368
 
3520
4369
 
4370
+
3521
4371
  </xsl:variable>
3522
4372
  <xsl:value-of select="normalize-space($abstract)"/>
3523
4373
  </dc:description>
@@ -3616,7 +4466,9 @@
3616
4466
 
3617
4467
 
3618
4468
 
3619
-
4469
+
4470
+
4471
+
3620
4472
  </xsl:variable>
3621
4473
  <xsl:if test="$documentNS != $XSLNS">
3622
4474
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3642,4 +4494,21 @@
3642
4494
  </xsl:otherwise>
3643
4495
  </xsl:choose>
3644
4496
  </xsl:attribute>
4497
+ </xsl:template><xsl:template name="add-letter-spacing">
4498
+ <xsl:param name="text"/>
4499
+ <xsl:param name="letter-spacing" select="'0.15'"/>
4500
+ <xsl:if test="string-length($text) &gt; 0">
4501
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
4502
+ <fo:inline padding-right="{$letter-spacing}mm">
4503
+ <xsl:if test="$char = '®'">
4504
+ <xsl:attribute name="font-size">58%</xsl:attribute>
4505
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4506
+ </xsl:if>
4507
+ <xsl:value-of select="$char"/>
4508
+ </fo:inline>
4509
+ <xsl:call-template name="add-letter-spacing">
4510
+ <xsl:with-param name="text" select="substring($text, 2)"/>
4511
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4512
+ </xsl:call-template>
4513
+ </xsl:if>
3645
4514
  </xsl:template></xsl:stylesheet>