metanorma-ribose 1.6.0 → 1.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,7 @@ module IsoDoc
16
16
  def make_body3(body, docxml)
17
17
  body.div **{ class: "main-section" } do |div3|
18
18
  boilerplate docxml, div3
19
+ preface_block docxml, div3
19
20
  abstract docxml, div3
20
21
  foreword docxml, div3
21
22
  executivesummary docxml, div3
@@ -37,21 +37,14 @@
37
37
  <xsl:variable name="contents">
38
38
  <contents>
39
39
 
40
+ <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:abstract" mode="contents"/>
41
+ <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:foreword" mode="contents"/>
42
+ <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:executivesummary" mode="contents"/>
40
43
  <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:introduction" mode="contents"/>
44
+ <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:clause" mode="contents"/>
45
+ <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:acknowledgements" mode="contents"/>
41
46
 
42
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:sections/rsd:clause[@id='_scope']" mode="contents"/>
43
-
44
- <!-- Normative references -->
45
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:bibliography/rsd:references[@id = '_normative_references' or @id = '_references']" mode="contents"/>
46
-
47
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:sections/rsd:terms" mode="contents"/> <!-- Terms and definitions -->
48
-
49
-
50
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:sections/*[local-name() != 'terms' and not(@id='_scope') ]" mode="contents"/>
51
-
52
-
53
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:annex" mode="contents"/>
54
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:bibliography/rsd:references[@id != '_normative_references' and @id != '_references']" mode="contents"/>
47
+ <xsl:call-template name="processMainSectionsDefault_Contents"/>
55
48
 
56
49
  </contents>
57
50
  </xsl:variable>
@@ -62,7 +55,7 @@
62
55
 
63
56
  <xsl:template match="/">
64
57
  <xsl:call-template name="namespaceCheck"/>
65
- <fo:root font-family="SourceSansPro-Light, STIX2Math" font-size="10.5pt" xml:lang="{$lang}">
58
+ <fo:root font-family="SourceSansPro-Light, STIX Two Math" font-size="10.5pt" xml:lang="{$lang}">
66
59
  <fo:layout-master-set>
67
60
 
68
61
  <fo:simple-page-master master-name="odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
@@ -98,6 +91,10 @@
98
91
 
99
92
  <xsl:call-template name="addPDFUAmeta"/>
100
93
 
94
+ <xsl:call-template name="addBookmarks">
95
+ <xsl:with-param name="contents" select="$contents"/>
96
+ </xsl:call-template>
97
+
101
98
  <fo:page-sequence master-reference="document" format="i" force-page-count="end-on-even">
102
99
  <fo:static-content flow-name="xsl-footnote-separator">
103
100
  <fo:block>
@@ -170,7 +167,7 @@
170
167
  </xsl:variable>
171
168
  <fo:block font-size="14pt" font-weight="bold" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
172
169
  <fo:block font-weight="bold" line-height="125%">
173
- <xsl:for-each select="xalan:nodeset($contents)//item">
170
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
174
171
  <fo:block>
175
172
  <xsl:if test="@level = 1">
176
173
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -191,9 +188,9 @@
191
188
  </fo:list-item-label>
192
189
  <fo:list-item-body start-indent="body-start()">
193
190
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
194
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
191
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
195
192
 
196
- <xsl:apply-templates/>
193
+ <xsl:apply-templates select="title"/>
197
194
 
198
195
  <fo:inline keep-together.within-line="always">
199
196
  <fo:leader leader-pattern="dots"/>
@@ -230,21 +227,14 @@
230
227
 
231
228
  <fo:block font-size="16pt" font-weight="bold" margin-bottom="18pt"><xsl:value-of select="$doctitle"/></fo:block>
232
229
 
233
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:introduction" mode="introduction"/>
230
+ <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:abstract"/>
231
+ <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:foreword"/>
232
+ <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:executivesummary"/>
233
+ <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:introduction"/>
234
+ <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:clause"/>
235
+ <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:acknowledgements"/>
234
236
 
235
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:sections/rsd:clause[@id='_scope']"/>
236
-
237
- <!-- Normative references -->
238
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:bibliography/rsd:references[@id = '_normative_references' or @id = '_references']"/>
239
-
240
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:sections/rsd:terms"/> <!-- Terms and definitions -->
241
-
242
-
243
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:sections/*[local-name() != 'terms' and not(@id='_scope') ]"/>
244
-
245
-
246
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:annex"/>
247
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:bibliography/rsd:references[@id != '_normative_references' and @id != '_references']"/>
237
+ <xsl:call-template name="processMainSectionsDefault"/>
248
238
 
249
239
  </fo:block>
250
240
  </fo:flow>
@@ -275,16 +265,22 @@
275
265
  </xsl:variable>
276
266
 
277
267
  <xsl:variable name="display">
278
- <xsl:choose>
279
- <xsl:when test="ancestor-or-self::rsd:bibitem">false</xsl:when>
280
- <xsl:when test="ancestor-or-self::rsd:term">false</xsl:when>
268
+ <xsl:choose>
281
269
  <xsl:when test="$level &gt;= 3">false</xsl:when>
282
270
  <xsl:otherwise>true</xsl:otherwise>
283
271
  </xsl:choose>
284
272
  </xsl:variable>
285
273
 
274
+ <xsl:variable name="skip">
275
+ <xsl:choose>
276
+ <xsl:when test="ancestor-or-self::rsd:bibitem">true</xsl:when>
277
+ <xsl:when test="ancestor-or-self::rsd:term">true</xsl:when>
278
+ <xsl:otherwise>false</xsl:otherwise>
279
+ </xsl:choose>
280
+ </xsl:variable>
281
+
286
282
 
287
- <xsl:if test="$display = 'true'">
283
+ <xsl:if test="$skip = 'false'">
288
284
 
289
285
  <xsl:variable name="section">
290
286
  <xsl:call-template name="getSection"/>
@@ -298,10 +294,13 @@
298
294
  <xsl:value-of select="local-name()"/>
299
295
  </xsl:variable>
300
296
 
301
- <item id="{@id}" level="{$level}" section="{$section}" type="{$type}">
302
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
297
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" display="{$display}">
298
+ <title>
299
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
300
+ </title>
301
+ <xsl:apply-templates mode="contents"/>
303
302
  </item>
304
- <xsl:apply-templates mode="contents"/>
303
+
305
304
  </xsl:if>
306
305
 
307
306
  </xsl:template>
@@ -380,25 +379,6 @@
380
379
  </xsl:template>
381
380
 
382
381
 
383
- <!-- Introduction -->
384
- <xsl:template match="rsd:rsd-standard/rsd:preface/rsd:introduction" mode="introduction">
385
- <fo:block break-after="page"/>
386
- <xsl:apply-templates select="current()"/>
387
- </xsl:template>
388
- <!-- Abstract -->
389
- <xsl:template match="rsd:rsd-standard/rsd:preface/rsd:abstract" mode="abstract">
390
- <fo:block break-after="page"/>
391
- <xsl:apply-templates select="current()"/>
392
- </xsl:template>
393
- <!-- Preface -->
394
- <xsl:template match="rsd:rsd-standard/rsd:preface/rsd:foreword" mode="preface">
395
- <fo:block break-after="page"/>
396
- <xsl:apply-templates select="current()"/>
397
- </xsl:template>
398
-
399
-
400
-
401
-
402
382
  <!-- ====== -->
403
383
  <!-- title -->
404
384
  <!-- ====== -->
@@ -624,7 +604,7 @@
624
604
  </xsl:template>
625
605
 
626
606
 
627
- <xsl:template match="rsd:references[@id != '_normative_references' and @id != '_references']/rsd:bibitem">
607
+ <xsl:template match="rsd:references[not(@normative='true')]/rsd:bibitem">
628
608
  <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="12mm">
629
609
  <fo:list-item>
630
610
  <fo:list-item-label end-indent="label-end()">
@@ -659,7 +639,7 @@
659
639
 
660
640
 
661
641
 
662
- <xsl:template match="rsd:ul | rsd:ol">
642
+ <xsl:template match="rsd:ul | rsd:ol" mode="ul_ol">
663
643
  <xsl:choose>
664
644
  <xsl:when test="not(ancestor::rsd:ul) and not(ancestor::rsd:ol)">
665
645
  <fo:block padding-bottom="12pt">
@@ -759,17 +739,17 @@
759
739
 
760
740
 
761
741
  <!-- [position() &gt; 1] -->
762
- <xsl:template match="rsd:references[@id != '_normative_references' and @id != '_references']">
742
+ <xsl:template match="rsd:references[not(@normative='true')]">
763
743
  <fo:block break-after="page"/>
764
744
  <fo:block id="{@id}">
765
745
  <xsl:apply-templates/>
766
746
  </fo:block>
767
747
  </xsl:template>
768
748
 
769
- <xsl:template match="rsd:references[@id != '_normative_references' and @id != '_references']/rsd:bibitem" mode="contents"/>
749
+ <xsl:template match="rsd:references[not(@normative='true')]/rsd:bibitem" mode="contents"/>
770
750
 
771
751
  <!-- <xsl:template match="rsd:references[@id = '_bibliography']/rsd:bibitem/rsd:title"> [position() &gt; 1]-->
772
- <xsl:template match="rsd:references[@id != '_normative_references' and @id != '_references']/rsd:bibitem/rsd:title">
752
+ <xsl:template match="rsd:references[not(@normative='true')]/rsd:bibitem/rsd:title">
773
753
  <fo:inline font-style="italic">
774
754
  <xsl:apply-templates/>
775
755
  </fo:inline>
@@ -931,6 +911,12 @@
931
911
 
932
912
  </title-edition>
933
913
 
914
+ <title-edition lang="fr">
915
+
916
+ <xsl:text>Édition </xsl:text>
917
+
918
+ </title-edition>
919
+
934
920
 
935
921
  <title-toc lang="en">
936
922
 
@@ -939,7 +925,12 @@
939
925
 
940
926
 
941
927
  </title-toc>
942
- <title-toc lang="fr">Sommaire</title-toc>
928
+ <title-toc lang="fr">
929
+
930
+ <xsl:text>Sommaire</xsl:text>
931
+
932
+
933
+ </title-toc>
943
934
 
944
935
  <title-toc lang="zh">Contents</title-toc>
945
936
 
@@ -973,7 +964,12 @@
973
964
 
974
965
 
975
966
 
976
- <title-source lang="en">SOURCE</title-source>
967
+ <title-source lang="en">
968
+
969
+ <xsl:text>SOURCE</xsl:text>
970
+
971
+
972
+ </title-source>
977
973
 
978
974
  <title-keywords lang="en">Keywords</title-keywords>
979
975
 
@@ -1016,12 +1012,25 @@
1016
1012
  <title-warning lang="zh">警告</title-warning>
1017
1013
 
1018
1014
  <title-amendment lang="en">AMENDMENT</title-amendment>
1015
+
1016
+ <title-continued lang="en">(continued)</title-continued>
1017
+ <title-continued lang="fr">(continué)</title-continued>
1018
+
1019
1019
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1020
1020
  <xsl:param name="name"/>
1021
- <xsl:variable name="lang">
1022
- <xsl:call-template name="getLang"/>
1021
+ <xsl:param name="lang"/>
1022
+ <xsl:variable name="lang_">
1023
+ <xsl:choose>
1024
+ <xsl:when test="$lang != ''">
1025
+ <xsl:value-of select="$lang"/>
1026
+ </xsl:when>
1027
+ <xsl:otherwise>
1028
+ <xsl:call-template name="getLang"/>
1029
+ </xsl:otherwise>
1030
+ </xsl:choose>
1023
1031
  </xsl:variable>
1024
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
1032
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
1033
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
1025
1034
  <xsl:choose>
1026
1035
  <xsl:when test="normalize-space($title_) != ''">
1027
1036
  <xsl:value-of select="$title_"/>
@@ -1030,19 +1039,21 @@
1030
1039
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
1031
1040
  </xsl:otherwise>
1032
1041
  </xsl:choose>
1033
- </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">
1042
+ </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">
1043
+
1044
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
1034
1045
 
1035
1046
  <xsl:attribute name="color">blue</xsl:attribute>
1036
1047
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1037
1048
 
1038
1049
 
1050
+
1039
1051
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1040
1052
  <xsl:attribute name="white-space">pre</xsl:attribute>
1041
1053
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
1042
1054
 
1043
1055
 
1044
- <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
1045
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1056
+ <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
1046
1057
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1047
1058
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1048
1059
  <xsl:attribute name="line-height">113%</xsl:attribute>
@@ -1053,6 +1064,7 @@
1053
1064
 
1054
1065
 
1055
1066
 
1067
+
1056
1068
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
1057
1069
 
1058
1070
  </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
@@ -1095,6 +1107,7 @@
1095
1107
 
1096
1108
 
1097
1109
 
1110
+
1098
1111
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1099
1112
  <xsl:attribute name="margin-left">12.5mm</xsl:attribute>
1100
1113
  <xsl:attribute name="margin-right">12.5mm</xsl:attribute>
@@ -1105,6 +1118,7 @@
1105
1118
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1106
1119
 
1107
1120
 
1121
+
1108
1122
  </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1109
1123
 
1110
1124
 
@@ -1118,6 +1132,7 @@
1118
1132
 
1119
1133
 
1120
1134
 
1135
+
1121
1136
  <xsl:attribute name="font-family">SourceSansPro</xsl:attribute>
1122
1137
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1123
1138
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1126,6 +1141,8 @@
1126
1141
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1127
1142
 
1128
1143
 
1144
+
1145
+
1129
1146
 
1130
1147
 
1131
1148
  </xsl:attribute-set><xsl:attribute-set name="example-p-style">
@@ -1142,6 +1159,8 @@
1142
1159
 
1143
1160
 
1144
1161
 
1162
+
1163
+
1145
1164
  </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
1146
1165
 
1147
1166
  <xsl:attribute name="padding-right">10mm</xsl:attribute>
@@ -1161,6 +1180,8 @@
1161
1180
 
1162
1181
 
1163
1182
 
1183
+
1184
+
1164
1185
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1165
1186
 
1166
1187
 
@@ -1183,7 +1204,8 @@
1183
1204
 
1184
1205
  <xsl:attribute name="color">blue</xsl:attribute>
1185
1206
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1186
-
1207
+
1208
+
1187
1209
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1188
1210
 
1189
1211
 
@@ -1191,6 +1213,7 @@
1191
1213
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1192
1214
 
1193
1215
 
1216
+
1194
1217
  </xsl:attribute-set><xsl:attribute-set name="note-style">
1195
1218
 
1196
1219
 
@@ -1202,6 +1225,7 @@
1202
1225
 
1203
1226
 
1204
1227
 
1228
+
1205
1229
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1206
1230
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1207
1231
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -1209,10 +1233,10 @@
1209
1233
 
1210
1234
 
1211
1235
 
1236
+ </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">
1212
1237
 
1213
1238
 
1214
1239
 
1215
- </xsl:attribute-set><xsl:attribute-set name="note-name-style">
1216
1240
 
1217
1241
 
1218
1242
 
@@ -1220,10 +1244,9 @@
1220
1244
 
1221
1245
 
1222
1246
 
1247
+ <xsl:attribute name="padding-right">4mm</xsl:attribute>
1223
1248
 
1224
1249
 
1225
- <xsl:attribute name="padding-right">4mm</xsl:attribute>
1226
-
1227
1250
 
1228
1251
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1229
1252
 
@@ -1251,6 +1274,8 @@
1251
1274
 
1252
1275
 
1253
1276
 
1277
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1278
+
1254
1279
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1255
1280
 
1256
1281
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1284,6 +1309,7 @@
1284
1309
  <xsl:attribute name="color">blue</xsl:attribute>
1285
1310
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1286
1311
 
1312
+
1287
1313
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1288
1314
 
1289
1315
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
@@ -1298,6 +1324,7 @@
1298
1324
 
1299
1325
 
1300
1326
 
1327
+
1301
1328
  <xsl:attribute name="font-family">SourceSansPro</xsl:attribute>
1302
1329
  <xsl:attribute name="font-size">12pt</xsl:attribute>
1303
1330
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -1310,7 +1337,7 @@
1310
1337
 
1311
1338
 
1312
1339
 
1313
-
1340
+
1314
1341
  </xsl:attribute-set><xsl:attribute-set name="formula-style">
1315
1342
 
1316
1343
  </xsl:attribute-set><xsl:attribute-set name="image-style">
@@ -1334,8 +1361,8 @@
1334
1361
 
1335
1362
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
1336
1363
 
1337
- <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
1338
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1364
+ <xsl:attribute name="font-family">SourceCodePro</xsl:attribute>
1365
+
1339
1366
 
1340
1367
 
1341
1368
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
@@ -1343,6 +1370,11 @@
1343
1370
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1344
1371
  <xsl:attribute name="text-align">center</xsl:attribute>
1345
1372
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1373
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1374
+
1375
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
1376
+ <xsl:attribute name="font-family">SourceSansPro</xsl:attribute>
1377
+
1346
1378
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
1347
1379
 
1348
1380
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -1355,7 +1387,43 @@
1355
1387
  <xsl:attribute name="space-after">6pt</xsl:attribute>
1356
1388
 
1357
1389
 
1358
- </xsl:attribute-set><xsl:template match="text()">
1390
+ </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
1391
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1392
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1393
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1394
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1395
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1396
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1397
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1398
+
1399
+ <!-- Normative references -->
1400
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1401
+ <!-- Terms and definitions -->
1402
+ <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"/>
1403
+ <!-- Another main sections -->
1404
+ <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"/>
1405
+ <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1406
+ <!-- Bibliography -->
1407
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1408
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1409
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1410
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1411
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1412
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1413
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1414
+ </xsl:template><xsl:template name="processMainSectionsDefault">
1415
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1416
+
1417
+ <!-- Normative references -->
1418
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
1419
+ <!-- Terms and definitions -->
1420
+ <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']]"/>
1421
+ <!-- Another main sections -->
1422
+ <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'])]"/>
1423
+ <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1424
+ <!-- Bibliography -->
1425
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1426
+ </xsl:template><xsl:template match="text()">
1359
1427
  <xsl:value-of select="."/>
1360
1428
  </xsl:template><xsl:template match="*[local-name()='br']">
1361
1429
  <xsl:value-of select="$linebreak"/>
@@ -1372,6 +1440,10 @@
1372
1440
 
1373
1441
 
1374
1442
 
1443
+
1444
+
1445
+ <!-- $namespace = 'iso' or -->
1446
+
1375
1447
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1376
1448
 
1377
1449
 
@@ -1405,6 +1477,7 @@
1405
1477
  <xsl:with-param name="table" select="$simple-table"/>
1406
1478
  </xsl:call-template>
1407
1479
  </xsl:variable>
1480
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1408
1481
 
1409
1482
  <!-- <xsl:variable name="colwidths2">
1410
1483
  <xsl:call-template name="calculate-column-widths">
@@ -1426,23 +1499,49 @@
1426
1499
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1427
1500
 
1428
1501
 
1502
+
1503
+
1504
+
1505
+
1506
+
1507
+
1429
1508
 
1430
1509
 
1431
1510
 
1432
1511
 
1433
1512
 
1434
1513
 
1435
- <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">
1436
-
1437
-
1514
+
1515
+ <xsl:variable name="table_attributes">
1516
+ <attribute name="table-layout">fixed</attribute>
1517
+ <attribute name="width">100%</attribute>
1518
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1519
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1438
1520
 
1439
1521
 
1440
1522
 
1441
1523
 
1524
+
1525
+
1526
+
1442
1527
 
1528
+
1443
1529
 
1530
+ </xsl:variable>
1531
+
1532
+
1533
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1444
1534
 
1535
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1536
+ <xsl:attribute name="{@name}">
1537
+ <xsl:value-of select="."/>
1538
+ </xsl:attribute>
1539
+ </xsl:for-each>
1445
1540
 
1541
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1542
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1543
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1544
+ </xsl:if>
1446
1545
 
1447
1546
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1448
1547
  <xsl:choose>
@@ -1466,6 +1565,33 @@
1466
1565
 
1467
1566
  </fo:table>
1468
1567
 
1568
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1569
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1570
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1571
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1572
+ </xsl:call-template>
1573
+ </xsl:for-each>
1574
+
1575
+ <!-- insert footer as table -->
1576
+ <!-- <fo:table>
1577
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1578
+ <xsl:attribute name="{@name}">
1579
+ <xsl:value-of select="."/>
1580
+ </xsl:attribute>
1581
+ </xsl:for-each>
1582
+
1583
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1584
+ <xsl:choose>
1585
+ <xsl:when test=". = 1 or . = 0">
1586
+ <fo:table-column column-width="proportional-column-width(2)"/>
1587
+ </xsl:when>
1588
+ <xsl:otherwise>
1589
+ <fo:table-column column-width="proportional-column-width({.})"/>
1590
+ </xsl:otherwise>
1591
+ </xsl:choose>
1592
+ </xsl:for-each>
1593
+ </fo:table>-->
1594
+
1469
1595
 
1470
1596
 
1471
1597
 
@@ -1474,8 +1600,9 @@
1474
1600
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1475
1601
  <xsl:if test="normalize-space() != ''">
1476
1602
  <fo:block xsl:use-attribute-sets="table-name-style">
1477
- <xsl:apply-templates/>
1478
- </fo:block>
1603
+
1604
+ <xsl:apply-templates/>
1605
+ </fo:block>
1479
1606
  </xsl:if>
1480
1607
  </xsl:template><xsl:template name="calculate-columns-numbers">
1481
1608
  <xsl:param name="table-row"/>
@@ -1529,6 +1656,13 @@
1529
1656
  <xsl:for-each select="xalan:nodeset($table)//tr">
1530
1657
  <xsl:variable name="td_text">
1531
1658
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1659
+
1660
+ <!-- <xsl:if test="$namespace = 'bipm'">
1661
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1662
+ <word><xsl:value-of select="normalize-space(.)"/></word>
1663
+ </xsl:for-each>
1664
+ </xsl:if> -->
1665
+
1532
1666
  </xsl:variable>
1533
1667
  <xsl:variable name="words">
1534
1668
  <xsl:variable name="string_with_added_zerospaces">
@@ -1588,13 +1722,31 @@
1588
1722
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1589
1723
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1590
1724
  <xsl:value-of select="@target"/>
1725
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1726
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
1727
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1591
1728
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1592
1729
  <xsl:param name="cols-count"/>
1593
1730
  <!-- font-weight="bold" -->
1594
- <fo:table-header>
1731
+ <fo:table-header>
1595
1732
 
1596
1733
  <xsl:apply-templates/>
1597
1734
  </fo:table-header>
1735
+ </xsl:template><xsl:template name="table-header-title">
1736
+ <xsl:param name="cols-count"/>
1737
+ <!-- row for title -->
1738
+ <fo:table-row>
1739
+ <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">
1740
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1741
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1742
+ <xsl:call-template name="fn_name_display"/>
1743
+ </xsl:for-each>
1744
+ <fo:block text-align="right" font-style="italic">
1745
+ <xsl:text> </xsl:text>
1746
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1747
+ </fo:block>
1748
+ </fo:table-cell>
1749
+ </fo:table-row>
1598
1750
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
1599
1751
  <fo:table-body>
1600
1752
  <xsl:apply-templates/>
@@ -1602,6 +1754,13 @@
1602
1754
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1603
1755
  <xsl:apply-templates/>
1604
1756
  </xsl:template><xsl:template name="insertTableFooter">
1757
+ <xsl:param name="cols-count"/>
1758
+ <xsl:if test="../*[local-name()='tfoot']">
1759
+ <fo:table-footer>
1760
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1761
+ </fo:table-footer>
1762
+ </xsl:if>
1763
+ </xsl:template><xsl:template name="insertTableFooter2">
1605
1764
  <xsl:param name="cols-count"/>
1606
1765
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1607
1766
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -1623,11 +1782,15 @@
1623
1782
  <!-- fn will be processed inside 'note' processing -->
1624
1783
 
1625
1784
 
1626
- <!-- except gb -->
1785
+
1786
+ <!-- except gb and bipm -->
1627
1787
 
1628
1788
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1629
1789
 
1630
1790
 
1791
+
1792
+
1793
+
1631
1794
  <!-- horizontal row separator -->
1632
1795
 
1633
1796
 
@@ -1641,6 +1804,84 @@
1641
1804
  </fo:table-footer>
1642
1805
 
1643
1806
  </xsl:if>
1807
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1808
+ <xsl:param name="table_attributes"/>
1809
+ <xsl:param name="colwidths"/>
1810
+
1811
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1812
+
1813
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1814
+
1815
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1816
+
1817
+ <fo:table keep-with-previous="always">
1818
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1819
+ <xsl:choose>
1820
+ <xsl:when test="@name = 'border-top'">
1821
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
1822
+ </xsl:when>
1823
+ <xsl:when test="@name = 'border'">
1824
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1825
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
1826
+ </xsl:when>
1827
+ <xsl:otherwise>
1828
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1829
+ </xsl:otherwise>
1830
+ </xsl:choose>
1831
+ </xsl:for-each>
1832
+
1833
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1834
+ <xsl:choose>
1835
+ <xsl:when test=". = 1 or . = 0">
1836
+ <fo:table-column column-width="proportional-column-width(2)"/>
1837
+ </xsl:when>
1838
+ <xsl:otherwise>
1839
+ <fo:table-column column-width="proportional-column-width({.})"/>
1840
+ </xsl:otherwise>
1841
+ </xsl:choose>
1842
+ </xsl:for-each>
1843
+
1844
+ <fo:table-body>
1845
+ <fo:table-row>
1846
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
1847
+
1848
+
1849
+
1850
+ <!-- fn will be processed inside 'note' processing -->
1851
+
1852
+
1853
+
1854
+ <!-- except gb and bipm -->
1855
+
1856
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1857
+
1858
+
1859
+ <!-- <xsl:if test="$namespace = 'bipm'">
1860
+ <xsl:choose>
1861
+ <xsl:when test="ancestor::*[local-name()='preface']">
1862
+ show Note under table in preface (ex. abstract) sections
1863
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1864
+ </xsl:when>
1865
+ <xsl:otherwise>
1866
+ empty, because notes show at page side in main sections
1867
+ <fo:block/>
1868
+ </xsl:otherwise>
1869
+ </xsl:choose>
1870
+ </xsl:if> -->
1871
+
1872
+
1873
+ <!-- horizontal row separator -->
1874
+
1875
+
1876
+ <!-- fn processing -->
1877
+ <xsl:call-template name="fn_display"/>
1878
+
1879
+ </fo:table-cell>
1880
+ </fo:table-row>
1881
+ </fo:table-body>
1882
+
1883
+ </fo:table>
1884
+ </xsl:if>
1644
1885
  </xsl:template><xsl:template match="*[local-name()='tbody']">
1645
1886
 
1646
1887
  <xsl:variable name="cols-count">
@@ -1658,6 +1899,8 @@
1658
1899
  </xsl:choose>
1659
1900
  </xsl:variable>
1660
1901
 
1902
+
1903
+
1661
1904
  <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
1662
1905
  <xsl:with-param name="cols-count" select="$cols-count"/>
1663
1906
  </xsl:apply-templates>
@@ -1667,6 +1910,8 @@
1667
1910
  </xsl:call-template>
1668
1911
 
1669
1912
  <fo:table-body>
1913
+
1914
+
1670
1915
  <xsl:apply-templates/>
1671
1916
  <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
1672
1917
 
@@ -1690,10 +1935,23 @@
1690
1935
  </xsl:if>
1691
1936
 
1692
1937
 
1938
+
1939
+
1693
1940
  <xsl:apply-templates/>
1694
1941
  </fo:table-row>
1695
1942
  </xsl:template><xsl:template match="*[local-name()='th']">
1696
1943
  <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
1944
+ <xsl:attribute name="text-align">
1945
+ <xsl:choose>
1946
+ <xsl:when test="@align">
1947
+ <xsl:value-of select="@align"/>
1948
+ </xsl:when>
1949
+ <xsl:otherwise>center</xsl:otherwise>
1950
+ </xsl:choose>
1951
+ </xsl:attribute>
1952
+
1953
+
1954
+
1697
1955
 
1698
1956
 
1699
1957
 
@@ -1712,16 +1970,38 @@
1712
1970
  <xsl:value-of select="@rowspan"/>
1713
1971
  </xsl:attribute>
1714
1972
  </xsl:if>
1973
+ <xsl:call-template name="display-align"/>
1715
1974
  <fo:block>
1716
1975
  <xsl:apply-templates/>
1717
1976
  </fo:block>
1718
1977
  </fo:table-cell>
1978
+ </xsl:template><xsl:template name="display-align">
1979
+ <xsl:if test="@valign">
1980
+ <xsl:attribute name="display-align">
1981
+ <xsl:choose>
1982
+ <xsl:when test="@valign = 'top'">before</xsl:when>
1983
+ <xsl:when test="@valign = 'middle'">center</xsl:when>
1984
+ <xsl:when test="@valign = 'bottom'">after</xsl:when>
1985
+ <xsl:otherwise>before</xsl:otherwise>
1986
+ </xsl:choose>
1987
+ </xsl:attribute>
1988
+ </xsl:if>
1719
1989
  </xsl:template><xsl:template match="*[local-name()='td']">
1720
1990
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
1991
+ <xsl:attribute name="text-align">
1992
+ <xsl:choose>
1993
+ <xsl:when test="@align">
1994
+ <xsl:value-of select="@align"/>
1995
+ </xsl:when>
1996
+ <xsl:otherwise>left</xsl:otherwise>
1997
+ </xsl:choose>
1998
+ </xsl:attribute>
1999
+
2000
+
2001
+
1721
2002
 
1722
2003
 
1723
2004
 
1724
-
1725
2005
 
1726
2006
 
1727
2007
 
@@ -1737,8 +2017,8 @@
1737
2017
  <xsl:value-of select="@rowspan"/>
1738
2018
  </xsl:attribute>
1739
2019
  </xsl:if>
1740
- <fo:block>
1741
-
2020
+ <xsl:call-template name="display-align"/>
2021
+ <fo:block>
1742
2022
  <xsl:apply-templates/>
1743
2023
  </fo:block>
1744
2024
  </fo:table-cell>
@@ -1750,14 +2030,17 @@
1750
2030
 
1751
2031
 
1752
2032
 
2033
+
2034
+
1753
2035
  <fo:inline padding-right="2mm">
1754
2036
 
1755
2037
 
1756
2038
 
1757
-
2039
+
1758
2040
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1759
2041
 
1760
2042
  </fo:inline>
2043
+
1761
2044
  <xsl:apply-templates mode="process"/>
1762
2045
  </fo:block>
1763
2046
 
@@ -1781,6 +2064,7 @@
1781
2064
 
1782
2065
 
1783
2066
 
2067
+
1784
2068
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
1785
2069
 
1786
2070
 
@@ -1788,12 +2072,15 @@
1788
2072
 
1789
2073
 
1790
2074
 
2075
+
1791
2076
  <xsl:value-of select="@reference"/>
1792
2077
 
2078
+
1793
2079
  </fo:inline>
1794
2080
  <fo:inline>
1795
2081
 
1796
- <xsl:apply-templates/>
2082
+ <!-- <xsl:apply-templates /> -->
2083
+ <xsl:copy-of select="./node()"/>
1797
2084
  </fo:inline>
1798
2085
  </fo:block>
1799
2086
  </xsl:if>
@@ -1830,7 +2117,20 @@
1830
2117
  <xsl:variable name="following_dl_colwidths">
1831
2118
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
1832
2119
  <xsl:variable name="html-table">
1833
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2120
+ <xsl:variable name="doc_ns">
2121
+
2122
+ </xsl:variable>
2123
+ <xsl:variable name="ns">
2124
+ <xsl:choose>
2125
+ <xsl:when test="normalize-space($doc_ns) != ''">
2126
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2127
+ </xsl:when>
2128
+ <xsl:otherwise>
2129
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2130
+ </xsl:otherwise>
2131
+ </xsl:choose>
2132
+ </xsl:variable>
2133
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
1834
2134
  <xsl:element name="{$ns}:table">
1835
2135
  <xsl:for-each select="*[local-name() = 'dl'][1]">
1836
2136
  <tbody>
@@ -1895,7 +2195,8 @@
1895
2195
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
1896
2196
  </xsl:if>
1897
2197
 
1898
- <xsl:apply-templates/>
2198
+ <!-- <xsl:apply-templates /> -->
2199
+ <xsl:copy-of select="./node()"/>
1899
2200
  </fo:block>
1900
2201
  </fo:table-cell>
1901
2202
  </fo:table-row>
@@ -1913,9 +2214,13 @@
1913
2214
 
1914
2215
 
1915
2216
 
2217
+
2218
+
1916
2219
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
1917
2220
 
2221
+
1918
2222
  <xsl:value-of select="@reference"/>
2223
+
1919
2224
  </fo:basic-link>
1920
2225
  </fo:inline>
1921
2226
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -1923,102 +2228,142 @@
1923
2228
  <xsl:apply-templates/>
1924
2229
  </fo:inline>
1925
2230
  </xsl:template><xsl:template match="*[local-name()='dl']">
1926
- <xsl:variable name="parent" select="local-name(..)"/>
1927
-
1928
- <xsl:variable name="key_iso">
1929
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
1930
- </xsl:variable>
1931
-
1932
- <xsl:choose>
1933
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
1934
-
1935
-
1936
- </xsl:when>
1937
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
1938
- <fo:block margin-bottom="12pt" text-align="left">
1939
-
1940
-
1941
-
1942
-
1943
- <xsl:variable name="title-where">
1944
- <xsl:call-template name="getTitle">
1945
- <xsl:with-param name="name" select="'title-where'"/>
1946
- </xsl:call-template>
1947
- </xsl:variable>
1948
- <xsl:value-of select="$title-where"/>
1949
- </fo:block>
1950
- </xsl:when>
1951
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
1952
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
1953
-
1954
-
1955
-
1956
- <xsl:variable name="title-key">
1957
- <xsl:call-template name="getTitle">
1958
- <xsl:with-param name="name" select="'title-key'"/>
1959
- </xsl:call-template>
1960
- </xsl:variable>
1961
- <xsl:value-of select="$title-key"/>
1962
- </fo:block>
1963
- </xsl:when>
1964
- </xsl:choose>
1965
-
1966
- <!-- a few components -->
1967
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
1968
- <fo:block>
2231
+ <fo:block-container margin-left="0mm">
2232
+ <xsl:if test="parent::*[local-name() = 'note']">
2233
+ <xsl:attribute name="margin-left">
2234
+ <xsl:choose>
2235
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2236
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2237
+ </xsl:choose>
2238
+ </xsl:attribute>
1969
2239
 
2240
+ </xsl:if>
2241
+ <fo:block-container margin-left="0mm">
2242
+
2243
+ <xsl:variable name="parent" select="local-name(..)"/>
1970
2244
 
2245
+ <xsl:variable name="key_iso">
2246
+ <!-- and (not(../@class) or ../@class !='pseudocode') -->
2247
+ </xsl:variable>
1971
2248
 
2249
+ <xsl:choose>
2250
+ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2251
+
2252
+
2253
+ <fo:block margin-bottom="12pt" text-align="left">
2254
+
2255
+ <xsl:variable name="title-where">
2256
+ <xsl:call-template name="getTitle">
2257
+ <xsl:with-param name="name" select="'title-where'"/>
2258
+ </xsl:call-template>
2259
+ </xsl:variable>
2260
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2261
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
2262
+ <xsl:text/>
2263
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2264
+ </fo:block>
2265
+
2266
+ </xsl:when>
2267
+ <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2268
+ <fo:block margin-bottom="12pt" text-align="left">
2269
+
2270
+
2271
+
2272
+
2273
+ <xsl:variable name="title-where">
2274
+ <xsl:call-template name="getTitle">
2275
+ <xsl:with-param name="name" select="'title-where'"/>
2276
+ </xsl:call-template>
2277
+ </xsl:variable>
2278
+ <xsl:value-of select="$title-where"/>
2279
+ </fo:block>
2280
+ </xsl:when>
2281
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2282
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2283
+
2284
+
2285
+
2286
+ <xsl:variable name="title-key">
2287
+ <xsl:call-template name="getTitle">
2288
+ <xsl:with-param name="name" select="'title-key'"/>
2289
+ </xsl:call-template>
2290
+ </xsl:variable>
2291
+ <xsl:value-of select="$title-key"/>
2292
+ </fo:block>
2293
+ </xsl:when>
2294
+ </xsl:choose>
1972
2295
 
1973
- <fo:block>
1974
-
1975
-
1976
-
1977
-
1978
- <fo:table width="95%" table-layout="fixed">
2296
+ <!-- a few components -->
2297
+ <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2298
+ <fo:block>
1979
2299
 
1980
- <xsl:choose>
1981
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
1982
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
1983
- </xsl:when>
1984
- <xsl:when test="normalize-space($key_iso) = 'true'">
1985
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2300
+
2301
+
2302
+
2303
+ <fo:block>
2304
+
2305
+
2306
+
2307
+
2308
+ <fo:table width="95%" table-layout="fixed">
1986
2309
 
1987
- </xsl:when>
1988
- </xsl:choose>
1989
- <!-- create virtual html table for dl/[dt and dd] -->
1990
- <xsl:variable name="html-table">
1991
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
1992
- <xsl:element name="{$ns}:table">
1993
- <tbody>
1994
- <xsl:apply-templates mode="dl"/>
1995
- </tbody>
1996
- </xsl:element>
1997
- </xsl:variable>
1998
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
1999
- <xsl:variable name="colwidths">
2000
- <xsl:call-template name="calculate-column-widths">
2001
- <xsl:with-param name="cols-count" select="2"/>
2002
- <xsl:with-param name="table" select="$html-table"/>
2003
- </xsl:call-template>
2004
- </xsl:variable>
2005
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2006
- <xsl:variable name="maxlength_dt">
2007
- <xsl:call-template name="getMaxLength_dt"/>
2008
- </xsl:variable>
2009
- <xsl:call-template name="setColumnWidth_dl">
2010
- <xsl:with-param name="colwidths" select="$colwidths"/>
2011
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2012
- </xsl:call-template>
2013
- <fo:table-body>
2014
- <xsl:apply-templates>
2015
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2016
- </xsl:apply-templates>
2017
- </fo:table-body>
2018
- </fo:table>
2019
- </fo:block>
2020
- </fo:block>
2021
- </xsl:if>
2310
+ <xsl:choose>
2311
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2312
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2313
+ </xsl:when>
2314
+ <xsl:when test="normalize-space($key_iso) = 'true'">
2315
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2316
+
2317
+ </xsl:when>
2318
+ </xsl:choose>
2319
+ <!-- create virtual html table for dl/[dt and dd] -->
2320
+ <xsl:variable name="html-table">
2321
+ <xsl:variable name="doc_ns">
2322
+
2323
+ </xsl:variable>
2324
+ <xsl:variable name="ns">
2325
+ <xsl:choose>
2326
+ <xsl:when test="normalize-space($doc_ns) != ''">
2327
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2328
+ </xsl:when>
2329
+ <xsl:otherwise>
2330
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2331
+ </xsl:otherwise>
2332
+ </xsl:choose>
2333
+ </xsl:variable>
2334
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2335
+ <xsl:element name="{$ns}:table">
2336
+ <tbody>
2337
+ <xsl:apply-templates mode="dl"/>
2338
+ </tbody>
2339
+ </xsl:element>
2340
+ </xsl:variable>
2341
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
2342
+ <xsl:variable name="colwidths">
2343
+ <xsl:call-template name="calculate-column-widths">
2344
+ <xsl:with-param name="cols-count" select="2"/>
2345
+ <xsl:with-param name="table" select="$html-table"/>
2346
+ </xsl:call-template>
2347
+ </xsl:variable>
2348
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2349
+ <xsl:variable name="maxlength_dt">
2350
+ <xsl:call-template name="getMaxLength_dt"/>
2351
+ </xsl:variable>
2352
+ <xsl:call-template name="setColumnWidth_dl">
2353
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2354
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2355
+ </xsl:call-template>
2356
+ <fo:table-body>
2357
+ <xsl:apply-templates>
2358
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2359
+ </xsl:apply-templates>
2360
+ </fo:table-body>
2361
+ </fo:table>
2362
+ </fo:block>
2363
+ </fo:block>
2364
+ </xsl:if>
2365
+ </fo:block-container>
2366
+ </fo:block-container>
2022
2367
  </xsl:template><xsl:template name="setColumnWidth_dl">
2023
2368
  <xsl:param name="colwidths"/>
2024
2369
  <xsl:param name="maxlength_dt"/>
@@ -2106,6 +2451,8 @@
2106
2451
  <td>
2107
2452
 
2108
2453
 
2454
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2455
+
2109
2456
  </td>
2110
2457
  </tr>
2111
2458
 
@@ -2113,6 +2460,7 @@
2113
2460
  <xsl:param name="key_iso"/>
2114
2461
 
2115
2462
  <fo:table-row>
2463
+
2116
2464
  <fo:table-cell>
2117
2465
 
2118
2466
  <fo:block margin-top="6pt">
@@ -2127,6 +2475,7 @@
2127
2475
 
2128
2476
 
2129
2477
 
2478
+
2130
2479
  <xsl:apply-templates/>
2131
2480
  <!-- <xsl:if test="$namespace = 'gb'">
2132
2481
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2138,12 +2487,36 @@
2138
2487
  <fo:table-cell>
2139
2488
  <fo:block>
2140
2489
 
2490
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2491
+ <xsl:if test="local-name(*[1]) != 'stem'">
2492
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2493
+ </xsl:if>
2494
+ </xsl:if> -->
2141
2495
 
2496
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2142
2497
 
2143
2498
  </fo:block>
2144
2499
  </fo:table-cell>
2145
2500
  </fo:table-row>
2146
-
2501
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2502
+ <xsl:if test="local-name(*[1]) = 'stem'">
2503
+ <fo:table-row>
2504
+ <fo:table-cell>
2505
+ <fo:block margin-top="6pt">
2506
+ <xsl:if test="normalize-space($key_iso) = 'true'">
2507
+ <xsl:attribute name="margin-top">0</xsl:attribute>
2508
+ </xsl:if>
2509
+ <xsl:text>&#xA0;</xsl:text>
2510
+ </fo:block>
2511
+ </fo:table-cell>
2512
+ <fo:table-cell>
2513
+ <fo:block>
2514
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2515
+ </fo:block>
2516
+ </fo:table-cell>
2517
+ </fo:table-row>
2518
+ </xsl:if>
2519
+ </xsl:if> -->
2147
2520
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2148
2521
  <xsl:apply-templates/>
2149
2522
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
@@ -2168,6 +2541,31 @@
2168
2541
  </fo:inline>
2169
2542
  </xsl:template><xsl:template match="*[local-name()='tt']">
2170
2543
  <fo:inline xsl:use-attribute-sets="tt-style">
2544
+ <xsl:variable name="_font-size">
2545
+
2546
+
2547
+
2548
+
2549
+
2550
+
2551
+
2552
+
2553
+
2554
+
2555
+
2556
+
2557
+ 10
2558
+
2559
+ </xsl:variable>
2560
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
2561
+ <xsl:if test="$font-size != ''">
2562
+ <xsl:attribute name="font-size">
2563
+ <xsl:choose>
2564
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
2565
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
2566
+ </xsl:choose>
2567
+ </xsl:attribute>
2568
+ </xsl:if>
2171
2569
  <xsl:apply-templates/>
2172
2570
  </fo:inline>
2173
2571
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -2493,11 +2891,24 @@
2493
2891
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2494
2892
  <xsl:value-of select="substring($str, 2)"/>
2495
2893
  </xsl:template><xsl:template match="mathml:math">
2496
- <fo:inline font-family="STIX2Math">
2497
- <fo:instream-foreign-object fox:alt-text="Math">
2498
- <xsl:copy-of select="."/>
2499
- </fo:instream-foreign-object>
2894
+ <fo:inline font-family="STIX Two Math"> <!-- -->
2895
+ <xsl:variable name="mathml">
2896
+ <xsl:apply-templates select="." mode="mathml"/>
2897
+ </xsl:variable>
2898
+ <fo:instream-foreign-object fox:alt-text="Math">
2899
+ <!-- <xsl:copy-of select="."/> -->
2900
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
2901
+ </fo:instream-foreign-object>
2500
2902
  </fo:inline>
2903
+ </xsl:template><xsl:template match="@*|node()" mode="mathml">
2904
+ <xsl:copy>
2905
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
2906
+ </xsl:copy>
2907
+ </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
2908
+ <xsl:copy>
2909
+ <!-- replace start and end spaces to non-break space -->
2910
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
2911
+ </xsl:copy>
2501
2912
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2502
2913
  <xsl:variable name="target">
2503
2914
  <xsl:choose>
@@ -2574,13 +2985,26 @@
2574
2985
  <xsl:apply-templates/>
2575
2986
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
2576
2987
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2577
-
2988
+
2578
2989
  <xsl:apply-templates/>
2579
2990
  </fo:basic-link>
2580
2991
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2581
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2582
- <xsl:apply-templates/>
2583
- </fo:block>
2992
+ <fo:block-container margin-left="0mm">
2993
+ <xsl:if test="parent::*[local-name() = 'note']">
2994
+ <xsl:attribute name="margin-left">
2995
+ <xsl:choose>
2996
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2997
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2998
+ </xsl:choose>
2999
+ </xsl:attribute>
3000
+
3001
+ </xsl:if>
3002
+ <fo:block-container margin-left="0mm">
3003
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
3004
+ <xsl:apply-templates/>
3005
+ </fo:block>
3006
+ </fo:block-container>
3007
+ </fo:block-container>
2584
3008
  </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2585
3009
  <fo:inline>
2586
3010
  <xsl:apply-templates/>
@@ -2644,7 +3068,9 @@
2644
3068
  </xsl:choose>
2645
3069
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2646
3070
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2647
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3071
+ <fo:inline xsl:use-attribute-sets="termnote-name-style">
3072
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3073
+ </fo:inline>
2648
3074
  <xsl:apply-templates/>
2649
3075
  </fo:block>
2650
3076
  </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">
@@ -2743,15 +3169,109 @@
2743
3169
 
2744
3170
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2745
3171
  </fo:block>
2746
- </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">
3172
+ </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">
2747
3173
  <xsl:apply-templates mode="contents"/>
2748
3174
  <xsl:text> </xsl:text>
2749
- </xsl:template><xsl:template match="text()" mode="contents">
3175
+ </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">
3176
+ <xsl:apply-templates mode="bookmarks"/>
3177
+ <xsl:text> </xsl:text>
3178
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
3179
+ <xsl:value-of select="."/>
3180
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
2750
3181
  <xsl:value-of select="."/>
2751
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3182
+ </xsl:template><xsl:template match="node()" mode="contents">
3183
+ <xsl:apply-templates mode="contents"/>
3184
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
3185
+ <xsl:apply-templates mode="bookmarks"/>
3186
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3187
+ <xsl:apply-templates select="."/>
3188
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3189
+ <xsl:apply-templates mode="bookmarks"/>
3190
+ </xsl:template><xsl:template name="addBookmarks">
3191
+ <xsl:param name="contents"/>
3192
+ <xsl:if test="xalan:nodeset($contents)//item">
3193
+ <fo:bookmark-tree>
3194
+ <xsl:choose>
3195
+ <xsl:when test="xalan:nodeset($contents)/doc">
3196
+ <xsl:choose>
3197
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3198
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3199
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3200
+ <fo:bookmark-title>
3201
+ <xsl:variable name="bookmark-title_">
3202
+ <xsl:call-template name="getLangVersion">
3203
+ <xsl:with-param name="lang" select="@lang"/>
3204
+ </xsl:call-template>
3205
+ </xsl:variable>
3206
+ <xsl:choose>
3207
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3208
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3209
+ </xsl:when>
3210
+ <xsl:otherwise>
3211
+ <xsl:choose>
3212
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3213
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3214
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3215
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3216
+ </xsl:choose>
3217
+ </xsl:otherwise>
3218
+ </xsl:choose>
3219
+ </fo:bookmark-title>
3220
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3221
+ </fo:bookmark>
3222
+
3223
+ </xsl:for-each>
3224
+ </xsl:when>
3225
+ <xsl:otherwise>
3226
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3227
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3228
+ </xsl:for-each>
3229
+ </xsl:otherwise>
3230
+ </xsl:choose>
3231
+ </xsl:when>
3232
+ <xsl:otherwise>
3233
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
3234
+ </xsl:otherwise>
3235
+ </xsl:choose>
3236
+
3237
+
3238
+
3239
+
3240
+
3241
+
3242
+
3243
+
3244
+ </fo:bookmark-tree>
3245
+ </xsl:if>
3246
+ </xsl:template><xsl:template name="getLangVersion">
3247
+ <xsl:param name="lang"/>
3248
+ <xsl:choose>
3249
+ <xsl:when test="$lang = 'en'">
3250
+
3251
+
3252
+ </xsl:when>
3253
+ <xsl:when test="$lang = 'fr'">
3254
+
3255
+
3256
+ </xsl:when>
3257
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3258
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3259
+ </xsl:choose>
3260
+ </xsl:template><xsl:template match="item" mode="bookmark">
3261
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
3262
+ <fo:bookmark-title>
3263
+ <xsl:if test="@section != ''">
3264
+ <xsl:value-of select="@section"/>
3265
+ <xsl:text> </xsl:text>
3266
+ </xsl:if>
3267
+ <xsl:value-of select="normalize-space(title)"/>
3268
+ </fo:bookmark-title>
3269
+ <xsl:apply-templates mode="bookmark"/>
3270
+ </fo:bookmark>
3271
+ </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">
2752
3272
  <xsl:if test="normalize-space() != ''">
2753
3273
  <fo:block xsl:use-attribute-sets="figure-name-style">
2754
-
3274
+
2755
3275
  <xsl:apply-templates/>
2756
3276
  </fo:block>
2757
3277
  </xsl:if>
@@ -2806,7 +3326,7 @@
2806
3326
  <xsl:apply-templates/>
2807
3327
  </xsl:otherwise>
2808
3328
  </xsl:choose>
2809
- </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">
3329
+ </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">
2810
3330
  <xsl:text> </xsl:text>
2811
3331
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
2812
3332
  <xsl:copy>
@@ -2815,24 +3335,61 @@
2815
3335
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
2816
3336
  <xsl:text> </xsl:text>
2817
3337
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
2818
- <fo:block xsl:use-attribute-sets="sourcecode-style">
2819
- <xsl:apply-templates/>
2820
- </fo:block>
2821
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2822
- </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
3338
+
3339
+ <fo:block-container margin-left="0mm">
3340
+ <xsl:if test="parent::*[local-name() = 'note']">
3341
+ <xsl:attribute name="margin-left">
3342
+ <xsl:choose>
3343
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3344
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3345
+ </xsl:choose>
3346
+ </xsl:attribute>
3347
+
3348
+ </xsl:if>
3349
+ <fo:block-container margin-left="0mm">
3350
+
3351
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
3352
+ <xsl:variable name="_font-size">
3353
+
3354
+
3355
+
3356
+
3357
+
3358
+
3359
+
3360
+
3361
+
3362
+
3363
+
3364
+
3365
+ 10
3366
+
3367
+ </xsl:variable>
3368
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3369
+ <xsl:if test="$font-size != ''">
3370
+ <xsl:attribute name="font-size">
3371
+ <xsl:choose>
3372
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3373
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3374
+ </xsl:choose>
3375
+ </xsl:attribute>
3376
+ </xsl:if>
3377
+ <xsl:apply-templates/>
3378
+ </fo:block>
3379
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3380
+
3381
+ </fo:block-container>
3382
+ </fo:block-container>
3383
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
2823
3384
  <xsl:variable name="text">
2824
3385
  <xsl:call-template name="add-zero-spaces-equal"/>
2825
3386
  </xsl:variable>
2826
- <xsl:call-template name="add-zero-spaces">
3387
+ <xsl:call-template name="add-zero-spaces-java">
2827
3388
  <xsl:with-param name="text" select="$text"/>
2828
3389
  </xsl:call-template>
2829
3390
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
2830
3391
  <xsl:if test="normalize-space() != ''">
2831
- <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2832
-
2833
- <xsl:attribute name="font-size">12pt</xsl:attribute>
2834
- <xsl:attribute name="font-family">SourceSansPro</xsl:attribute>
2835
-
3392
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2836
3393
  <xsl:apply-templates/>
2837
3394
  </fo:block>
2838
3395
  </xsl:if>
@@ -2900,6 +3457,145 @@
2900
3457
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
2901
3458
  <xsl:apply-templates/>
2902
3459
  </fo:block>
3460
+ </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3461
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
3462
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3463
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3464
+ </xsl:if>
3465
+ <fo:block-container margin-left="0mm" margin-right="0mm">
3466
+ <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
3467
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3468
+ <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
3469
+ </xsl:if>
3470
+ <xsl:variable name="simple-table">
3471
+ <xsl:call-template name="getSimpleTable"/>
3472
+ </xsl:variable>
3473
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
3474
+ <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
3475
+ <!-- <fo:table-column column-width="35mm"/>
3476
+ <fo:table-column column-width="115mm"/> -->
3477
+ <fo:table-column column-width="30%"/>
3478
+ <fo:table-column column-width="70%"/>
3479
+ </xsl:if>
3480
+ <xsl:apply-templates mode="requirement"/>
3481
+ </fo:table>
3482
+ <!-- fn processing -->
3483
+ <xsl:if test=".//*[local-name() = 'fn']">
3484
+ <xsl:for-each select="*[local-name() = 'tbody']">
3485
+ <fo:block font-size="90%" border-bottom="1pt solid black">
3486
+ <xsl:call-template name="fn_display"/>
3487
+ </fo:block>
3488
+ </xsl:for-each>
3489
+ </xsl:if>
3490
+ </fo:block-container>
3491
+ </fo:block-container>
3492
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="requirement">
3493
+ <fo:table-header>
3494
+ <xsl:apply-templates mode="requirement"/>
3495
+ </fo:table-header>
3496
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="requirement">
3497
+ <fo:table-body>
3498
+ <xsl:apply-templates mode="requirement"/>
3499
+ </fo:table-body>
3500
+ </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
3501
+ <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
3502
+ <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
3503
+ <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
3504
+ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
3505
+ </xsl:if>
3506
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
3507
+ <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
3508
+ </xsl:if>
3509
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
3510
+ <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
3511
+ </xsl:if>
3512
+ <xsl:apply-templates mode="requirement"/>
3513
+ </fo:table-row>
3514
+ </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
3515
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3516
+ <xsl:attribute name="text-align">
3517
+ <xsl:choose>
3518
+ <xsl:when test="@align">
3519
+ <xsl:value-of select="@align"/>
3520
+ </xsl:when>
3521
+ <xsl:otherwise>left</xsl:otherwise>
3522
+ </xsl:choose>
3523
+ </xsl:attribute>
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-top">0.5mm</xsl:attribute>
3538
+ <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
3539
+ </xsl:if>
3540
+ <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
3541
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3542
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3543
+ </xsl:if> -->
3544
+
3545
+ <fo:block>
3546
+ <xsl:apply-templates/>
3547
+ </fo:block>
3548
+ </fo:table-cell>
3549
+ </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
3550
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3551
+ <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3552
+ <xsl:attribute name="padding">0mm</xsl:attribute>
3553
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
3554
+ </xsl:if>
3555
+ <xsl:attribute name="text-align">
3556
+ <xsl:choose>
3557
+ <xsl:when test="@align">
3558
+ <xsl:value-of select="@align"/>
3559
+ </xsl:when>
3560
+ <xsl:otherwise>left</xsl:otherwise>
3561
+ </xsl:choose>
3562
+ </xsl:attribute>
3563
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
3564
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3565
+ </xsl:if>
3566
+ <xsl:if test="@colspan">
3567
+ <xsl:attribute name="number-columns-spanned">
3568
+ <xsl:value-of select="@colspan"/>
3569
+ </xsl:attribute>
3570
+ </xsl:if>
3571
+ <xsl:if test="@rowspan">
3572
+ <xsl:attribute name="number-rows-spanned">
3573
+ <xsl:value-of select="@rowspan"/>
3574
+ </xsl:attribute>
3575
+ </xsl:if>
3576
+ <xsl:call-template name="display-align"/>
3577
+
3578
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3579
+ <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
3580
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3581
+ <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
3582
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3583
+ </xsl:if>
3584
+ </xsl:if> -->
3585
+ <!-- 2nd line and below -->
3586
+
3587
+ <fo:block>
3588
+ <xsl:apply-templates/>
3589
+ </fo:block>
3590
+ </fo:table-cell>
3591
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
3592
+ <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
3593
+ <xsl:apply-templates/>
3594
+ </fo:block>
3595
+ </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
3596
+ <fo:block> <!-- margin-bottom="10pt" -->
3597
+ <xsl:apply-templates/>
3598
+ </fo:block>
2903
3599
  </xsl:template><xsl:template match="*[local-name() = 'termexample']">
2904
3600
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
2905
3601
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -2919,12 +3615,13 @@
2919
3615
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2920
3616
 
2921
3617
  <xsl:variable name="element">
2922
- block
3618
+ block
2923
3619
 
3620
+ <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
2924
3621
  </xsl:variable>
2925
3622
 
2926
3623
  <xsl:choose>
2927
- <xsl:when test="normalize-space($element) = 'block'">
3624
+ <xsl:when test="contains(normalize-space($element), 'block')">
2928
3625
  <fo:block xsl:use-attribute-sets="example-body-style">
2929
3626
  <xsl:apply-templates/>
2930
3627
  </fo:block>
@@ -2961,25 +3658,44 @@
2961
3658
  </xsl:otherwise>
2962
3659
  </xsl:choose>
2963
3660
 
2964
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
2965
- <fo:block xsl:use-attribute-sets="example-p-style">
3661
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3662
+
3663
+ <xsl:variable name="element">
3664
+ block
2966
3665
 
2967
- <xsl:apply-templates/>
2968
- </fo:block>
3666
+ </xsl:variable>
3667
+ <xsl:choose>
3668
+ <xsl:when test="normalize-space($element) = 'block'">
3669
+ <fo:block xsl:use-attribute-sets="example-p-style">
3670
+
3671
+ <xsl:apply-templates/>
3672
+ </fo:block>
3673
+ </xsl:when>
3674
+ <xsl:otherwise>
3675
+ <fo:inline xsl:use-attribute-sets="example-p-style">
3676
+ <xsl:apply-templates/>
3677
+ </fo:inline>
3678
+ </xsl:otherwise>
3679
+ </xsl:choose>
2969
3680
  </xsl:template><xsl:template match="*[local-name() = 'termsource']">
2970
3681
  <fo:block xsl:use-attribute-sets="termsource-style">
2971
3682
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
2972
3683
  <xsl:variable name="termsource_text">
2973
3684
  <xsl:apply-templates/>
2974
3685
  </xsl:variable>
3686
+
2975
3687
  <xsl:choose>
2976
3688
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
2977
3689
  <xsl:apply-templates/>
2978
3690
  </xsl:when>
2979
- <xsl:otherwise>
2980
- <xsl:text>[</xsl:text>
2981
- <xsl:apply-templates/>
2982
- <xsl:text>]</xsl:text>
3691
+ <xsl:otherwise>
3692
+
3693
+ <xsl:text>[</xsl:text>
3694
+
3695
+ <xsl:apply-templates/>
3696
+
3697
+ <xsl:text>]</xsl:text>
3698
+
2983
3699
  </xsl:otherwise>
2984
3700
  </xsl:choose>
2985
3701
  </fo:block>
@@ -2990,10 +3706,13 @@
2990
3706
  </xsl:template><xsl:template match="*[local-name() = 'origin']">
2991
3707
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
2992
3708
 
2993
- <xsl:call-template name="getTitle">
2994
- <xsl:with-param name="name" select="'title-source'"/>
2995
- </xsl:call-template>
2996
- <xsl:text>: </xsl:text>
3709
+ <fo:inline>
3710
+
3711
+ <xsl:call-template name="getTitle">
3712
+ <xsl:with-param name="name" select="'title-source'"/>
3713
+ </xsl:call-template>
3714
+ <xsl:text>: </xsl:text>
3715
+ </fo:inline>
2997
3716
 
2998
3717
  <fo:inline xsl:use-attribute-sets="origin-style">
2999
3718
  <xsl:apply-templates/>
@@ -3005,18 +3724,29 @@
3005
3724
  <xsl:if test="normalize-space() != ''">
3006
3725
  <xsl:value-of select="."/>
3007
3726
  </xsl:if>
3008
- </xsl:template><xsl:template match="*[local-name() = 'quote']">
3727
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
3728
+ <fo:block-container margin-left="0mm">
3729
+ <xsl:if test="parent::*[local-name() = 'note']">
3730
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
3731
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
3732
+ </xsl:if>
3733
+ </xsl:if>
3734
+
3735
+ <fo:block-container margin-left="0mm">
3009
3736
 
3010
- <fo:block xsl:use-attribute-sets="quote-style">
3011
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3012
- </fo:block>
3013
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3014
- <fo:block xsl:use-attribute-sets="quote-source-style">
3015
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
3016
- <xsl:apply-templates select="*[local-name() = 'author']"/>
3017
- <xsl:apply-templates select="*[local-name() = 'source']"/>
3018
- </fo:block>
3019
- </xsl:if>
3737
+ <fo:block xsl:use-attribute-sets="quote-style">
3738
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3739
+ </fo:block>
3740
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3741
+ <fo:block xsl:use-attribute-sets="quote-source-style">
3742
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
3743
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
3744
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
3745
+ </fo:block>
3746
+ </xsl:if>
3747
+
3748
+ </fo:block-container>
3749
+ </fo:block-container>
3020
3750
  </xsl:template><xsl:template match="*[local-name() = 'source']">
3021
3751
  <xsl:if test="../*[local-name() = 'author']">
3022
3752
  <xsl:text>, </xsl:text>
@@ -3044,6 +3774,7 @@
3044
3774
  <xsl:if test="@type = 'inline'">
3045
3775
 
3046
3776
 
3777
+
3047
3778
  </xsl:if>
3048
3779
 
3049
3780
 
@@ -3071,6 +3802,7 @@
3071
3802
 
3072
3803
 
3073
3804
 
3805
+
3074
3806
  3.5
3075
3807
 
3076
3808
 
@@ -3148,7 +3880,7 @@
3148
3880
 
3149
3881
 
3150
3882
 
3151
- <xsl:variable name="pos"><xsl:number count="rsd:sections/rsd:clause[not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"/></xsl:variable> <!-- | rsd:sections/rsd:terms -->
3883
+ <xsl:variable name="pos"><xsl:number count="rsd:sections/rsd:clause[not(@type='scope') and not(@type='conformance')]"/></xsl:variable> <!-- | rsd:sections/rsd:terms -->
3152
3884
  <xsl:if test="$pos &gt;= 2">
3153
3885
  <xsl:attribute name="space-before">18pt</xsl:attribute>
3154
3886
  </xsl:if>
@@ -3171,13 +3903,14 @@
3171
3903
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3172
3904
  <fo:block>
3173
3905
  <xsl:call-template name="setId"/>
3906
+
3174
3907
  <xsl:apply-templates/>
3175
3908
  </fo:block>
3176
3909
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3177
3910
  <fo:block id="{@id}">
3178
3911
  <xsl:apply-templates/>
3179
3912
  </fo:block>
3180
- </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@id = '_normative_references' or @id = '_references']">
3913
+ </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3181
3914
 
3182
3915
  <fo:block id="{@id}">
3183
3916
  <xsl:apply-templates/>
@@ -3195,6 +3928,31 @@
3195
3928
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3196
3929
  <!-- 0xA0 to space replacement -->
3197
3930
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3931
+ </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3932
+ <xsl:choose>
3933
+ <xsl:when test="parent::*[local-name() = 'note']">
3934
+ <fo:block-container>
3935
+ <xsl:attribute name="margin-left">
3936
+ <xsl:choose>
3937
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3938
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3939
+ </xsl:choose>
3940
+ </xsl:attribute>
3941
+
3942
+
3943
+ <fo:block-container margin-left="0mm">
3944
+ <fo:block>
3945
+ <xsl:apply-templates select="." mode="ul_ol"/>
3946
+ </fo:block>
3947
+ </fo:block-container>
3948
+ </fo:block-container>
3949
+ </xsl:when>
3950
+ <xsl:otherwise>
3951
+ <fo:block>
3952
+ <xsl:apply-templates select="." mode="ul_ol"/>
3953
+ </fo:block>
3954
+ </xsl:otherwise>
3955
+ </xsl:choose>
3198
3956
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3199
3957
  <!-- <row>
3200
3958
  <date>05-07-2013</date>
@@ -3226,6 +3984,65 @@
3226
3984
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3227
3985
  <fo:block><xsl:apply-templates/></fo:block>
3228
3986
  </fo:table-cell>
3987
+ </xsl:template><xsl:template name="processBibitem">
3988
+
3989
+
3990
+
3991
+
3992
+ </xsl:template><xsl:template name="processBibitemDocId">
3993
+ <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')]"/>
3994
+ <xsl:choose>
3995
+ <xsl:when test="normalize-space($_doc_ident) != ''">
3996
+ <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"/>
3997
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
3998
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3999
+ </xsl:if>
4000
+ <xsl:value-of select="$_doc_ident"/>
4001
+ </xsl:when>
4002
+ <xsl:otherwise>
4003
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
4004
+ <xsl:if test="$type != ''">
4005
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4006
+ </xsl:if>
4007
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
4008
+ </xsl:otherwise>
4009
+ </xsl:choose>
4010
+ </xsl:template><xsl:template name="processPersonalAuthor">
4011
+ <xsl:choose>
4012
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
4013
+ <author>
4014
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
4015
+ </author>
4016
+ </xsl:when>
4017
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
4018
+ <author>
4019
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
4020
+ <xsl:text> </xsl:text>
4021
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
4022
+ </author>
4023
+ </xsl:when>
4024
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
4025
+ <author>
4026
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
4027
+ <xsl:text> </xsl:text>
4028
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
4029
+ </author>
4030
+ </xsl:when>
4031
+ <xsl:otherwise>
4032
+ <xsl:apply-templates/>
4033
+ </xsl:otherwise>
4034
+ </xsl:choose>
4035
+ </xsl:template><xsl:template name="renderDate">
4036
+ <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
4037
+ <xsl:value-of select="*[local-name() = 'on']"/>
4038
+ </xsl:if>
4039
+ <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
4040
+ <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
4041
+ </xsl:if>
4042
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
4043
+ <xsl:value-of select="translate(.,'. ','')"/>
4044
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
4045
+ <xsl:value-of select="substring(.,1,1)"/>
3229
4046
  </xsl:template><xsl:template name="convertDate">
3230
4047
  <xsl:param name="date"/>
3231
4048
  <xsl:param name="format" select="'short'"/>
@@ -3304,6 +4121,7 @@
3304
4121
  <dc:title>
3305
4122
  <xsl:variable name="title">
3306
4123
 
4124
+
3307
4125
 
3308
4126
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/>
3309
4127
 
@@ -3322,6 +4140,7 @@
3322
4140
  <dc:creator>
3323
4141
 
3324
4142
 
4143
+
3325
4144
  </dc:creator>
3326
4145
  <dc:description>
3327
4146
  <xsl:variable name="abstract">
@@ -3331,6 +4150,7 @@
3331
4150
 
3332
4151
  <xsl:copy-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'abstract']//text()"/>
3333
4152
 
4153
+
3334
4154
  </xsl:variable>
3335
4155
  <xsl:value-of select="normalize-space($abstract)"/>
3336
4156
  </dc:description>
@@ -3429,7 +4249,9 @@
3429
4249
 
3430
4250
 
3431
4251
 
3432
-
4252
+
4253
+
4254
+
3433
4255
  </xsl:variable>
3434
4256
  <xsl:if test="$documentNS != $XSLNS">
3435
4257
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3455,4 +4277,21 @@
3455
4277
  </xsl:otherwise>
3456
4278
  </xsl:choose>
3457
4279
  </xsl:attribute>
4280
+ </xsl:template><xsl:template name="add-letter-spacing">
4281
+ <xsl:param name="text"/>
4282
+ <xsl:param name="letter-spacing" select="'0.15'"/>
4283
+ <xsl:if test="string-length($text) &gt; 0">
4284
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
4285
+ <fo:inline padding-right="{$letter-spacing}mm">
4286
+ <xsl:if test="$char = '®'">
4287
+ <xsl:attribute name="font-size">58%</xsl:attribute>
4288
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4289
+ </xsl:if>
4290
+ <xsl:value-of select="$char"/>
4291
+ </fo:inline>
4292
+ <xsl:call-template name="add-letter-spacing">
4293
+ <xsl:with-param name="text" select="substring($text, 2)"/>
4294
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4295
+ </xsl:call-template>
4296
+ </xsl:if>
3458
4297
  </xsl:template></xsl:stylesheet>