metanorma-cc 1.7.3 → 1.7.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4246fc710a6116a54dbb54fb9d983194f44fd97c1874d5e1caa684a3b8729974
4
- data.tar.gz: 6af597c710faabc0b2eb57f31e32e6349103f1d7472259221a445d9bb06475f0
3
+ metadata.gz: ff890df09212f9af0060e20ca9303d3ac0939cfaeaeae4c3e9dbf9fce1e4e21d
4
+ data.tar.gz: 1c70cb2dab8b0a5af72c4f3dd7b7b91398b280997b39c8fec0d7203ef49d82ec
5
5
  SHA512:
6
- metadata.gz: fa96ffbafe4f555da75dd05a02b0eecf6b0f3b6f2b56c757818d93749872a262b9ad24f6b46ca644df5244ee530e0b928aab819f7aaf8bb7df3a98f9f0779da1
7
- data.tar.gz: bbe9b70f768719e9d4f004f22495268e5fbfa6cfae88ae977de8ea19214de73cbfa5732b43be8847ba0d07aba0fa8ee9524de6fda06d704d250158aac90cca6c
6
+ metadata.gz: 2aac2d5367e7f35ad86f6af110b5fd62e7b7cf449f1a62dcadb5688312a04d60c6ffa8afecd7ba5bfc311739b7d16367727c086ebfc5a032d8c9ea34f5cf03b8
7
+ data.tar.gz: 4c659675adaef96f5d48d752c220855f163571411bdd324850b63203aab68db9fdf9cf961adcdb1507faae581ed37b390a5eef835cc14e1abf2673d629e1b44e
@@ -16,19 +16,9 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.7', '2.6', '2.5', '2.4' ]
19
+ ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
- include:
23
- - ruby: '3.0'
24
- os: 'ubuntu-latest'
25
- experimental: true
26
- - ruby: '3.0'
27
- os: 'windows-latest'
28
- experimental: true
29
- - ruby: '3.0'
30
- os: 'macos-latest'
31
- experimental: true
32
22
  steps:
33
23
  - uses: actions/checkout@v2
34
24
  with:
@@ -40,3 +30,14 @@ jobs:
40
30
  bundler-cache: true
41
31
 
42
32
  - run: bundle exec rake
33
+
34
+ tests-passed:
35
+ needs: rake
36
+ runs-on: ubuntu-latest
37
+ steps:
38
+ - uses: peter-evans/repository-dispatch@v1
39
+ with:
40
+ token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
41
+ repository: ${{ github.repository }}
42
+ event-type: tests-passed
43
+ client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
data/.hound.yml CHANGED
@@ -1,3 +1,5 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
1
3
  ruby:
2
- Enabled: true
4
+ enabled: true
3
5
  config_file: .rubocop.yml
data/.rubocop.yml CHANGED
@@ -1,12 +1,10 @@
1
- # This project follows the Ribose OSS style guide.
2
- # https://github.com/riboseinc/oss-guides
3
- # All project-specific additions and overrides should be specified in this file.
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
4
3
  inherit_from:
5
4
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
6
5
 
7
6
  # local repo-specific modifications
7
+ # ...
8
8
 
9
9
  AllCops:
10
- DisplayCopNames: false
11
- StyleGuideCopsOnly: false
12
- TargetRubyVersion: 2.4
10
+ TargetRubyVersion: 2.5
@@ -73,6 +73,9 @@
73
73
  <optional>
74
74
  <ref name="doctype"/>
75
75
  </optional>
76
+ <optional>
77
+ <ref name="docsubtype"/>
78
+ </optional>
76
79
  <ref name="editorialgroup"/>
77
80
  <zeroOrMore>
78
81
  <ref name="ics"/>
@@ -45,6 +45,11 @@
45
45
  <optional>
46
46
  <attribute name="alt"/>
47
47
  </optional>
48
+ <optional>
49
+ <attribute name="updatetype">
50
+ <data type="boolean"/>
51
+ </attribute>
52
+ </optional>
48
53
  <text/>
49
54
  </element>
50
55
  </define>
@@ -199,6 +204,18 @@
199
204
  </zeroOrMore>
200
205
  </element>
201
206
  </define>
207
+ <define name="dt">
208
+ <element name="dt">
209
+ <optional>
210
+ <attribute name="id">
211
+ <data type="ID"/>
212
+ </attribute>
213
+ </optional>
214
+ <zeroOrMore>
215
+ <ref name="TextElement"/>
216
+ </zeroOrMore>
217
+ </element>
218
+ </define>
202
219
  <define name="example">
203
220
  <element name="example">
204
221
  <attribute name="id">
@@ -543,6 +560,9 @@
543
560
  </define>
544
561
  <define name="BibDataExtensionType">
545
562
  <ref name="doctype"/>
563
+ <optional>
564
+ <ref name="docsubtype"/>
565
+ </optional>
546
566
  <optional>
547
567
  <ref name="editorialgroup"/>
548
568
  </optional>
@@ -890,6 +910,14 @@
890
910
  </define>
891
911
  </include>
892
912
  <!-- end overrides -->
913
+ <define name="docsubtype">
914
+ <element name="subdoctype">
915
+ <ref name="DocumentSubtype"/>
916
+ </element>
917
+ </define>
918
+ <define name="DocumentSubtype">
919
+ <text/>
920
+ </define>
893
921
  <define name="colgroup">
894
922
  <element name="colgroup">
895
923
  <oneOrMore>
@@ -939,7 +967,34 @@
939
967
  <define name="concept">
940
968
  <element name="concept">
941
969
  <optional>
942
- <attribute name="term"/>
970
+ <attribute name="ital">
971
+ <data type="boolean"/>
972
+ </attribute>
973
+ </optional>
974
+ <optional>
975
+ <attribute name="ref">
976
+ <data type="boolean"/>
977
+ </attribute>
978
+ </optional>
979
+ <optional>
980
+ <element name="refterm">
981
+ <zeroOrMore>
982
+ <choice>
983
+ <ref name="PureTextElement"/>
984
+ <ref name="stem"/>
985
+ </choice>
986
+ </zeroOrMore>
987
+ </element>
988
+ </optional>
989
+ <optional>
990
+ <element name="renderterm">
991
+ <zeroOrMore>
992
+ <choice>
993
+ <ref name="PureTextElement"/>
994
+ <ref name="stem"/>
995
+ </choice>
996
+ </zeroOrMore>
997
+ </element>
943
998
  </optional>
