metanorma-iso 1.5.4 → 1.5.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,6 +15,8 @@
15
15
  <xsl:variable name="pageWidth" select="'210mm'"/>
16
16
  <xsl:variable name="pageHeight" select="'297mm'"/>
17
17
 
18
+ <xsl:variable name="docidentifierISO" select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso'] | /iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'ISO']"/>
19
+
18
20
  <xsl:variable name="copyrightText" select="concat('© ISO ', iso:iso-standard/iso:bibdata/iso:copyright/iso:from ,' – All rights reserved')"/>
19
21
 
20
22
  <xsl:variable name="lang-1st-letter_tmp" select="substring-before(substring-after(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-with-lang'], '('), ')')"/>
@@ -293,6 +295,10 @@
293
295
 
294
296
  <xsl:call-template name="addPDFUAmeta"/>
295
297
 
298
+ <xsl:call-template name="addBookmarks">
299
+ <xsl:with-param name="contents" select="$contents"/>
300
+ </xsl:call-template>
301
+
296
302
  <!-- cover page -->
297
303
  <xsl:choose>
298
304
  <xsl:when test="$stage-abbreviation != ''">
@@ -399,7 +405,7 @@
399
405
  <xsl:value-of select="$stage-fullname-uppercased"/>
400
406
  </fo:block>
401
407
  <fo:block font-size="20pt" font-weight="bold" text-align="right">
402
- <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso']"/>
408
+ <xsl:value-of select="$docidentifierISO"/>
403
409
  </fo:block>
404
410
 
405
411
 
@@ -539,36 +545,69 @@
539
545
  </fo:table-cell>
540
546
  <fo:table-cell>
541
547
  <fo:block text-align="left">
542
- <xsl:value-of select="$doctype_uppercased"/>
548
+ <xsl:choose>
549
+ <xsl:when test="$doctype = 'amendment'">
550
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(translate(/iso:iso-standard/iso:bibdata/iso:ext/iso:updates-document-type,'-',' ')))"/>
551
+ </xsl:when>
552
+ <xsl:otherwise>
553
+ <xsl:value-of select="$doctype_uppercased"/>
554
+ </xsl:otherwise>
555
+ </xsl:choose>
543
556
  </fo:block>
544
557
  </fo:table-cell>
545
558
  <fo:table-cell>
546
559
  <fo:block text-align="right" font-weight="bold" margin-bottom="13mm">
547
- <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso']"/>
560
+ <xsl:value-of select="$docidentifierISO"/>
548
561
  </fo:block>
549
562
  </fo:table-cell>
550
563
  </fo:table-row>
551
564
  <fo:table-row height="42mm">
552
565
  <fo:table-cell number-columns-spanned="3" font-size="10pt" line-height="1.2">
553
566
  <fo:block text-align="right">
554
- <xsl:if test="$stage-abbreviation = 'PRF' or $stage-abbreviation = 'IS' or $stage-abbreviation = 'published'">
567
+ <xsl:if test="$stage-abbreviation = 'PRF' or $stage-abbreviation = 'IS' or $stage-abbreviation = 'D' or $stage-abbreviation = 'published'">
555
568
  <xsl:call-template name="printEdition"/>
556
569
  </xsl:if>
557
570
  <xsl:choose>
558
- <xsl:when test="$stage-abbreviation = 'IS'">
571
+ <xsl:when test="$stage-abbreviation = 'IS' and /iso:iso-standard/iso:bibdata/iso:date[@type = 'published']">
559
572
  <xsl:value-of select="$linebreak"/>
560
573
  <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:date[@type = 'published']"/>
561
574
  </xsl:when>
562
- <xsl:when test="$stage-abbreviation = 'published'">
575
+ <xsl:when test="($stage-abbreviation = 'IS' or $stage-abbreviation = 'D') and /iso:iso-standard/iso:bibdata/iso:date[@type = 'created']">
576
+ <xsl:value-of select="$linebreak"/>
577
+ <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:date[@type = 'created']"/>
578
+ </xsl:when>
579
+ <xsl:when test="$stage-abbreviation = 'IS' or $stage-abbreviation = 'published'">
563
580
  <xsl:value-of select="$linebreak"/>
564
581
  <xsl:value-of select="substring(/iso:iso-standard/iso:bibdata/iso:version/iso:revision-date,1, 7)"/>
565
582
  </xsl:when>
566
583
  </xsl:choose>
567
- <!-- <xsl:value-of select="$linebreak"/>
568
- <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:version/iso:revision-date"/> -->
584
+ </fo:block>
585
+ <!-- <xsl:value-of select="$linebreak"/>
586
+ <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:version/iso:revision-date"/> -->
587
+ <xsl:if test="$doctype = 'amendment'">
588
+ <fo:block text-align="right" margin-right="0.5mm">
589
+ <fo:block font-weight="bold" margin-top="4pt">
590
+ <xsl:variable name="title-amendment">
591
+ <xsl:call-template name="getTitle">
592
+ <xsl:with-param name="name" select="'title-amendment'"/>
593
+ </xsl:call-template>
594
+ </xsl:variable>
595
+ <xsl:value-of select="$title-amendment"/><xsl:text> </xsl:text>
596
+ <xsl:variable name="amendment-number" select="/iso:iso-standard/iso:bibdata/iso:ext/iso:structuredidentifier/iso:project-number/@amendment"/>
597
+ <xsl:if test="normalize-space($amendment-number) != ''">
598
+ <xsl:value-of select="$amendment-number"/><xsl:text> </xsl:text>
599
+ </xsl:if>
600
+ </fo:block>
601
+ <fo:block>
602
+ <xsl:if test="/iso:iso-standard/iso:bibdata/iso:date[@type = 'updated']">
603
+ <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:date[@type = 'updated']"/>
604
+ </xsl:if>
605
+ </fo:block>
569
606
  </fo:block>
607
+ </xsl:if>
570
608
  </fo:table-cell>
571
609
  </fo:table-row>
610
+
572
611
  </fo:table-body>
573
612
  </fo:table>
574
613
 
@@ -637,6 +676,12 @@
637
676
  </xsl:if>
638
677
  <xsl:value-of select="$title-part"/>
639
678
  </xsl:if> -->
679
+ <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-amd']"/>
680
+ <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
681
+ <fo:block margin-right="-5mm" margin-top="12pt">
682
+ <xsl:call-template name="printAmendmentTitle"/>
683
+ </fo:block>
684
+ </xsl:if>
640
685
  </fo:block>
641
686
 
642
687
  <fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
@@ -651,6 +696,15 @@
651
696
 
652
697
  <xsl:call-template name="printTitlePartFr"/>
653
698
 
699
+ <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-amd']"/>
700
+ <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
701
+ <fo:block margin-right="-5mm" margin-top="6pt">
702
+ <xsl:call-template name="printAmendmentTitle">
703
+ <xsl:with-param name="lang" select="'fr'"/>
704
+ </xsl:call-template>
705
+ </fo:block>
706
+ </xsl:if>
707
+
654
708
  </fo:block>
655
709
  </fo:block>
656
710
  </fo:block-container>
@@ -714,7 +768,7 @@
714
768
  </fo:table-cell>
715
769
  <fo:table-cell>
716
770
  <fo:block text-align="right" font-weight="bold" margin-bottom="13mm">
717
- <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso']"/>
771
+ <xsl:value-of select="$docidentifierISO"/>
718
772
  </fo:block>
719
773
  </fo:table-cell>
720
774
  </fo:table-row>
@@ -891,7 +945,7 @@
891
945
  </fo:block-container>
892
946
  <fo:block font-size="11pt" margin-bottom="8pt"><xsl:value-of select="$linebreak"/></fo:block>
893
947
  <fo:block-container font-size="40pt" text-align="center" margin-bottom="12pt" border="0.5pt solid black">
894
- <xsl:variable name="stage-title" select="substring-after(substring-before(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso'], ' '), '/')"/>
948
+ <xsl:variable name="stage-title" select="substring-after(substring-before($docidentifierISO, ' '), '/')"/>
895
949
  <fo:block padding-top="2mm"><xsl:value-of select="$stage-title"/><xsl:text> stage</xsl:text></fo:block>
896
950
  </fo:block-container>