944
999
  <choice>
945
1000
  <ref name="eref"/>
@@ -965,6 +1020,9 @@
965
1020
  </attribute>
966
1021
  <attribute name="name"/>
967
1022
  <attribute name="action"/>
1023
+ <optional>
1024
+ <attribute name="class"/>
1025
+ </optional>
968
1026
  <zeroOrMore>
969
1027
  <choice>
970
1028
  <ref name="TextElement"/>
@@ -1457,26 +1515,26 @@
1457
1515
  <optional>
1458
1516
  <ref name="section-title"/>
1459
1517
  </optional>
1460
- <group>
1518
+ <choice>
1461
1519
  <choice>
1462
1520
  <group>
1463
- <zeroOrMore>
1521
+ <oneOrMore>
1464
1522
  <ref name="BasicBlock"/>
1465
- </zeroOrMore>
1523
+ </oneOrMore>
1466
1524
  <zeroOrMore>
1467
1525
  <ref name="note"/>
1468
1526
  </zeroOrMore>
1469
1527
  </group>
1470
1528
  <ref name="amend"/>
1471
1529
  </choice>
1472
- <zeroOrMore>
1530
+ <oneOrMore>
1473
1531
  <choice>
1474
1532
  <ref name="clause-subsection"/>
1475
1533
  <ref name="terms"/>
1476
1534
  <ref name="definitions"/>
1477
1535
  </choice>
1478
- </zeroOrMore>
1479
- </group>
1536
+ </oneOrMore>
1537
+ </choice>
1480
1538
  </define>
1481
1539
  <define name="Annex-Section">
1482
1540
  <optional>
@@ -7,8 +7,13 @@
7
7
  <xsl:variable name="images" select="document($svg_images)"/>
8
8
  <xsl:param name="basepath"/>
9
9
 
10
- <xsl:variable name="pageWidth" select="'210mm'"/>
11
- <xsl:variable name="pageHeight" select="'297mm'"/>
10
+ <xsl:variable name="pageWidth" select="210"/>
11
+ <xsl:variable name="pageHeight" select="297"/>
12
+ <xsl:variable name="marginLeftRight1" select="19"/>
13
+ <xsl:variable name="marginLeftRight2" select="19"/>
14
+ <xsl:variable name="marginTop" select="20.2"/>
15
+ <xsl:variable name="marginBottom" select="20.3"/>
16
+
12
17
 
13
18
 
14
19
 
@@ -42,7 +47,7 @@
42
47
  <fo:root font-family="Source Sans Pro, STIX Two Math, Source Han Sans" font-size="10.5pt" xml:lang="{$lang}">
43
48
  <fo:layout-master-set>
44
49
  <!-- Cover page -->
45
- <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
50
+ <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
46
51
  <fo:region-body margin-top="23.5mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
47
52
  <fo:region-before region-name="cover-page-header" extent="23.5mm"/>
48
53
  <fo:region-after extent="10mm"/>
@@ -53,27 +58,27 @@
53
58
  <!-- Document pages -->
54
59
 
55
60
  <!-- Preface odd pages -->
56
- <fo:simple-page-master master-name="odd-preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
57
- <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
61
+ <fo:simple-page-master master-name="odd-preface" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
62
+ <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
58
63
  <fo:region-before region-name="header-odd" extent="17mm"/>
59
64
  <fo:region-after region-name="footer-odd" extent="10mm"/>
60
- <fo:region-start region-name="left-region" extent="19mm"/>
61
- <fo:region-end region-name="right-region" extent="19mm"/>
65
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
66
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
62
67
  </fo:simple-page-master>
63
68
  <!-- Preface even pages -->
64
- <fo:simple-page-master master-name="even-preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
65
- <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
69
+ <fo:simple-page-master master-name="even-preface" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
70
+ <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
66
71
  <fo:region-before region-name="header-even" extent="17mm"/>
67
72
  <fo:region-after region-name="footer-even" extent="10mm"/>
68
- <fo:region-start region-name="left-region" extent="19mm"/>
69
- <fo:region-end region-name="right-region" extent="19mm"/>
73
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
74
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
70
75
  </fo:simple-page-master>
71
- <fo:simple-page-master master-name="blankpage" page-width="{$pageWidth}" page-height="{$pageHeight}">
72
- <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
76
+ <fo:simple-page-master master-name="blankpage" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
77
+ <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
73
78
  <fo:region-before region-name="header" extent="17mm"/>
74
79
  <fo:region-after region-name="footer" extent="10mm"/>
75
- <fo:region-start region-name="left" extent="19mm"/>
76
- <fo:region-end region-name="right" extent="19mm"/>
80
+ <fo:region-start region-name="left" extent="{$marginLeftRight1}mm"/>
81
+ <fo:region-end region-name="right" extent="{$marginLeftRight2}mm"/>
77
82
  </fo:simple-page-master>
78
83
  <fo:page-sequence-master master-name="preface">
79
84
  <fo:repeatable-page-master-alternatives>
@@ -84,20 +89,20 @@
84
89
  </fo:page-sequence-master>
85
90
 
86
91
  <!-- Document odd pages -->
87
- <fo:simple-page-master master-name="odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
88
- <fo:region-body margin-top="20.2mm" margin-bottom="20.3mm" margin-left="19mm" margin-right="19mm"/>
89
- <fo:region-before region-name="header-odd" extent="20.2mm"/>
90
- <fo:region-after region-name="footer-odd" extent="20.3mm"/>
91
- <fo:region-start region-name="left-region" extent="19mm"/>
92
- <fo:region-end region-name="right-region" extent="19mm"/>
92
+ <fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
93
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
94
+ <fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
95
+ <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
96
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
97
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
93
98
  </fo:simple-page-master>
94
99
  <!-- Preface even pages -->
95
- <fo:simple-page-master master-name="even" page-width="{$pageWidth}" page-height="{$pageHeight}">
96
- <fo:region-body margin-top="20.2mm" margin-bottom="20.3mm" margin-left="19mm" margin-right="19mm"/>
97
- <fo:region-before region-name="header-even" extent="20.2mm"/>
98
- <fo:region-after region-name="footer-even" extent="20.3mm"/>
99
- <fo:region-start region-name="left-region" extent="19mm"/>
100
- <fo:region-end region-name="right-region" extent="19mm"/>
100
+ <fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
101
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
102
+ <fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
103
+ <fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
104
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
105
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
101
106
  </fo:simple-page-master>
102
107
  <fo:page-sequence-master master-name="document">
103
108
  <fo:repeatable-page-master-alternatives>
@@ -969,6 +974,7 @@
969
974
 
970
975
 
971
976
 
977
+
972
978
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
973
979
  <xsl:attribute name="white-space">pre</xsl:attribute>
974
980
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -1017,7 +1023,7 @@
1017
1023
 
1018
1024
 
1019
1025
 
1020
-
1026
+
1021
1027
  </xsl:attribute-set><xsl:attribute-set name="example-style">
1022
1028
 
1023
1029
 
@@ -1032,6 +1038,7 @@
1032
1038
 
1033
1039
 
1034
1040
 
1041
+
1035
1042
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1036
1043
 
1037
1044
 
@@ -1054,9 +1061,7 @@
1054
1061
 
1055
1062
 
1056
1063
 
1057
-
1058
-
1059
-
1064
+
1060
1065
 
1061
1066
 
1062
1067
 
@@ -1085,6 +1090,7 @@
1085
1090
 
1086
1091
 
1087
1092
 
1093
+
1088
1094
  </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1089
1095
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1090
1096
 
@@ -1104,6 +1110,9 @@
1104
1110
 
1105
1111
 
1106
1112
 
1113
+
1114
+ </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
1115
+
1107
1116
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1108
1117
 
1109
1118
  <xsl:attribute name="font-size">12pt</xsl:attribute>
@@ -1126,14 +1135,17 @@
1126
1135
 
1127
1136
 
1128
1137
 
1138
+
1129
1139
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1130
1140
 
1131
1141
 
1142
+
1132
1143
  <xsl:attribute name="color">blue</xsl:attribute>
1133
1144
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1134
1145
 
1135
1146
 
1136
1147
 
1148
+
1137
1149
  </xsl:attribute-set><xsl:attribute-set name="note-style">
1138
1150
 
1139
1151
 
@@ -1153,6 +1165,7 @@
1153
1165
 
1154
1166
 
1155
1167
 
1168
+
1156
1169
  </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">
1157
1170
 
1158
1171
 
@@ -1195,10 +1208,12 @@
1195
1208
 
1196
1209
 
1197
1210
 
1211
+
1198
1212
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1199
1213
 
1200
1214
 
1201
1215
 
1216
+
1202
1217
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1203
1218
 
1204
1219
 
@@ -1227,10 +1242,12 @@
1227
1242
 
1228
1243
 
1229
1244
 
1245
+
1230
1246
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1231
1247
 
1232
1248
 
1233
1249
 
1250
+
1234
1251
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1235
1252
 
1236
1253
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
@@ -1255,6 +1272,7 @@
1255
1272
 
1256
1273
 
1257
1274
 
1275
+
1258
1276
 
1259
1277
 
1260
1278
 
@@ -1300,8 +1318,10 @@
1300
1318
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1301
1319
 
1302
1320
 
1321
+
1303
1322
  </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1304
1323
 
1324
+
1305
1325
  </xsl:attribute-set><xsl:attribute-set name="definition-style">
1306
1326
 
1307
1327
 
@@ -1326,6 +1346,8 @@
1326
1346
  <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
1327
1347
 
1328
1348
 
1349
+ </xsl:attribute-set><xsl:attribute-set name="list-style">
1350
+
1329
1351
  </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
1330
1352
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1331
1353
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -1336,14 +1358,15 @@
1336
1358
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1337
1359
 
1338
1360
  <!-- Normative references -->
1339
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1361
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/>
1340
1362
  <!-- Terms and definitions -->
1341
1363
  <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"/>
1342
1364
  <!-- Another main sections -->
1343
1365
  <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"/>
1344
1366
  <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1345
1367
  <!-- Bibliography -->
1346
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1368
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
1369
+
1347
1370
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1348
1371
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1349
1372
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
@@ -1379,11 +1402,11 @@
1379
1402
  <xsl:variable name="table">
1380
1403
 
1381
1404
  <xsl:variable name="simple-table">
1382
- <xsl:call-template name="getSimpleTable"/>
1405
+ <xsl:call-template name="getSimpleTable"/>
1383
1406
  </xsl:variable>
1384
1407
 
1385
1408
  <!-- <xsl:if test="$namespace = 'bipm'">
1386
- <fo:block>&#xA0;</fo:block>
1409
+ <fo:block>&#xA0;</fo:block>
1387
1410
  </xsl:if> -->
1388
1411
 
1389
1412
  <!-- $namespace = 'iso' or -->
@@ -1487,6 +1510,7 @@
1487
1510
 
1488
1511
 
1489
1512
 
1513
+
1490
1514
  </xsl:variable>
1491
1515
 
1492
1516
 
@@ -1628,6 +1652,9 @@
1628
1652
  <fo:block xsl:use-attribute-sets="table-name-style">
1629
1653
 
1630
1654
 
1655
+
1656
+
1657
+
1631
1658
  <xsl:choose>
1632
1659
  <xsl:when test="$continued = 'true'">
1633
1660
  <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
@@ -1775,6 +1802,7 @@
1775
1802
  <!-- font-weight="bold" -->
1776
1803
  <fo:table-header>
1777
1804
 
1805
+
1778
1806
  <xsl:apply-templates/>
1779
1807
  </fo:table-header>
1780
1808
  </xsl:template><xsl:template name="table-header-title">
@@ -1925,6 +1953,7 @@
1925
1953
 
1926
1954
 
1927
1955
 
1956
+
1928
1957
  <!-- fn will be processed inside 'note' processing -->
1929
1958
 
1930
1959
 
@@ -1933,6 +1962,10 @@
1933
1962
 
1934
1963
 
1935
1964
 
1965
+
1966
+ <!-- for BSI (not PAS) display Notes before footnotes -->
1967
+
1968
+
1936
1969
  <!-- except gb -->
1937
1970
 
1938
1971
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
@@ -1958,6 +1991,10 @@
1958
1991
  <!-- fn processing -->
1959
1992
  <xsl:call-template name="fn_display"/>
1960
1993
 
1994
+
1995
+ <!-- for PAS display Notes after footnotes -->
1996
+
1997
+
1961
1998
  </fo:table-cell>
1962
1999
  </fo:table-row>
1963
2000
  </fo:table-body>
@@ -2015,11 +2052,16 @@
2015
2052
  <xsl:if test="$parent-name = 'tfoot'">
2016
2053
 