897
951
  <fo:block><xsl:value-of select="$linebreak"/></fo:block>
@@ -964,7 +1018,7 @@
964
1018
  </xsl:if>
965
1019
 
966
1020
  <xsl:variable name="margin-left">12</xsl:variable>
967
- <xsl:for-each select="xalan:nodeset($contents)//item"><!-- [@display = 'true'][not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
1021
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
968
1022
 
969
1023
  <fo:block>
970
1024
  <xsl:if test="@level = 1">
@@ -994,9 +1048,9 @@
994
1048
  </fo:list-item-label>
995
1049
  <fo:list-item-body start-indent="body-start()">
996
1050
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
997
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
1051
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
998
1052
 
999
- <xsl:apply-templates/>
1053
+ <xsl:apply-templates select="title"/>
1000
1054
 
1001
1055
  <fo:inline keep-together.within-line="always">
1002
1056
  <fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
@@ -1065,19 +1119,8 @@
1065
1119
 
1066
1120
  <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-amd']"/>
1067
1121
  <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
1068
- <fo:block font-weight="normal" margin-top="12pt" line-height="1.1">
1069
- <xsl:variable name="title-amendment">
1070
- <xsl:call-template name="getTitle">
1071
- <xsl:with-param name="name" select="'title-amendment'"/>
1072
- </xsl:call-template>
1073
- </xsl:variable>
1074
- <xsl:value-of select="$title-amendment"/>
1075
- <xsl:variable name="amendment-number" select="/iso:iso-standard/iso:bibdata/iso:ext/iso:structuredidentifier/iso:project-number/@amendment"/>
1076
- <xsl:if test="normalize-space($amendment-number) != ''">
1077
- <xsl:text> </xsl:text><xsl:value-of select="$amendment-number"/>
1078
- </xsl:if>
1079
- <xsl:text>: </xsl:text>
1080
- <xsl:value-of select="$title-amd"/>
1122
+ <fo:block margin-top="12pt">
1123
+ <xsl:call-template name="printAmendmentTitle"/>
1081
1124
  </fo:block>
1082
1125
  </xsl:if>
1083
1126
 
@@ -1172,6 +1215,27 @@
1172
1215
  <xsl:apply-templates/>
1173
1216
  </xsl:template>
1174
1217
 
1218
+ <xsl:template name="printAmendmentTitle">
1219
+ <xsl:param name="lang" select="'en'"/>
1220
+ <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-amd']"/>
1221
+ <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
1222
+ <fo:block font-weight="normal" line-height="1.1">
1223
+ <xsl:variable name="title-amendment">
1224
+ <xsl:call-template name="getTitle">
1225
+ <xsl:with-param name="name" select="'title-amendment'"/>
1226
+ </xsl:call-template>
1227
+ </xsl:variable>
1228
+ <xsl:value-of select="$title-amendment"/>
1229
+ <xsl:variable name="amendment-number" select="/iso:iso-standard/iso:bibdata/iso:ext/iso:structuredidentifier/iso:project-number/@amendment"/>
1230
+ <xsl:if test="normalize-space($amendment-number) != ''">
1231
+ <xsl:text> </xsl:text><xsl:value-of select="$amendment-number"/>
1232
+ </xsl:if>
1233
+ <xsl:text>: </xsl:text>
1234
+ <xsl:value-of select="$title-amd"/>
1235
+ </fo:block>
1236
+ </xsl:if>
1237
+ </xsl:template>
1238
+
1175
1239
  <!-- ============================= -->
1176
1240
  <!-- CONTENTS -->
1177
1241
  <!-- ============================= -->
@@ -1196,9 +1260,7 @@
1196
1260
  </xsl:variable>
1197
1261
 
1198
1262
  <xsl:variable name="display">
1199
- <xsl:choose>
1200
- <xsl:when test="ancestor-or-self::iso:bibitem">false</xsl:when>
1201
- <xsl:when test="ancestor-or-self::iso:term">false</xsl:when>
1263
+ <xsl:choose>
1202
1264
  <xsl:when test="ancestor-or-self::iso:annex and $level &gt;= 2">false</xsl:when>
1203
1265
  <xsl:when test="$section = '' and $type = 'clause'">false</xsl:when>
1204
1266
  <xsl:when test="$level &lt;= 3">true</xsl:when>
@@ -1206,8 +1268,16 @@
1206
1268
  </xsl:choose>
1207
1269
  </xsl:variable>
1208
1270
 
1271
+ <xsl:variable name="skip">
1272
+ <xsl:choose>
1273
+ <xsl:when test="ancestor-or-self::iso:bibitem">true</xsl:when>
1274
+ <xsl:when test="ancestor-or-self::iso:term">true</xsl:when>
1275
+ <xsl:otherwise>false</xsl:otherwise>
1276
+ </xsl:choose>
1277
+ </xsl:variable>
1278
+
1209
1279
 
1210
- <xsl:if test="$display = 'true'">
1280
+ <xsl:if test="$skip = 'false'">
1211
1281
 
1212
1282
  <xsl:variable name="title">
1213
1283
  <xsl:call-template name="getName"/>
@@ -1218,12 +1288,13 @@
1218
1288
  <xsl:if test="ancestor-or-self::iso:annex">annex</xsl:if>
1219
1289
  </xsl:variable>
1220
1290
 
1221
- <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}">
1222
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
1291
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
1292
+ <title>
1293
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
1294
+ </title>
1295
+ <xsl:apply-templates mode="contents"/>
1223
1296
  </item>
1224
- <xsl:apply-templates mode="contents"/>
1225
- </xsl:if>
1226
-
1297
+ </xsl:if>
1227
1298
  </xsl:template>
1228
1299
 
1229
1300
 
@@ -1446,7 +1517,7 @@
1446
1517
  </xsl:element>
1447
1518
  <xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')">
1448
1519
  <fo:block margin-bottom="12pt">
1449
- <xsl:if test="ancestor::iso:annex">
1520
+ <xsl:if test="ancestor::iso:annex or following-sibling::iso:table">
1450
1521
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
1451
1522
  </xsl:if>
1452
1523
  <xsl:value-of select="$linebreak"/>
@@ -1579,7 +1650,7 @@
1579
1650
 
1580
1651
 
1581
1652
 
1582
- <xsl:template match="iso:ul | iso:ol">
1653
+ <xsl:template match="iso:ul | iso:ol" mode="ul_ol">
1583
1654
  <fo:list-block provisional-distance-between-starts="7mm" margin-top="8pt"> <!-- margin-bottom="8pt" -->
1584
1655
  <xsl:apply-templates/>
1585
1656
  </fo:list-block>
@@ -1606,7 +1677,9 @@
1606
1677
  </fo:list-item>
1607
1678
  </xsl:template>
1608
1679
 
1609
-
1680
+ <xsl:template match="iso:note" mode="process">
1681
+ <xsl:call-template name="note"/>
1682
+ </xsl:template>
1610
1683
 
1611
1684
  <xsl:template match="iso:preferred">
1612
1685
  <fo:block line-height="1.1">
@@ -1688,8 +1761,12 @@
1688
1761
 
1689
1762
  <xsl:template match="mathml:math" priority="2">
1690
1763
  <fo:inline font-family="Cambria Math">
1764
+ <xsl:variable name="mathml">
1765
+ <xsl:apply-templates select="." mode="mathml"/>
1766
+ </xsl:variable>
1691
1767
  <fo:instream-foreign-object fox:alt-text="Math">
1692
- <xsl:copy-of select="."/>
1768
+ <!-- <xsl:copy-of select="."/> -->
1769
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
1693
1770
  </fo:instream-foreign-object>
1694
1771
  </fo:inline>
1695
1772
  </xsl:template>
@@ -1979,6 +2056,12 @@
1979
2056
 
1980
2057
  </title-edition>
1981
2058
 
2059
+ <title-edition lang="fr">
2060
+
2061
+ <xsl:text>Édition </xsl:text>
2062
+
2063
+ </title-edition>
2064
+
1982
2065
 
1983
2066
  <title-toc lang="en">
1984
2067
 
@@ -2025,7 +2108,12 @@
2025
2108
 
2026
2109
 
2027
2110
 