2017
2054
 
2055
+
2018
2056
  </xsl:if>
2019
2057
 
2020
2058
 
2021
2059
 
2022
2060
 
2061
+
2062
+
2063
+
2064
+
2023
2065
  <!-- <xsl:if test="$namespace = 'bipm'">
2024
2066
  <xsl:attribute name="height">8mm</xsl:attribute>
2025
2067
  </xsl:if> -->
@@ -2049,6 +2091,7 @@
2049
2091
 
2050
2092
 
2051
2093
 
2094
+
2052
2095
  <xsl:if test="$lang = 'ar'">
2053
2096
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2054
2097
  </xsl:if>
@@ -2104,6 +2147,10 @@
2104
2147
 
2105
2148
 
2106
2149
 
2150
+
2151
+
2152
+
2153
+
2107
2154
  <xsl:if test=".//*[local-name() = 'table']">
2108
2155
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2109
2156
  </xsl:if>
@@ -2133,8 +2180,14 @@
2133
2180
 
2134
2181
 
2135
2182
 
2183
+
2184
+
2185
+ <!-- Table's note name (NOTE, for example) -->
2186
+
2136
2187
  <fo:inline padding-right="2mm">
2137
2188
 
2189
+
2190
+
2138
2191
 
2139
2192
 
2140
2193
 
@@ -2142,6 +2195,8 @@
2142
2195
 
2143
2196
  </fo:inline>
2144
2197
 
2198
+
2199
+
2145
2200
  <xsl:apply-templates mode="process"/>
2146
2201
  </fo:block>
2147
2202
 
@@ -2161,6 +2216,8 @@
2161
2216
  <xsl:variable name="reference" select="@reference"/>
2162
2217
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
2163
2218
  <fo:block margin-bottom="12pt">
2219
+
2220
+
2164
2221
 
2165
2222
 
2166
2223
 
@@ -2176,9 +2233,11 @@
2176
2233
 
2177
2234
 
2178
2235
 
2236
+
2179
2237
  <xsl:value-of select="@reference"/>
2180
2238
 
2181
2239
 
2240
+
2182
2241
  </fo:inline>
2183
2242
  <fo:inline>
2184
2243
 
@@ -2319,11 +2378,16 @@
2319
2378
 
2320
2379
 
2321
2380
 
2381
+
2382
+
2383
+
2384
+
2322
2385
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2323
2386
 
2324
2387
 
2325
2388
  <xsl:value-of select="@reference"/>
2326
2389
 
2390
+
2327
2391
  </fo:basic-link>
2328
2392
  </fo:inline>
2329
2393
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -2410,6 +2474,7 @@
2410
2474
 
2411
2475
 
2412
2476
 
2477
+
2413
2478
  <xsl:variable name="title-key">
2414
2479
 
2415
2480
 
@@ -2620,6 +2685,7 @@
2620
2685
 
2621
2686
  <fo:table-row>
2622
2687
 
2688
+
2623
2689
  <fo:table-cell>
2624
2690
 
2625
2691
  <fo:block margin-top="6pt">
@@ -2637,6 +2703,7 @@
2637
2703
 
2638
2704
 
2639
2705
 
2706
+
2640
2707
  <xsl:apply-templates/>
2641
2708
  <!-- <xsl:if test="$namespace = 'gb'">
2642
2709
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2693,6 +2760,8 @@
2693
2760
 
2694
2761
  <xsl:apply-templates/>
2695
2762
  </fo:inline>
2763
+ </xsl:template><xsl:template match="*[local-name()='padding']">
2764
+ <fo:inline padding-right="{@value}"> </fo:inline>
2696
2765
  </xsl:template><xsl:template match="*[local-name()='sup']">
2697
2766
  <fo:inline font-size="80%" vertical-align="super">
2698
2767
  <xsl:apply-templates/>
@@ -3182,9 +3251,27 @@
3182
3251
  <xsl:copy>
3183
3252
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
3184
3253
  </xsl:copy>
3185
- <mathml:mspace width="0.5ex"/>
3254
+ <xsl:choose>
3255
+ <!-- if in msub, then don't add space -->
3256
+ <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3257
+ <!-- if next char in digit, don't add space -->
3258
+ <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3259
+ <xsl:otherwise>
3260
+ <mathml:mspace width="0.5ex"/>
3261
+ </xsl:otherwise>
3262
+ </xsl:choose>
3186
3263
  </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3187
3264
  <xsl:variable name="target">
3265
+ <xsl:choose>
3266
+ <xsl:when test="@updatetype = 'true'">
3267
+ <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
3268
+ </xsl:when>
3269
+ <xsl:otherwise>
3270
+ <xsl:value-of select="normalize-space(@target)"/>
3271
+ </xsl:otherwise>
3272
+ </xsl:choose>
3273
+ </xsl:variable>
3274
+ <xsl:variable name="target_text">
3188
3275
  <xsl:choose>
3189
3276
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
3190
3277
  <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
@@ -3196,20 +3283,22 @@
3196
3283
  </xsl:variable>
3197
3284
  <fo:inline xsl:use-attribute-sets="link-style">
3198
3285
 
3286
+
3287
+
3199
3288
  <xsl:choose>
3200
- <xsl:when test="$target = ''">
3289
+ <xsl:when test="$target_text = ''">
3201
3290
  <xsl:apply-templates/>
3202
3291
  </xsl:when>
3203
3292
  <xsl:otherwise>
3204
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3293
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
3205
3294
  <xsl:choose>
3206
3295
  <xsl:when test="normalize-space(.) = ''">
3207
- <!-- <xsl:value-of select="$target"/> -->
3208
3296
  <xsl:call-template name="add-zero-spaces-link-java">
3209
- <xsl:with-param name="text" select="$target"/>
3297
+ <xsl:with-param name="text" select="$target_text"/>
3210
3298
  </xsl:call-template>
3211
3299
  </xsl:when>
3212
3300
  <xsl:otherwise>
3301
+ <!-- output text from <link>text</link> -->
3213
3302
  <xsl:apply-templates/>
3214
3303
  </xsl:otherwise>
3215
3304
  </xsl:choose>
@@ -3304,6 +3393,7 @@
3304
3393
 
3305
3394
 
3306
3395
 
3396
+
3307
3397
  <fo:block-container margin-left="0mm">
3308
3398
 
3309
3399
 
@@ -3347,6 +3437,7 @@
3347
3437
  </xsl:choose>
3348
3438
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
3349
3439
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
3440
+
3350
3441
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
3351
3442
 
3352
3443
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
@@ -3420,6 +3511,7 @@
3420
3511
  </xsl:call-template>
3421
3512
 
3422
3513
  <fo:block>
3514
+
3423
3515
  <xsl:apply-templates/>
3424
3516
  </fo:block>
3425
3517
  <xsl:call-template name="fn_display_figure"/>
@@ -3542,6 +3634,234 @@
3542
3634
  <xsl:param name="height"/>
3543
3635
  <line xmlns="http://www.w3.org/2000/svg" x1="0" y1="0" x2="{$width}" y2="{$height}" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
3544
3636
  <line xmlns="http://www.w3.org/2000/svg" x1="0" y1="{$height}" x2="{$width}" y2="0" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
3637
+ </xsl:template><xsl:variable name="figure_name_height">14</xsl:variable><xsl:variable name="width_effective" select="$pageWidth - $marginLeftRight1 - $marginLeftRight2"/><xsl:variable name="height_effective" select="$pageHeight - $marginTop - $marginBottom - $figure_name_height"/><xsl:variable name="image_dpi" select="96"/><xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/><xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2" name="image_svg">
3638
+ <xsl:param name="name"/>
3639
+
3640
+ <xsl:variable name="svg_content">
3641
+ <xsl:apply-templates select="." mode="svg_update"/>
3642
+ </xsl:variable>
3643
+
3644
+ <xsl:variable name="alt-text">
3645
+ <xsl:choose>
3646
+ <xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
3647
+ <xsl:value-of select="../*[local-name() = 'name']"/>
3648
+ </xsl:when>
3649
+ <xsl:when test="normalize-space($name) != ''">
3650
+ <xsl:value-of select="$name"/>
3651
+ </xsl:when>
3652
+ <xsl:otherwise>Figure</xsl:otherwise>
3653
+ </xsl:choose>
3654
+ </xsl:variable>
3655
+
3656
+ <xsl:choose>
3657
+ <xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
3658
+ <fo:block>
3659
+ <xsl:variable name="width" select="@width"/>
3660
+ <xsl:variable name="height" select="@height"/>
3661
+
3662
+ <xsl:variable name="scale_x">
3663
+ <xsl:choose>
3664
+ <xsl:when test="$width &gt; $width_effective_px">
3665
+ <xsl:value-of select="$width_effective_px div $width"/>
3666
+ </xsl:when>
3667
+ <xsl:otherwise>1</xsl:otherwise>
3668
+ </xsl:choose>
3669
+ </xsl:variable>
3670
+
3671
+ <xsl:variable name="scale_y">
3672
+ <xsl:choose>
3673
+ <xsl:when test="$height * $scale_x &gt; $height_effective_px">
3674
+ <xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
3675
+ </xsl:when>
3676
+ <xsl:otherwise>1</xsl:otherwise>
3677
+ </xsl:choose>
3678
+ </xsl:variable>
3679
+
3680
+ <xsl:variable name="scale">
3681
+ <xsl:choose>
3682
+ <xsl:when test="$scale_y != 1">
3683
+ <xsl:value-of select="$scale_x * $scale_y"/>
3684
+ </xsl:when>
3685
+ <xsl:otherwise>
3686
+ <xsl:value-of select="$scale_x"/>
3687
+ </xsl:otherwise>
3688
+ </xsl:choose>
3689
+ </xsl:variable>
3690
+
3691
+ <xsl:variable name="width_scale" select="round($width * $scale)"/>
3692
+ <xsl:variable name="height_scale" select="round($height * $scale)"/>
3693
+
3694
+ <fo:table table-layout="fixed" width="100%">
3695
+ <fo:table-column column-width="proportional-column-width(1)"/>
3696
+ <fo:table-column column-width="{$width_scale}px"/>
3697
+ <fo:table-column column-width="proportional-column-width(1)"/>
3698
+ <fo:table-body>
3699
+ <fo:table-row>
3700
+ <fo:table-cell column-number="2">
3701
+ <fo:block>
3702
+ <fo:block-container width="{$width_scale}px" height="{$height_scale}px">
3703
+ <xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
3704
+ <fo:block line-height="0" font-size="0">
3705
+ <xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
3706
+ <xsl:call-template name="bookmark"/>
3707
+ </xsl:for-each>
3708
+ </fo:block>
3709
+ </xsl:if>
3710
+ <fo:block text-depth="0" line-height="0" font-size="0">
3711
+
3712
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
3713
+ <xsl:attribute name="width">100%</xsl:attribute>
3714
+ <xsl:attribute name="content-height">100%</xsl:attribute>
3715
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3716
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
3717
+
3718
+ <xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
3719
+ </fo:instream-foreign-object>
3720
+ </fo:block>
3721
+
3722
+ <xsl:apply-templates select=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]" mode="svg_imagemap_links">
3723
+ <xsl:with-param name="scale" select="$scale"/>
3724
+ </xsl:apply-templates>
3725
+ </fo:block-container>
3726
+ </fo:block>
3727
+ </fo:table-cell>
3728
+ </fo:table-row>
3729
+ </fo:table-body>
3730
+ </fo:table>
3731
+ </fo:block>
3732
+
3733
+ </xsl:when>
3734
+ <xsl:otherwise>
3735
+ <fo:block xsl:use-attribute-sets="image-style">
3736
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
3737
+ <xsl:attribute name="width">100%</xsl:attribute>
3738
+ <xsl:attribute name="content-height">100%</xsl:attribute>
3739
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3740
+ <!-- effective height 297 - 27.4 - 13 = 256.6 -->
3741
+ <!-- effective width 210 - 12.5 - 25 = 172.5 -->
3742
+ <!-- effective height / width = 1.48, 1.4 - with title -->
3743
+ <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
3744
+ <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
3745
+ <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
3746
+ </xsl:if>
3747
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
3748
+ <xsl:copy-of select="$svg_content"/>
3749
+ </fo:instream-foreign-object>
3750
+ </fo:block>
3751
+ </xsl:otherwise>
3752
+ </xsl:choose>
3753
+ </xsl:template><xsl:template match="@*|node()" mode="svg_update">
3754
+ <xsl:copy>
3755
+ <xsl:apply-templates select="@*|node()" mode="svg_update"/>
3756
+ </xsl:copy>
3757
+ </xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
3758
+ <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
3759
+ <xsl:value-of select="."/>
3760
+ </xsl:attribute>
3761
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
3762
+ <xsl:variable name="svg_content" select="document(@src)"/>
3763
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
3764
+ <xsl:for-each select="xalan:nodeset($svg_content)/node()">
3765
+ <xsl:call-template name="image_svg">
3766
+ <xsl:with-param name="name" select="$name"/>
3767
+ </xsl:call-template>
3768
+ </xsl:for-each>
3769
+ </xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
3770
+ <xsl:copy>
3771
+ <xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
3772
+ </xsl:copy>
3773
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
3774
+ <xsl:apply-templates mode="svg_remove_a"/>
3775
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
3776
+ <xsl:param name="scale"/>
3777
+ <xsl:variable name="dest">
3778
+ <xsl:choose>
3779
+ <xsl:when test="starts-with(@href, '#')">
3780
+ <xsl:value-of select="substring-after(@href, '#')"/>
3781
+ </xsl:when>
3782
+ <xsl:otherwise>
3783
+ <xsl:value-of select="@href"/>
3784
+ </xsl:otherwise>
3785
+ </xsl:choose>
3786
+ </xsl:variable>
3787
+ <xsl:for-each select="./*[local-name() = 'rect']">
3788
+ <xsl:call-template name="insertSVGMapLink">
3789
+ <xsl:with-param name="left" select="floor(@x * $scale)"/>
3790
+ <xsl:with-param name="top" select="floor(@y * $scale)"/>
3791
+ <xsl:with-param name="width" select="floor(@width * $scale)"/>
3792
+ <xsl:with-param name="height" select="floor(@height * $scale)"/>
3793
+ <xsl:with-param name="dest" select="$dest"/>
3794
+ </xsl:call-template>
3795
+ </xsl:for-each>
3796
+
3797
+ <xsl:for-each select="./*[local-name() = 'polygon']">
3798
+ <xsl:variable name="points">
3799
+ <xsl:call-template name="split">
3800
+ <xsl:with-param name="pText" select="@points"/>
3801
+ </xsl:call-template>
3802
+ </xsl:variable>
3803
+ <xsl:variable name="x_coords">
3804
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
3805
+ <xsl:sort select="." data-type="number"/>
3806
+ <x><xsl:value-of select="."/></x>
3807
+ </xsl:for-each>
3808
+ </xsl:variable>
3809
+ <xsl:variable name="y_coords">
3810
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
3811
+ <xsl:sort select="." data-type="number"/>
3812
+ <y><xsl:value-of select="."/></y>
3813
+ </xsl:for-each>
3814
+ </xsl:variable>
3815
+ <xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
3816
+ <xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
3817
+ <xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
3818
+ <xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
3819
+ <xsl:call-template name="insertSVGMapLink">
3820
+ <xsl:with-param name="left" select="floor($x * $scale)"/>
3821
+ <xsl:with-param name="top" select="floor($y * $scale)"/>
3822
+ <xsl:with-param name="width" select="floor($width * $scale)"/>
3823
+ <xsl:with-param name="height" select="floor($height * $scale)"/>
3824
+ <xsl:with-param name="dest" select="$dest"/>
3825
+ </xsl:call-template>
3826
+ </xsl:for-each>
3827
+
3828
+ <xsl:for-each select="./*[local-name() = 'circle']">
3829
+ <xsl:call-template name="insertSVGMapLink">
3830
+ <xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
3831
+ <xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
3832
+ <xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
3833
+ <xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
3834
+ <xsl:with-param name="dest" select="$dest"/>
3835
+ </xsl:call-template>
3836
+ </xsl:for-each>
3837
+ <xsl:for-each select="./*[local-name() = 'ellipse']">
3838
+ <xsl:call-template name="insertSVGMapLink">
3839
+ <xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
3840
+ <xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
3841
+ <xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
3842
+ <xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
3843
+ <xsl:with-param name="dest" select="$dest"/>
3844
+ </xsl:call-template>
3845
+ </xsl:for-each>
3846
+ </xsl:template><xsl:template name="insertSVGMapLink">
3847
+ <xsl:param name="left"/>
3848
+ <xsl:param name="top"/>
3849
+ <xsl:param name="width"/>
3850
+ <xsl:param name="height"/>
3851
+ <xsl:param name="dest"/>
3852
+ <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
3853
+ <fo:block font-size="1pt">
3854
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
3855
+ <fo:inline-container inline-progression-dimension="100%">
3856
+ <fo:block-container height="{$height - 1}px" width="100%">
3857
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
3858
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
3859
+ </xsl:if> -->
3860
+ <fo:block> </fo:block></fo:block-container>
3861
+ </fo:inline-container>
3862
+ </fo:basic-link>
3863
+ </fo:block>
3864
+ </fo:block-container>
3545
3865
  </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">