2028
- <title-source lang="en">SOURCE</title-source>
2111
+ <title-source lang="en">
2112
+
2113
+ <xsl:text>SOURCE</xsl:text>
2114
+
2115
+
2116
+ </title-source>
2029
2117
 
2030
2118
  <title-keywords lang="en">Keywords</title-keywords>
2031
2119
 
@@ -2068,6 +2156,10 @@
2068
2156
  <title-warning lang="zh">警告</title-warning>
2069
2157
 
2070
2158
  <title-amendment lang="en">AMENDMENT</title-amendment>
2159
+
2160
+ <title-continued lang="en">(continued)</title-continued>
2161
+ <title-continued lang="fr">(continué)</title-continued>
2162
+
2071
2163
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
2072
2164
  <xsl:param name="name"/>
2073
2165
  <xsl:variable name="lang">
@@ -2082,18 +2174,20 @@
2082
2174
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
2083
2175
  </xsl:otherwise>
2084
2176
  </xsl:choose>
2085
- </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">
2177
+ </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">
2178
+
2179
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
2086
2180
 
2087
2181
  <xsl:attribute name="color">blue</xsl:attribute>
2088
2182
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
2089
2183
 
2090
2184
 
2185
+
2091
2186
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
2092
2187
  <xsl:attribute name="white-space">pre</xsl:attribute>
2093
2188
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2094
2189
 
2095
- <xsl:attribute name="font-family">Courier</xsl:attribute>
2096
- <xsl:attribute name="font-size">9pt</xsl:attribute>
2190
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
2097
2191
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2098
2192
 
2099
2193
 
@@ -2103,6 +2197,7 @@
2103
2197
 
2104
2198
 
2105
2199
 
2200
+
2106
2201
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
2107
2202
 
2108
2203
  </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
@@ -2153,6 +2248,7 @@
2153
2248
 
2154
2249
 
2155
2250
 
2251
+
2156
2252
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
2157
2253
 
2158
2254
 
@@ -2173,6 +2269,7 @@
2173
2269
 
2174
2270
 
2175
2271
 
2272
+
2176
2273
 
2177
2274
 
2178
2275
 
@@ -2209,9 +2306,10 @@
2209
2306
 
2210
2307
 
2211
2308
 
2309
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
2212
2310
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2213
2311
  <xsl:attribute name="text-align">center</xsl:attribute>
2214
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
2312
+ <!-- <xsl:attribute name="margin-top">12pt</xsl:attribute> -->
2215
2313
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2216
2314
 
2217
2315
 
@@ -2242,11 +2340,13 @@
2242
2340
 
2243
2341
  <xsl:attribute name="color">blue</xsl:attribute>
2244
2342
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
2245
-
2343
+
2344
+
2246
2345
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
2247
2346
 
2248
2347
 
2249
2348
 
2349
+
2250
2350
  </xsl:attribute-set><xsl:attribute-set name="note-style">
2251
2351
 
2252
2352
 
@@ -2266,20 +2366,20 @@
2266
2366
 
2267
2367
 
2268
2368
 
2369
+ </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">
2269
2370
 
2270
2371
 
2271
- </xsl:attribute-set><xsl:attribute-set name="note-name-style">
2272
2372
 
2273
2373
 
2274
2374
 
2275
2375
 
2376
+ <xsl:attribute name="padding-right">6mm</xsl:attribute>
2377
+
2276
2378
 
2277
2379
 
2278
- <xsl:attribute name="padding-right">6mm</xsl:attribute>
2279
2380
 
2280
2381
 
2281
2382
 
2282
-
2283
2383
 
2284
2384
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
2285
2385
 
@@ -2309,6 +2409,8 @@
2309
2409
 
2310
2410
 
2311
2411
 
2412
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2413
+
2312
2414
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
2313
2415
 
2314
2416
 
@@ -2337,6 +2439,7 @@
2337
2439
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
2338
2440
 
2339
2441
 
2442
+
2340
2443
  </xsl:attribute-set><xsl:attribute-set name="term-style">
2341
2444
 
2342
2445
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
@@ -2345,6 +2448,7 @@
2345
2448
 
2346
2449
 
2347
2450
 
2451
+
2348
2452
 
2349
2453
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2350
2454
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -2388,14 +2492,16 @@
2388
2492
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
2389
2493
 
2390
2494
 
2391
- <xsl:attribute name="font-family">Courier</xsl:attribute>
2392
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2495
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
2496
+
2393
2497
 
2394
2498
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
2395
2499
  <xsl:attribute name="font-size">11pt</xsl:attribute>
2396
2500
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2397
2501
  <xsl:attribute name="text-align">center</xsl:attribute>
2398
2502
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2503
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
2504
+
2399
2505
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
2400
2506
 
2401
2507
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -2461,12 +2567,10 @@
2461
2567
 
2462
2568
 
2463
2569
 
2464
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2570
+ <!-- $namespace = 'iso' or -->
2465
2571
 
2466
2572
 
2467
2573
 
2468
- <xsl:call-template name="fn_name_display"/>
2469
-
2470
2574
 
2471
2575
 
2472
2576
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
@@ -2520,8 +2624,9 @@
2520
2624
 
2521
2625
 
2522
2626
 
2627
+
2523
2628
 
2524
-
2629
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
2525
2630
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2526
2631
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
2527
2632
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
@@ -2551,6 +2656,8 @@
2551
2656
 
2552
2657
 
2553
2658
 
2659
+
2660
+
2554
2661
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
2555
2662
  <xsl:choose>
2556
2663
  <xsl:when test=". = 1 or . = 0">
@@ -2581,8 +2688,11 @@
2581
2688
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
2582
2689
  <xsl:if test="normalize-space() != ''">
2583
2690
  <fo:block xsl:use-attribute-sets="table-name-style">
2584
- <xsl:apply-templates/>
2585
- </fo:block>
2691
+
2692
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2693
+
2694
+ <xsl:apply-templates/>
2695
+ </fo:block>
2586
2696
  </xsl:if>
2587
2697
  </xsl:template><xsl:template name="calculate-columns-numbers">
2588
2698
  <xsl:param name="table-row"/>
@@ -2698,28 +2808,29 @@
2698
2808
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2699
2809
  <xsl:param name="cols-count"/>
2700
2810
  <!-- font-weight="bold" -->
2701
- <fo:table-header>
2702
-
2703
- <fo:table-row>
2704
- <fo:table-cell number-columns-spanned="{$cols-count}"> <!-- border-left="1pt solid white" border-right="1pt solid white" border-top="1pt solid white" -->
2705
- <fo:block text-align="center" font-size="11pt" font-weight="bold">
2706
- <!-- (continued) -->
2707
- <fo:block-container position="absolute" top="-7mm">
2708
- <fo:block>
2709
- <fo:retrieve-table-marker retrieve-class-name="table_continued" retrieve-position-within-table="first-starting" retrieve-boundary-within-table="table-fragment"/>
2710
- </fo:block>
2711
- </fo:block-container>
2811
+ <fo:table-header>
2712
2812
 
2713
- </fo:block>
2714
- <!-- <fo:block>fn_name_display
2715
- <xsl:call-template name="fn_name_display"/>
2716
- </fo:block> -->
2813
+ <xsl:call-template name="table-header-title">
2814
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2815
+ </xsl:call-template>
2717
2816
 
2718
- </fo:table-cell>
2719
- </fo:table-row>
2720
-
2721
2817
  <xsl:apply-templates/>
2722
2818
  </fo:table-header>
2819
+ </xsl:template><xsl:template name="table-header-title">
2820
+ <xsl:param name="cols-count"/>
2821
+ <!-- row for title -->
2822
+ <fo:table-row>
2823
+ <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">
2824
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
2825
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
2826
+ <xsl:call-template name="fn_name_display"/>
2827
+ </xsl:for-each>
2828
+ <fo:block text-align="right" font-style="italic">
2829
+ <xsl:text> </xsl:text>
2830
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
2831
+ </fo:block>
2832
+ </fo:table-cell>
2833
+ </fo:table-row>
2723
2834
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
2724
2835
  <fo:table-body>
2725
2836
  <xsl:apply-templates/>
@@ -2785,6 +2896,17 @@
2785
2896
  </xsl:choose>
2786
2897
  </xsl:variable>
2787
2898
 