3546
3866
  <xsl:apply-templates mode="contents"/>
3547
3867
  <xsl:text> </xsl:text>
@@ -3570,28 +3890,39 @@
3570
3890
  <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3571
3891
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3572
3892
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3893
+ <xsl:if test="@bundle = 'true'">
3894
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
3895
+ </xsl:if>
3573
3896
  <fo:bookmark-title>
3574
- <xsl:variable name="bookmark-title_">
3575
- <xsl:call-template name="getLangVersion">
3576
- <xsl:with-param name="lang" select="@lang"/>
3577
- <xsl:with-param name="doctype" select="@doctype"/>
3578
- <xsl:with-param name="title" select="@title-part"/>
3579
- </xsl:call-template>
3580
- </xsl:variable>
3581
3897
  <xsl:choose>
3582
- <xsl:when test="normalize-space($bookmark-title_) != ''">
3583
- <xsl:value-of select="normalize-space($bookmark-title_)"/>
3584
- </xsl:when>
3585
- <xsl:otherwise>
3898
+ <xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
3899
+ <xsl:variable name="bookmark-title_">
3900
+ <xsl:call-template name="getLangVersion">
3901
+ <xsl:with-param name="lang" select="@lang"/>
3902
+ <xsl:with-param name="doctype" select="@doctype"/>
3903
+ <xsl:with-param name="title" select="@title-part"/>
3904
+ </xsl:call-template>
3905
+ </xsl:variable>
3586
3906
  <xsl:choose>
3587
- <xsl:when test="@lang = 'en'">English</xsl:when>
3588
- <xsl:when test="@lang = 'fr'">Français</xsl:when>
3589
- <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3590
- <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3907
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3908
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3909
+ </xsl:when>
3910
+ <xsl:otherwise>
3911
+ <xsl:choose>
3912
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3913
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3914
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3915
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3916
+ </xsl:choose>
3917
+ </xsl:otherwise>
3591
3918
  </xsl:choose>
3919
+ </xsl:when>
3920
+ <xsl:otherwise>
3921
+ <xsl:value-of select="@title-part"/>
3592
3922
  </xsl:otherwise>
3593
3923
  </xsl:choose>
3594
3924
  </fo:bookmark-title>
3925
+
3595
3926
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3596
3927
 
3597
3928
  <xsl:call-template name="insertFigureBookmarks">
@@ -3690,20 +4021,28 @@
3690
4021
  <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3691
4022
  </xsl:choose>
3692
4023
  </xsl:template><xsl:template match="item" mode="bookmark">
3693
- <fo:bookmark internal-destination="{@id}" starting-state="hide">
3694
- <fo:bookmark-title>
3695
- <xsl:if test="@section != ''">
3696
- <xsl:value-of select="@section"/>
3697
- <xsl:text> </xsl:text>
3698
- </xsl:if>
3699
- <xsl:value-of select="normalize-space(title)"/>
3700
- </fo:bookmark-title>
3701
- <xsl:apply-templates mode="bookmark"/>
3702
- </fo:bookmark>
4024
+ <xsl:choose>
4025
+ <xsl:when test="@id != ''">
4026
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
4027
+ <fo:bookmark-title>
4028
+ <xsl:if test="@section != ''">
4029
+ <xsl:value-of select="@section"/>
4030
+ <xsl:text> </xsl:text>
4031
+ </xsl:if>
4032
+ <xsl:value-of select="normalize-space(title)"/>
4033
+ </fo:bookmark-title>
4034
+ <xsl:apply-templates mode="bookmark"/>
4035
+ </fo:bookmark>
4036
+ </xsl:when>
4037
+ <xsl:otherwise>
4038
+ <xsl:apply-templates mode="bookmark"/>
4039
+ </xsl:otherwise>
4040
+ </xsl:choose>
3703
4041
  </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">
3704
4042
  <xsl:if test="normalize-space() != ''">
3705
4043
  <fo:block xsl:use-attribute-sets="figure-name-style">
3706
4044
 
4045
+
3707
4046
  <xsl:apply-templates/>
3708
4047
  </fo:block>
3709
4048
  </xsl:if>
@@ -3783,6 +4122,8 @@
3783
4122
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3784
4123
 
3785
4124
  <fo:block-container margin-left="0mm">
4125
+ <xsl:copy-of select="@id"/>
4126
+
3786
4127
  <xsl:if test="parent::*[local-name() = 'note']">
3787
4128
  <xsl:attribute name="margin-left">
3788
4129
  <xsl:choose>
@@ -3793,7 +4134,9 @@
3793
4134
 
3794
4135
  </xsl:if>
3795
4136
  <fo:block-container margin-left="0mm">
3796
-
4137
+
4138
+
4139
+
3797
4140
  <fo:block xsl:use-attribute-sets="sourcecode-style">
3798
4141
  <xsl:variable name="_font-size">
3799
4142
 
@@ -3822,10 +4165,14 @@
3822
4165
  </xsl:choose>
3823
4166
  </xsl:attribute>
3824
4167
  </xsl:if>
3825
- <xsl:apply-templates/>
3826
- </fo:block>
4168
+
4169
+ <xsl:apply-templates/>
4170
+ </fo:block>
4171
+
4172
+
3827
4173
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3828
4174
 
4175
+
3829
4176
  </fo:block-container>
3830
4177
  </fo:block-container>
3831
4178
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -4060,6 +4407,7 @@
4060
4407
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4061
4408
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4062
4409
 
4410
+
4063
4411
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4064
4412
 
4065
4413
  <xsl:variable name="element">
@@ -4169,12 +4517,15 @@
4169
4517
 
4170
4518
 
4171
4519
 
4520
+
4521
+
4522
+
4172
4523
  <xsl:call-template name="getTitle">
4173
4524
  <xsl:with-param name="name" select="'title-source'"/>
4174
4525
  </xsl:call-template>
4526
+ <xsl:text>: </xsl:text>
4175
4527
 
4176
4528
 
4177
- <xsl:text>: </xsl:text>
4178
4529
  </fo:inline>
4179
4530
 
4180
4531
  <fo:inline xsl:use-attribute-sets="origin-style">
@@ -4245,7 +4596,9 @@
4245
4596
 
4246
4597
 
4247
4598
  </xsl:if>
4248
-
4599
+
4600
+
4601
+
4249
4602
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4250
4603
  <xsl:if test="normalize-space(@citeas) = ''">
4251
4604
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
@@ -4257,6 +4610,7 @@
4257
4610
 
4258
4611
 
4259
4612
 
4613
+
4260
4614
  </xsl:if>
4261
4615
 
4262
4616
  <xsl:apply-templates/>
@@ -4301,6 +4655,7 @@
4301
4655
 
4302
4656
 
4303
4657
 
4658
+
4304
4659
  </xsl:variable>
4305
4660
 
4306
4661
  <xsl:variable name="padding-right">
@@ -4402,6 +4757,7 @@
4402
4757
  <xsl:call-template name="setId"/>
4403
4758
 
4404
4759
 
4760
+
4405
4761
  <xsl:apply-templates/>
4406
4762
  </fo:block>
4407
4763
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
@@ -4648,17 +5004,17 @@
4648
5004
  <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')]"/>
4649
5005
  <xsl:choose>
4650
5006
  <xsl:when test="normalize-space($_doc_ident) != ''">
4651
- <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"/>
5007
+ <!-- <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"/>
4652
5008
  <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
4653
5009
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4654
- </xsl:if>
5010
+ </xsl:if> -->
4655
5011
  <xsl:value-of select="$_doc_ident"/>
4656
5012
  </xsl:when>
4657
5013
  <xsl:otherwise>
4658
- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
5014
+ <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
4659
5015
  <xsl:if test="$type != ''">
4660
5016
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4661
- </xsl:if>
5017
+ </xsl:if> -->
4662
5018
  <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
4663
5019
  </xsl:otherwise>
4664
5020
  </xsl:choose>
@@ -4971,6 +5327,9 @@
4971
5327
  <xsl:when test="parent::*[local-name() = 'preface']">
4972
5328
  <xsl:value-of select="$level_total - 1"/>