2899
+
2900
+ <!-- if there isn't 'thead' and there is a table's title -->
2901
+ <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='thead']) and ancestor::*[local-name()='table']/*[local-name()='name']">
2902
+ <fo:table-header>
2903
+ <xsl:call-template name="table-header-title">
2904
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2905
+ </xsl:call-template>
2906
+ </fo:table-header>
2907
+ </xsl:if>
2908
+
2909
+
2788
2910
  <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
2789
2911
  <xsl:with-param name="cols-count" select="$cols-count"/>
2790
2912
  </xsl:apply-templates>
@@ -2794,6 +2916,30 @@
2794
2916
  </xsl:call-template>
2795
2917
 
2796
2918
  <fo:table-body>
2919
+
2920
+ <xsl:variable name="title_continued">
2921
+ <xsl:call-template name="getTitle">
2922
+ <xsl:with-param name="name" select="'title-continued'"/>
2923
+ </xsl:call-template>
2924
+ </xsl:variable>
2925
+ <fo:table-row height="0" keep-with-next.within-page="always">
2926
+ <fo:table-cell>
2927
+ <fo:marker marker-class-name="table_continued"/>
2928
+ <fo:block/>
2929
+ </fo:table-cell>
2930
+ </fo:table-row>
2931
+ <fo:table-row height="0" keep-with-next.within-page="always">
2932
+ <fo:table-cell>
2933
+ <fo:marker marker-class-name="table_continued">
2934
+ <!-- <fo:inline font-style="italic" font-weight="normal"> -->
2935
+ <xsl:value-of select="$title_continued"/>
2936
+ <!-- </fo:inline> -->
2937
+ </fo:marker>
2938
+ <fo:block/>
2939
+ </fo:table-cell>
2940
+ </fo:table-row>
2941
+
2942
+
2797
2943
  <xsl:apply-templates/>
2798
2944
  <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
2799
2945
 
@@ -2835,6 +2981,8 @@
2835
2981
 
2836
2982
  </xsl:if>
2837
2983
 
2984
+
2985
+
2838
2986
 
2839
2987
  <xsl:apply-templates/>
2840
2988
  </fo:table-row>
@@ -2859,6 +3007,7 @@
2859
3007
 
2860
3008
 
2861
3009
 
3010
+
2862
3011
  <xsl:if test="@colspan">
2863
3012
  <xsl:attribute name="number-columns-spanned">
2864
3013
  <xsl:value-of select="@colspan"/>
@@ -2869,10 +3018,22 @@
2869
3018
  <xsl:value-of select="@rowspan"/>
2870
3019
  </xsl:attribute>
2871
3020
  </xsl:if>
3021
+ <xsl:call-template name="display-align"/>
2872
3022
  <fo:block>
2873
3023
  <xsl:apply-templates/>
2874
3024
  </fo:block>
2875
3025
  </fo:table-cell>
3026
+ </xsl:template><xsl:template name="display-align">
3027
+ <xsl:if test="@valign">
3028
+ <xsl:attribute name="display-align">
3029
+ <xsl:choose>
3030
+ <xsl:when test="@valign = 'top'">before</xsl:when>
3031
+ <xsl:when test="@valign = 'middle'">center</xsl:when>
3032
+ <xsl:when test="@valign = 'bottom'">after</xsl:when>
3033
+ <xsl:otherwise>before</xsl:otherwise>
3034
+ </xsl:choose>
3035
+ </xsl:attribute>
3036
+ </xsl:if>
2876
3037
  </xsl:template><xsl:template match="*[local-name()='td']">
2877
3038
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
2878
3039
  <xsl:attribute name="text-align">
@@ -2898,6 +3059,7 @@
2898
3059
 
2899
3060
 
2900
3061
 
3062
+
2901
3063
  <xsl:if test="@colspan">
2902
3064
  <xsl:attribute name="number-columns-spanned">
2903
3065
  <xsl:value-of select="@colspan"/>
@@ -2908,20 +3070,8 @@
2908
3070
  <xsl:value-of select="@rowspan"/>
2909
3071
  </xsl:attribute>
2910
3072
  </xsl:if>
2911
- <fo:block>
2912
-
2913
- <xsl:variable name="row_number">
2914
- <xsl:number format="1" count="*[local-name() = 'tr'] | *[local-name() = 'th']"/>
2915
- </xsl:variable>
2916
- <fo:marker marker-class-name="table_continued">
2917
- <xsl:if test="$row_number &gt; 1">
2918
- <fo:inline>
2919
- <xsl:apply-templates select="ancestor::*[local-name() = 'table']/*[local-name() = 'name']" mode="contents"/>
2920
- <fo:inline font-style="italic" font-weight="normal">(continued)</fo:inline>
2921
- </fo:inline>
2922
- </xsl:if>
2923
- </fo:marker>
2924
-
3073
+ <xsl:call-template name="display-align"/>
3074
+ <fo:block>
2925
3075
  <xsl:apply-templates/>
2926
3076
  </fo:block>
2927
3077
  </fo:table-cell>
@@ -3110,6 +3260,7 @@
3110
3260
 
3111
3261
 
3112
3262
 
3263
+
3113
3264
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
3114
3265
 
3115
3266
  <xsl:value-of select="@reference"/>
@@ -3120,129 +3271,143 @@
3120
3271
  <xsl:apply-templates/>
3121
3272
  </fo:inline>
3122
3273
  </xsl:template><xsl:template match="*[local-name()='dl']">
3123
- <xsl:variable name="parent" select="local-name(..)"/>
3124
-
3125
- <xsl:variable name="key_iso">
3126
-
3127
- <xsl:if test="$parent = 'figure' or $parent = 'formula'">true</xsl:if>
3128
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
3129
- </xsl:variable>
3130
-
3131
- <xsl:choose>
3132
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
3133
-
3274
+ <fo:block-container margin-left="0mm">
3275
+ <xsl:if test="parent::*[local-name() = 'note']">
3276
+ <xsl:attribute name="margin-left">
3277
+ <xsl:choose>
3278
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3279
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3280
+ </xsl:choose>
3281
+ </xsl:attribute>
3134
3282
 
3135
- <fo:block margin-bottom="12pt" text-align="left">
3136
-
3137
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
3138
-
3139
- <xsl:variable name="title-where">
3140
- <xsl:call-template name="getTitle">
3141
- <xsl:with-param name="name" select="'title-where'"/>
3142
- </xsl:call-template>
3143
- </xsl:variable>
3144
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
3145
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
3146
- <xsl:text/>
3147
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
3148
- </fo:block>
3283
+ </xsl:if>
3284
+ <fo:block-container margin-left="0mm">
3285
+
3286
+ <xsl:variable name="parent" select="local-name(..)"/>
3149
3287
 
3150
- </xsl:when>
3151
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
3152
- <fo:block margin-bottom="12pt" text-align="left">
3153
-
3154
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3288
+ <xsl:variable name="key_iso">
3155
3289
 
3156
-
3157
-
3158
-
3159
- <xsl:variable name="title-where">
3160
- <xsl:call-template name="getTitle">
3161
- <xsl:with-param name="name" select="'title-where'"/>
3162
- </xsl:call-template>
3163
- </xsl:variable>
3164
- <xsl:value-of select="$title-where"/>
3165
- </fo:block>
3166
- </xsl:when>
3167
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
3168
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
3169
-
3170
- <xsl:attribute name="font-size">10pt</xsl:attribute>
3171
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
3172
-
3173
-
3174
-
3175
- <xsl:variable name="title-key">
3176
- <xsl:call-template name="getTitle">
3177
- <xsl:with-param name="name" select="'title-key'"/>
3178
- </xsl:call-template>
3179
- </xsl:variable>
3180
- <xsl:value-of select="$title-key"/>
3181
- </fo:block>
3182
- </xsl:when>
3183
- </xsl:choose>
3184
-
3185
- <!-- a few components -->
3186
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
3187
- <fo:block>
3188
-
3189
- <xsl:if test="$parent = 'formula'">
3190
- <xsl:attribute name="margin-left">4mm</xsl:attribute>
3191
- </xsl:if>
3192
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
3193
-
3194
-
3195
-
3290
+ <xsl:if test="$parent = 'figure' or $parent = 'formula'">true</xsl:if>
3291
+ <!-- and (not(../@class) or ../@class !='pseudocode') -->
3292
+ </xsl:variable>
3196
3293
 
3197
- <fo:block>
3198
-
3199
-
3200
-
3201
-
3202
- <fo:table width="95%" table-layout="fixed">
3294
+ <xsl:choose>
3295
+ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
3203
3296
 
3204
- <xsl:choose>
3205
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
3206
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
3207
- </xsl:when>
3208
- <xsl:when test="normalize-space($key_iso) = 'true'">
3297
+
3298
+ <fo:block margin-bottom="12pt" text-align="left">
3299
+
3300
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
3301
+
3302
+ <xsl:variable name="title-where">
3303
+ <xsl:call-template name="getTitle">
3304
+ <xsl:with-param name="name" select="'title-where'"/>
3305
+ </xsl:call-template>
3306
+ </xsl:variable>
3307
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
3308
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
3309
+ <xsl:text/>
3310
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
3311
+ </fo:block>
3312
+
3313
+ </xsl:when>
3314
+ <xsl:when test="$parent = 'formula'"> <!-- a few components -->
3315
+ <fo:block margin-bottom="12pt" text-align="left">
3316
+
3317
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3318
+
3319
+
3320
+
3321
+
3322
+ <xsl:variable name="title-where">
3323
+ <xsl:call-template name="getTitle">
3324
+ <xsl:with-param name="name" select="'title-where'"/>
3325
+ </xsl:call-template>
3326
+ </xsl:variable>
3327
+ <xsl:value-of select="$title-where"/>
3328
+ </fo:block>
3329
+ </xsl:when>
3330
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
3331
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
3332
+
3209
3333
  <xsl:attribute name="font-size">10pt</xsl:attribute>
3334
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
3335
+
3336
+
3337
+
3338
+ <xsl:variable name="title-key">
3339
+ <xsl:call-template name="getTitle">
3340
+ <xsl:with-param name="name" select="'title-key'"/>
3341
+ </xsl:call-template>
3342
+ </xsl:variable>
3343
+ <xsl:value-of select="$title-key"/>
3344
+ </fo:block>
3345
+ </xsl:when>
3346
+ </xsl:choose>
3347
+
3348
+ <!-- a few components -->
3349
+ <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
3350
+ <fo:block>
3351
+
3352
+ <xsl:if test="$parent = 'formula'">
3353
+ <xsl:attribute name="margin-left">4mm</xsl:attribute>
3354
+ </xsl:if>
3355
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
3356
+
3357
+
3358
+
3359
+
3360
+ <fo:block>
3361
+
3362
+
3363
+
3364
+
3365
+ <fo:table width="95%" table-layout="fixed">
3210
3366
 
3211
- </xsl:when>
3212
- </xsl:choose>
3213
- <!-- create virtual html table for dl/[dt and dd] -->
3214
- <xsl:variable name="html-table">
3215
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3216
- <xsl:element name="{$ns}:table">
3217
- <tbody>
3218
- <xsl:apply-templates mode="dl"/>
3219
- </tbody>
3220
- </xsl:element>
3221
- </xsl:variable>
3222
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
3223
- <xsl:variable name="colwidths">
3224
- <xsl:call-template name="calculate-column-widths">
3225
- <xsl:with-param name="cols-count" select="2"/>
3226
- <xsl:with-param name="table" select="$html-table"/>
3227
- </xsl:call-template>
3228
- </xsl:variable>
3229
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
3230
- <xsl:variable name="maxlength_dt">
3231
- <xsl:call-template name="getMaxLength_dt"/>
3232
- </xsl:variable>
3233
- <xsl:call-template name="setColumnWidth_dl">
3234
- <xsl:with-param name="colwidths" select="$colwidths"/>
3235
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3236
- </xsl:call-template>
3237
- <fo:table-body>
3238
- <xsl:apply-templates>
3239
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
3240
- </xsl:apply-templates>
3241
- </fo:table-body>
3242
- </fo:table>
3243
- </fo:block>
3244
- </fo:block>
3245
- </xsl:if>
3367
+ <xsl:choose>
3368
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
3369
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
3370
+ </xsl:when>
3371
+ <xsl:when test="normalize-space($key_iso) = 'true'">
3372
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
3373
+
3374
+ </xsl:when>
3375
+ </xsl:choose>
3376
+ <!-- create virtual html table for dl/[dt and dd] -->
3377
+ <xsl:variable name="html-table">
3378
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3379
+ <xsl:element name="{$ns}:table">
3380
+ <tbody>
3381
+ <xsl:apply-templates mode="dl"/>
3382
+ </tbody>
3383
+ </xsl:element>
3384
+ </xsl:variable>
3385
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
3386
+ <xsl:variable name="colwidths">
3387
+ <xsl:call-template name="calculate-column-widths">
3388
+ <xsl:with-param name="cols-count" select="2"/>
3389
+ <xsl:with-param name="table" select="$html-table"/>
3390
+ </xsl:call-template>
3391
+ </xsl:variable>
3392
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
3393
+ <xsl:variable name="maxlength_dt">
3394
+ <xsl:call-template name="getMaxLength_dt"/>
3395
+ </xsl:variable>
3396
+ <xsl:call-template name="setColumnWidth_dl">
3397
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3398
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3399
+ </xsl:call-template>
3400
+ <fo:table-body>
3401
+ <xsl:apply-templates>
3402
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
3403
+ </xsl:apply-templates>
3404
+ </fo:table-body>
3405
+ </fo:table>
3406
+ </fo:block>
3407
+ </fo:block>
3408
+ </xsl:if>
3409
+ </fo:block-container>
3410
+ </fo:block-container>
3246
3411
  </xsl:template><xsl:template name="setColumnWidth_dl">
3247
3412
  <xsl:param name="colwidths"/>
3248
3413
  <xsl:param name="maxlength_dt"/>
@@ -3339,6 +3504,7 @@
3339
3504
  <xsl:param name="key_iso"/>
3340
3505
 
3341
3506
  <fo:table-row>
3507
+
3342
3508
  <fo:table-cell>
3343
3509
 
3344
3510
  <fo:block margin-top="6pt">
@@ -3366,14 +3532,36 @@
3366
3532
  <fo:table-cell>
3367
3533
  <fo:block>
3368
3534
 
3369
-
3535
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
3536
+ <xsl:if test="local-name(*[1]) != 'stem'">
3537
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
3538
+ </xsl:if>
3539
+ </xsl:if> -->
3370
3540
 
3371
3541
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
3372
3542
 
3373
3543
  </fo:block>
3374
3544
  </fo:table-cell>
3375
3545
  </fo:table-row>
3376
-
3546
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
3547
+ <xsl:if test="local-name(*[1]) = 'stem'">
3548
+ <fo:table-row>
3549
+ <fo:table-cell>
3550
+ <fo:block margin-top="6pt">
3551
+ <xsl:if test="normalize-space($key_iso) = 'true'">
3552
+ <xsl:attribute name="margin-top">0</xsl:attribute>
3553
+ </xsl:if>
3554
+ <xsl:text>&#xA0;</xsl:text>
3555
+ </fo:block>
3556
+ </fo:table-cell>
3557
+ <fo:table-cell>
3558
+ <fo:block>
3559
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
3560
+ </fo:block>
3561
+ </fo:table-cell>
3562
+ </fo:table-row>
3563
+ </xsl:if>
3564
+ </xsl:if> -->
3377
3565
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
3378
3566
  <xsl:apply-templates/>
3379
3567
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
@@ -3398,6 +3586,31 @@
3398
3586
  </fo:inline>
3399
3587
  </xsl:template><xsl:template match="*[local-name()='tt']">
3400
3588
  <fo:inline xsl:use-attribute-sets="tt-style">
3589
+ <xsl:variable name="_font-size">
3590
+
3591
+
3592
+
3593
+
3594
+
3595
+ 10
3596
+
3597
+
3598
+
3599
+
3600
+
3601
+
3602
+
3603
+
3604
+ </xsl:variable>
3605
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3606
+ <xsl:if test="$font-size != ''">
3607
+ <xsl:attribute name="font-size">
3608
+ <xsl:choose>
3609
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3610
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3611
+ </xsl:choose>
3612
+ </xsl:attribute>
3613
+ </xsl:if>
3401
3614
  <xsl:apply-templates/>
3402
3615
  </fo:inline>
3403
3616
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -3724,10 +3937,23 @@
3724
3937
  <xsl:value-of select="substring($str, 2)"/>
3725
3938
  </xsl:template><xsl:template match="mathml:math">
3726
3939
  <fo:inline font-family="STIX2Math">
3727
- <fo:instream-foreign-object fox:alt-text="Math">
3728
- <xsl:copy-of select="."/>
3729
- </fo:instream-foreign-object>
3940
+ <xsl:variable name="mathml">
3941
+ <xsl:apply-templates select="." mode="mathml"/>
3942
+ </xsl:variable>
3943
+ <fo:instream-foreign-object fox:alt-text="Math">
3944
+ <!-- <xsl:copy-of select="."/> -->
3945
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
3946
+ </fo:instream-foreign-object>
3730
3947
  </fo:inline>
3948
+ </xsl:template><xsl:template match="@*|node()" mode="mathml">
3949
+ <xsl:copy>
3950
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
3951
+ </xsl:copy>
3952
+ </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
3953
+ <xsl:copy>
3954
+ <!-- replace start and end spaces to non-break space -->
3955
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3956
+ </xsl:copy>
3731
3957
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3732
3958
  <xsl:variable name="target">
3733
3959
  <xsl:choose>
@@ -3808,9 +4034,22 @@
3808
4034
  <xsl:apply-templates/>
3809
4035
  </fo:basic-link>
3810
4036
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
3811
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
3812
- <xsl:apply-templates/>
3813
- </fo:block>
4037
+ <fo:block-container margin-left="0mm">
4038
+ <xsl:if test="parent::*[local-name() = 'note']">
4039
+ <xsl:attribute name="margin-left">
4040
+ <xsl:choose>
4041
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
4042
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4043
+ </xsl:choose>
4044
+ </xsl:attribute>
4045
+
4046
+ </xsl:if>
4047
+ <fo:block-container margin-left="0mm">
4048
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
4049
+ <xsl:apply-templates/>
4050
+ </fo:block>
4051
+ </fo:block-container>
4052
+ </fo:block-container>
3814
4053
  </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
3815
4054
  <fo:inline>
3816
4055
  <xsl:apply-templates/>
@@ -3870,7 +4109,9 @@
3870
4109
  </xsl:choose>
3871
4110
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
3872
4111
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
3873
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4112
+ <fo:inline xsl:use-attribute-sets="termnote-name-style">
4113
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4114
+ </fo:inline>
3874
4115
  <xsl:apply-templates/>
3875
4116
  </fo:block>
3876
4117
  </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">
@@ -3967,12 +4208,101 @@
3967
4208
 
3968
4209
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3969
4210
  </fo:block>
3970
- </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">
4211
+ </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">
3971
4212
  <xsl:apply-templates mode="contents"/>
3972
4213
  <xsl:text> </xsl:text>
3973
- </xsl:template><xsl:template match="text()" mode="contents">
4214
+ </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">
4215
+ <xsl:apply-templates mode="bookmarks"/>
4216
+ <xsl:text> </xsl:text>
4217
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
3974
4218
  <xsl:value-of select="."/>
3975
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
4219
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
4220
+ <xsl:value-of select="."/>
4221
+ </xsl:template><xsl:template match="node()" mode="contents">
4222
+ <xsl:apply-templates mode="contents"/>
4223
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
4224
+ <xsl:apply-templates mode="bookmarks"/>
4225
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
4226
+ <xsl:apply-templates select="."/>
4227
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4228
+ <xsl:apply-templates mode="bookmarks"/>
4229
+ </xsl:template><xsl:template name="addBookmarks">
4230
+ <xsl:param name="contents"/>
4231
+ <xsl:if test="xalan:nodeset($contents)//item">
4232
+ <fo:bookmark-tree>
4233
+ <xsl:choose>
4234
+ <xsl:when test="xalan:nodeset($contents)/doc">
4235
+ <xsl:choose>
4236
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
4237
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
4238
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
4239
+ <fo:bookmark-title>
4240
+ <xsl:variable name="bookmark-title_">
4241
+ <xsl:choose>
4242
+ <xsl:when test="@lang = 'en'">
4243
+
4244
+
4245
+ </xsl:when>
4246
+ <xsl:when test="@lang = 'fr'">
4247
+
4248
+
4249
+ </xsl:when>
4250
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
4251
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
4252
+ </xsl:choose>
4253
+ </xsl:variable>
4254
+ <xsl:choose>
4255
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
4256
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
4257
+ </xsl:when>
4258
+ <xsl:otherwise>
4259
+ <xsl:choose>
4260
+ <xsl:when test="@lang = 'en'">English</xsl:when>
4261
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
4262
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
4263
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
4264
+ </xsl:choose>
4265
+ </xsl:otherwise>
4266
+ </xsl:choose>
4267
+ </fo:bookmark-title>
4268
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
4269
+ </fo:bookmark>
4270
+
4271
+ </xsl:for-each>
4272
+ </xsl:when>
4273
+ <xsl:otherwise>
4274
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
4275
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
4276
+ </xsl:for-each>
4277
+ </xsl:otherwise>
4278
+ </xsl:choose>
4279
+ </xsl:when>
4280
+ <xsl:otherwise>
4281
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
4282
+ </xsl:otherwise>
4283
+ </xsl:choose>
4284
+
4285
+
4286
+
4287
+
4288
+
4289
+
4290
+
4291
+
4292
+ </fo:bookmark-tree>
4293
+ </xsl:if>
4294
+ </xsl:template><xsl:template match="item" mode="bookmark">
4295
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
4296
+ <fo:bookmark-title>
4297
+ <xsl:if test="@section != ''">
4298
+ <xsl:value-of select="@section"/>
4299
+ <xsl:text> </xsl:text>
4300
+ </xsl:if>
4301
+ <xsl:value-of select="normalize-space(title)"/>
4302
+ </fo:bookmark-title>
4303
+ <xsl:apply-templates mode="bookmark"/>
4304
+ </fo:bookmark>
4305
+ </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">
3976
4306
  <xsl:if test="normalize-space() != ''">
3977
4307
  <fo:block xsl:use-attribute-sets="figure-name-style">
3978
4308
 
@@ -4030,7 +4360,7 @@
4030
4360
  <xsl:apply-templates/>
4031
4361
  </xsl:otherwise>
4032
4362
  </xsl:choose>
4033
- </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">
4363
+ </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">
4034
4364
  <xsl:text> </xsl:text>
4035
4365
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
4036
4366
  <xsl:copy>
@@ -4039,21 +4369,61 @@
4039
4369
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
4040
4370
  <xsl:text> </xsl:text>
4041
4371
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
4042
- <fo:block xsl:use-attribute-sets="sourcecode-style">
4043
- <xsl:apply-templates/>
4044
- </fo:block>
4045
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4046
- </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
4372
+
4373
+ <fo:block-container margin-left="0mm">
4374
+ <xsl:if test="parent::*[local-name() = 'note']">
4375
+ <xsl:attribute name="margin-left">
4376
+ <xsl:choose>
4377
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
4378
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4379
+ </xsl:choose>
4380
+ </xsl:attribute>
4381
+
4382
+ </xsl:if>
4383
+ <fo:block-container margin-left="0mm">
4384
+
4385
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
4386
+ <xsl:variable name="_font-size">
4387
+
4388
+
4389
+
4390
+
4391
+
4392
+ 9
4393
+
4394
+
4395
+
4396
+
4397
+
4398
+
4399
+
4400
+
4401
+ </xsl:variable>
4402
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
4403
+ <xsl:if test="$font-size != ''">
4404
+ <xsl:attribute name="font-size">
4405
+ <xsl:choose>
4406
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4407
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
4408
+ </xsl:choose>
4409
+ </xsl:attribute>
4410
+ </xsl:if>
4411
+ <xsl:apply-templates/>
4412
+ </fo:block>
4413
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4414
+
4415
+ </fo:block-container>
4416
+ </fo:block-container>
4417
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
4047
4418
  <xsl:variable name="text">
4048
4419
  <xsl:call-template name="add-zero-spaces-equal"/>
4049
4420
  </xsl:variable>
4050
- <xsl:call-template name="add-zero-spaces">
4421
+ <xsl:call-template name="add-zero-spaces-java">
4051
4422
  <xsl:with-param name="text" select="$text"/>
4052
4423
  </xsl:call-template>
4053
4424
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
4054
4425
  <xsl:if test="normalize-space() != ''">
4055
- <fo:block xsl:use-attribute-sets="sourcecode-name-style">
4056
-
4426
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
4057
4427
  <xsl:apply-templates/>
4058
4428
  </fo:block>
4059
4429
  </xsl:if>
@@ -4123,22 +4493,30 @@
4123
4493
  </fo:block>
4124
4494
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
4125
4495
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
4496
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
4497
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
4498
+ </xsl:if>
4126
4499
  <fo:block-container margin-left="0mm" margin-right="0mm">
4127
- <fo:table id="{@id}" table-layout="fixed" width="100%" border="0pt solid black">
4500
+ <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
4501
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
4502
+ <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
4503
+ </xsl:if>
4128
4504
  <xsl:variable name="simple-table">
4129
4505
  <xsl:call-template name="getSimpleTable"/>
4130
4506
  </xsl:variable>
4131
4507
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
4132
4508
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
4133
- <fo:table-column column-width="35mm"/>
4134
- <fo:table-column column-width="115mm"/>
4509
+ <!-- <fo:table-column column-width="35mm"/>
4510
+ <fo:table-column column-width="115mm"/> -->
4511
+ <fo:table-column column-width="30%"/>
4512
+ <fo:table-column column-width="70%"/>
4135
4513
  </xsl:if>
4136
4514
  <xsl:apply-templates mode="requirement"/>
4137
4515
  </fo:table>
4138
4516
  <!-- fn processing -->
4139
4517
  <xsl:if test=".//*[local-name() = 'fn']">
4140
4518
  <xsl:for-each select="*[local-name() = 'tbody']">
4141
- <fo:block font-size="90%" border-bottom="1.pt solid black">
4519
+ <fo:block font-size="90%" border-bottom="1pt solid black">
4142
4520
  <xsl:call-template name="fn_display"/>
4143
4521
  </fo:block>
4144
4522
  </xsl:for-each>
@@ -4154,17 +4532,27 @@
4154
4532
  <xsl:apply-templates mode="requirement"/>
4155
4533
  </fo:table-body>
4156
4534
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
4157
- <fo:table-row>
4535
+ <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
4536
+ <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
4537
+ <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
4538
+ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
4539
+ </xsl:if>
4540
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
4541
+ <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
4542
+ </xsl:if>
4543
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
4544
+ <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
4545
+ </xsl:if>
4158
4546
  <xsl:apply-templates mode="requirement"/>
4159
4547
  </fo:table-row>
4160
4548
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
4161
- <fo:table-cell text-align="{@align}">
4549
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
4162
4550
  <xsl:attribute name="text-align">
4163
4551
  <xsl:choose>
4164
4552
  <xsl:when test="@align">
4165
4553
  <xsl:value-of select="@align"/>
4166
4554
  </xsl:when>
4167
- <xsl:otherwise>center</xsl:otherwise>
4555
+ <xsl:otherwise>left</xsl:otherwise>
4168
4556
  </xsl:choose>
4169
4557
  </xsl:attribute>
4170
4558
  <xsl:if test="@colspan">
@@ -4177,22 +4565,27 @@
4177
4565
  <xsl:value-of select="@rowspan"/>
4178
4566
  </xsl:attribute>
4179
4567
  </xsl:if>
4568
+ <xsl:call-template name="display-align"/>
4180
4569
 
4181
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
4570
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
4182
4571
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
4183
4572
  <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
4184
4573
  </xsl:if>
4185
4574
  <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
4186
4575
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
4187
4576
  <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
4188
- </xsl:if>
4577
+ </xsl:if> -->
4189
4578
 
4190
4579
  <fo:block>
4191
4580
  <xsl:apply-templates/>
4192
4581
  </fo:block>
4193
4582
  </fo:table-cell>
4194
4583
  </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
4195
- <fo:table-cell text-align="{@align}">
4584
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
4585
+ <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
4586
+ <xsl:attribute name="padding">0mm</xsl:attribute>
4587
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
4588
+ </xsl:if>
4196
4589
  <xsl:attribute name="text-align">
4197
4590
  <xsl:choose>
4198
4591
  <xsl:when test="@align">
@@ -4201,6 +4594,9 @@
4201
4594
  <xsl:otherwise>left</xsl:otherwise>
4202
4595
  </xsl:choose>
4203
4596
  </xsl:attribute>
4597
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
4598
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
4599
+ </xsl:if>
4204
4600
  <xsl:if test="@colspan">
4205
4601
  <xsl:attribute name="number-columns-spanned">
4206
4602
  <xsl:value-of select="@colspan"/>
@@ -4211,25 +4607,27 @@
4211
4607
  <xsl:value-of select="@rowspan"/>
4212
4608
  </xsl:attribute>
4213
4609
  </xsl:if>
4610
+ <xsl:call-template name="display-align"/>
4214
4611
 
4215
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
4612
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
4216
4613
  <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
4217
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
4218
- <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])"> <!-- 2nd line and below -->
4614
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
4615
+ <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
4219
4616
  <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
4220
4617
  </xsl:if>
4221
- </xsl:if>
4618
+ </xsl:if> -->
4619
+ <!-- 2nd line and below -->
4222
4620
 
4223
4621
  <fo:block>
4224
4622
  <xsl:apply-templates/>
4225
4623
  </fo:block>
4226
4624
  </fo:table-cell>
4227
4625
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
4228
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="4pt">
4626
+ <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
4229
4627
  <xsl:apply-templates/>
4230
4628
  </fo:block>
4231
- </xsl:template><xsl:template match="*[local-name() = 'p'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
4232
- <fo:block margin-bottom="10pt">
4629
+ </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
4630
+ <fo:block> <!-- margin-bottom="10pt" -->
4233
4631
  <xsl:apply-templates/>
4234
4632
  </fo:block>
4235
4633
  </xsl:template><xsl:template match="*[local-name() = 'termexample']">
@@ -4251,12 +4649,13 @@
4251
4649
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4252
4650
 
4253
4651
  <xsl:variable name="element">
4254
- block
4652
+ block
4255
4653
 
4654
+ <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
4256
4655
  </xsl:variable>
4257
4656
 
4258
4657
  <xsl:choose>
4259
- <xsl:when test="normalize-space($element) = 'block'">
4658
+ <xsl:when test="contains(normalize-space($element), 'block')">
4260
4659
  <fo:block xsl:use-attribute-sets="example-body-style">
4261
4660
  <xsl:apply-templates/>
4262
4661
  </fo:block>
@@ -4293,25 +4692,44 @@
4293
4692
  </xsl:otherwise>
4294
4693
  </xsl:choose>
4295
4694
 
4296
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
4297
- <fo:block xsl:use-attribute-sets="example-p-style">
4695
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
4696
+
4697
+ <xsl:variable name="element">
4698
+ block
4298
4699
 
4299
- <xsl:apply-templates/>
4300
- </fo:block>
4700
+ </xsl:variable>
4701
+ <xsl:choose>
4702
+ <xsl:when test="normalize-space($element) = 'block'">
4703
+ <fo:block xsl:use-attribute-sets="example-p-style">
4704
+
4705
+ <xsl:apply-templates/>
4706
+ </fo:block>
4707
+ </xsl:when>
4708
+ <xsl:otherwise>
4709
+ <fo:inline xsl:use-attribute-sets="example-p-style">
4710
+ <xsl:apply-templates/>
4711
+ </fo:inline>
4712
+ </xsl:otherwise>
4713
+ </xsl:choose>
4301
4714
  </xsl:template><xsl:template match="*[local-name() = 'termsource']">
4302
4715
  <fo:block xsl:use-attribute-sets="termsource-style">
4303
4716
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
4304
4717
  <xsl:variable name="termsource_text">
4305
4718
  <xsl:apply-templates/>
4306
4719
  </xsl:variable>
4720
+
4307
4721
  <xsl:choose>
4308
4722
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
4309
4723
  <xsl:apply-templates/>
4310
4724
  </xsl:when>
4311
- <xsl:otherwise>
4312
- <xsl:text>[</xsl:text>
4313
- <xsl:apply-templates/>
4314
- <xsl:text>]</xsl:text>
4725
+ <xsl:otherwise>
4726
+
4727
+ <xsl:text>[</xsl:text>
4728
+
4729
+ <xsl:apply-templates/>
4730
+
4731
+ <xsl:text>]</xsl:text>
4732
+
4315
4733
  </xsl:otherwise>
4316
4734
  </xsl:choose>
4317
4735
  </fo:block>
@@ -4322,10 +4740,13 @@
4322
4740
  </xsl:template><xsl:template match="*[local-name() = 'origin']">
4323
4741
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4324
4742
 
4325
- <xsl:call-template name="getTitle">
4326
- <xsl:with-param name="name" select="'title-source'"/>
4327
- </xsl:call-template>
4328
- <xsl:text>: </xsl:text>
4743
+ <fo:inline>
4744
+
4745
+ <xsl:call-template name="getTitle">
4746
+ <xsl:with-param name="name" select="'title-source'"/>
4747
+ </xsl:call-template>
4748
+ <xsl:text>: </xsl:text>
4749
+ </fo:inline>
4329
4750
 
4330
4751
  <fo:inline xsl:use-attribute-sets="origin-style">
4331
4752
  <xsl:apply-templates/>
@@ -4337,18 +4758,29 @@
4337
4758
  <xsl:if test="normalize-space() != ''">
4338
4759
  <xsl:value-of select="."/>
4339
4760
  </xsl:if>
4340
- </xsl:template><xsl:template match="*[local-name() = 'quote']">
4761
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
4762
+ <fo:block-container margin-left="0mm">
4763
+ <xsl:if test="parent::*[local-name() = 'note']">
4764
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
4765
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
4766
+ </xsl:if>
4767
+ </xsl:if>
4768
+
4769
+ <fo:block-container margin-left="0mm">
4341
4770
 
4342
- <fo:block xsl:use-attribute-sets="quote-style">
4343
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
4344
- </fo:block>
4345
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
4346
- <fo:block xsl:use-attribute-sets="quote-source-style">
4347
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
4348
- <xsl:apply-templates select="*[local-name() = 'author']"/>
4349
- <xsl:apply-templates select="*[local-name() = 'source']"/>
4350
- </fo:block>
4351
- </xsl:if>
4771
+ <fo:block xsl:use-attribute-sets="quote-style">
4772
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
4773
+ </fo:block>
4774
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
4775
+ <fo:block xsl:use-attribute-sets="quote-source-style">
4776
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
4777
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
4778
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
4779
+ </fo:block>
4780
+ </xsl:if>
4781
+
4782
+ </fo:block-container>
4783
+ </fo:block-container>
4352
4784
  </xsl:template><xsl:template match="*[local-name() = 'source']">
4353
4785
  <xsl:if test="../*[local-name() = 'author']">
4354
4786
  <xsl:text>, </xsl:text>
@@ -4376,6 +4808,7 @@
4376
4808
  <xsl:if test="@type = 'inline'">
4377
4809
 
4378
4810
 
4811
+
4379
4812
  </xsl:if>
4380
4813
 
4381
4814
 
@@ -4413,6 +4846,7 @@
4413
4846
 
4414
4847
 
4415
4848
 
4849
+
4416
4850
  </xsl:variable>
4417
4851
 
4418
4852
  <xsl:variable name="padding-right">
@@ -4532,6 +4966,30 @@
4532
4966
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
4533
4967
  <!-- 0xA0 to space replacement -->
4534
4968
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
4969
+ </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
4970
+ <xsl:choose>
4971
+ <xsl:when test="parent::*[local-name() = 'note']">
4972
+ <fo:block-container>
4973
+ <xsl:attribute name="margin-left">
4974
+ <xsl:choose>
4975
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
4976
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4977
+ </xsl:choose>
4978
+ </xsl:attribute>
4979
+
4980
+ <fo:block-container margin-left="0mm">
4981
+ <fo:block>
4982
+ <xsl:apply-templates select="." mode="ul_ol"/>
4983
+ </fo:block>
4984
+ </fo:block-container>
4985
+ </fo:block-container>
4986
+ </xsl:when>
4987
+ <xsl:otherwise>
4988
+ <fo:block>
4989
+ <xsl:apply-templates select="." mode="ul_ol"/>
4990
+ </fo:block>
4991
+ </xsl:otherwise>
4992
+ </xsl:choose>
4535
4993
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
4536
4994
  <!-- <row>
4537
4995
  <date>05-07-2013</date>
@@ -4563,6 +5021,65 @@
4563
5021
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
4564
5022
  <fo:block><xsl:apply-templates/></fo:block>
4565
5023
  </fo:table-cell>
5024
+ </xsl:template><xsl:template name="processBibitem">
5025
+
5026
+
5027
+
5028
+
5029
+ </xsl:template><xsl:template name="processBibitemDocId">
5030
+ <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')]"/>
5031
+ <xsl:choose>
5032
+ <xsl:when test="normalize-space($_doc_ident) != ''">
5033
+ <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"/>
5034
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
5035
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
5036
+ </xsl:if>
5037
+ <xsl:value-of select="$_doc_ident"/>
5038
+ </xsl:when>
5039
+ <xsl:otherwise>
5040
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
5041
+ <xsl:if test="$type != ''">
5042
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
5043
+ </xsl:if>
5044
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
5045
+ </xsl:otherwise>
5046
+ </xsl:choose>
5047
+ </xsl:template><xsl:template name="processPersonalAuthor">
5048
+ <xsl:choose>
5049
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
5050
+ <author>
5051
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
5052
+ </author>
5053
+ </xsl:when>
5054
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
5055
+ <author>
5056
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
5057
+ <xsl:text> </xsl:text>
5058
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
5059
+ </author>
5060
+ </xsl:when>
5061
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
5062
+ <author>
5063
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
5064
+ <xsl:text> </xsl:text>
5065
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
5066
+ </author>
5067
+ </xsl:when>
5068
+ <xsl:otherwise>
5069
+ <xsl:apply-templates/>
5070
+ </xsl:otherwise>
5071
+ </xsl:choose>
5072
+ </xsl:template><xsl:template name="renderDate">
5073
+ <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
5074
+ <xsl:value-of select="*[local-name() = 'on']"/>
5075
+ </xsl:if>
5076
+ <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
5077
+ <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
5078
+ </xsl:if>
5079
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
5080
+ <xsl:value-of select="translate(.,'. ','')"/>
5081
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
5082
+ <xsl:value-of select="substring(.,1,1)"/>
4566
5083
  </xsl:template><xsl:template name="convertDate">
4567
5084
  <xsl:param name="date"/>
4568
5085
  <xsl:param name="format" select="'short'"/>
@@ -4770,6 +5287,7 @@
4770
5287
 
4771
5288
 
4772
5289
 
5290
+
4773
5291
  </xsl:variable>
4774
5292
  <xsl:if test="$documentNS != $XSLNS">
4775
5293
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -4795,4 +5313,21 @@
4795
5313
  </xsl:otherwise>
4796
5314
  </xsl:choose>
4797
5315
  </xsl:attribute>
5316
+ </xsl:template><xsl:template name="add-letter-spacing">
5317
+ <xsl:param name="text"/>
5318
+ <xsl:param name="letter-spacing" select="'0.15'"/>
5319
+ <xsl:if test="string-length($text) &gt; 0">
5320
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
5321
+ <fo:inline padding-right="{$letter-spacing}mm">
5322
+ <xsl:if test="$char = '®'">
5323
+ <xsl:attribute name="font-size">58%</xsl:attribute>
5324
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
5325
+ </xsl:if>
5326
+ <xsl:value-of select="$char"/>
5327
+ </fo:inline>
5328
+ <xsl:call-template name="add-letter-spacing">
5329
+ <xsl:with-param name="text" select="substring($text, 2)"/>
5330
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
5331
+ </xsl:call-template>
5332
+ </xsl:if>
4798
5333
  </xsl:template></xsl:stylesheet>