4973
5329
  </xsl:when>
5330
+ <xsl:when test="ancestor::*[local-name() = 'preface'] and not(ancestor::*[local-name() = 'foreword']) and not(ancestor::*[local-name() = 'introduction'])"> <!-- for preface/clause -->
5331
+ <xsl:value-of select="$level_total - 1"/>
5332
+ </xsl:when>
4974
5333
  <xsl:when test="ancestor::*[local-name() = 'preface']">
4975
5334
  <xsl:value-of select="$level_total - 2"/>
4976
5335
  </xsl:when>
@@ -5111,7 +5470,14 @@
5111
5470
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5112
5471
  <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5113
5472
  </xsl:when>
5114
- <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
5473
+ <xsl:otherwise>
5474
+ <xsl:variable name="key_">
5475
+ <xsl:call-template name="capitalize">
5476
+ <xsl:with-param name="str" select="translate($key, '_', ' ')"/>
5477
+ </xsl:call-template>
5478
+ </xsl:variable>
5479
+ <xsl:value-of select="$key_"/>
5480
+ </xsl:otherwise>
5115
5481
  </xsl:choose>
5116
5482
 
5117
5483
  </xsl:template><xsl:template name="setTrackChangesStyles">
@@ -5154,4 +5520,110 @@
5154
5520
  <xsl:value-of select="$align"/>
5155
5521
  </xsl:when>
5156
5522
  </xsl:choose>
5523
+ </xsl:template><xsl:template name="setTextAlignment">
5524
+ <xsl:param name="default">left</xsl:param>
5525
+ <xsl:attribute name="text-align">
5526
+ <xsl:choose>
5527
+ <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
5528
+ <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
5529
+ <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
5530
+ <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
5531
+ </xsl:choose>
5532
+ </xsl:attribute>
5533
+ </xsl:template><xsl:template name="number-to-words">
5534
+ <xsl:param name="number"/>
5535
+ <xsl:param name="first"/>
5536
+ <xsl:if test="$number != ''">
5537
+ <xsl:variable name="words">
5538
+ <words>
5539
+ <word cardinal="1">One-</word>
5540
+ <word ordinal="1">First </word>
5541
+ <word cardinal="2">Two-</word>
5542
+ <word ordinal="2">Second </word>
5543
+ <word cardinal="3">Three-</word>
5544
+ <word ordinal="3">Third </word>
5545
+ <word cardinal="4">Four-</word>
5546
+ <word ordinal="4">Fourth </word>
5547
+ <word cardinal="5">Five-</word>
5548
+ <word ordinal="5">Fifth </word>
5549
+ <word cardinal="6">Six-</word>
5550
+ <word ordinal="6">Sixth </word>
5551
+ <word cardinal="7">Seven-</word>
5552
+ <word ordinal="7">Seventh </word>
5553
+ <word cardinal="8">Eight-</word>
5554
+ <word ordinal="8">Eighth </word>
5555
+ <word cardinal="9">Nine-</word>
5556
+ <word ordinal="9">Ninth </word>
5557
+ <word ordinal="10">Tenth </word>
5558
+ <word ordinal="11">Eleventh </word>
5559
+ <word ordinal="12">Twelfth </word>
5560
+ <word ordinal="13">Thirteenth </word>
5561
+ <word ordinal="14">Fourteenth </word>
5562
+ <word ordinal="15">Fifteenth </word>
5563
+ <word ordinal="16">Sixteenth </word>
5564
+ <word ordinal="17">Seventeenth </word>
5565
+ <word ordinal="18">Eighteenth </word>
5566
+ <word ordinal="19">Nineteenth </word>
5567
+ <word cardinal="20">Twenty-</word>
5568
+ <word ordinal="20">Twentieth </word>
5569
+ <word cardinal="30">Thirty-</word>
5570
+ <word ordinal="30">Thirtieth </word>
5571
+ <word cardinal="40">Forty-</word>
5572
+ <word ordinal="40">Fortieth </word>
5573
+ <word cardinal="50">Fifty-</word>
5574
+ <word ordinal="50">Fiftieth </word>
5575
+ <word cardinal="60">Sixty-</word>
5576
+ <word ordinal="60">Sixtieth </word>
5577
+ <word cardinal="70">Seventy-</word>
5578
+ <word ordinal="70">Seventieth </word>
5579
+ <word cardinal="80">Eighty-</word>
5580
+ <word ordinal="80">Eightieth </word>
5581
+ <word cardinal="90">Ninety-</word>
5582
+ <word ordinal="90">Ninetieth </word>
5583
+ <word cardinal="100">Hundred-</word>
5584
+ <word ordinal="100">Hundredth </word>
5585
+ </words>
5586
+ </xsl:variable>
5587
+
5588
+ <xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
5589
+
5590
+ <xsl:variable name="value">
5591
+ <xsl:choose>
5592
+ <xsl:when test="$ordinal != ''">
5593
+ <xsl:value-of select="$ordinal"/>
5594
+ </xsl:when>
5595
+ <xsl:otherwise>
5596
+ <xsl:choose>
5597
+ <xsl:when test="$number &lt; 100">
5598
+ <xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
5599
+ <xsl:variable name="digit" select="substring($number,2)"/>
5600
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
5601
+ <xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
5602
+ </xsl:when>
5603
+ <xsl:otherwise>
5604
+ <!-- more 100 -->
5605
+ <xsl:variable name="hundred" select="substring($number,1,1)"/>
5606
+ <xsl:variable name="digits" select="number(substring($number,2))"/>
5607
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
5608
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
5609
+ <xsl:call-template name="number-to-words">
5610
+ <xsl:with-param name="number" select="$digits"/>
5611
+ </xsl:call-template>
5612
+ </xsl:otherwise>
5613
+ </xsl:choose>
5614
+ </xsl:otherwise>
5615
+ </xsl:choose>
5616
+ </xsl:variable>
5617
+ <xsl:choose>
5618
+ <xsl:when test="$first = 'true'">
5619
+ <xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/>
5620
+ <xsl:call-template name="capitalize">
5621
+ <xsl:with-param name="str" select="$value_lc"/>
5622
+ </xsl:call-template>
5623
+ </xsl:when>
5624
+ <xsl:otherwise>
5625
+ <xsl:value-of select="$value"/>
5626
+ </xsl:otherwise>
5627
+ </xsl:choose>
5628
+ </xsl:if>
5157
5629
  </xsl:template></xsl:stylesheet>