metanorma-m3aawg 1.7.1 → 1.7.6

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: 8713634a17c1e5da0b53d534fa82875c8cb83480880e35b41ed8073ac1bde2bd
4
- data.tar.gz: 6ae993cb255898d47eb6a452e04d8fae76c1340479041f85b1bbc54d5cc184de
3
+ metadata.gz: 5b0ab31279f1bb3381e027d7a9297d62e909becf654d75f5b03c794b40aaf66e
4
+ data.tar.gz: 396b95f0101682acb613b590b1f3af7771571c02d6ebcfdd530c306e83401a8e
5
5
  SHA512:
6
- metadata.gz: 7731ee969ce546b73ed07e7b7c463c14d9f48c5ddd04c2da15111db53b7871f0176bde79424027e7c1c19e249207ea9e04a15cd108a0e6dfc2cf5a544ed8e8ca
7
- data.tar.gz: 1bf752b19b4937dedd9eff68d4f30df8921da484c0e9fbdc7cb7bb14c0fb2a9bed8b9223d47a577704c708e8315641d2ad11f863149e1b390a4ccf2cfc047cf9
6
+ metadata.gz: 3eec7587c14f94dbe788828bf771d8ebcc55ce26e9c2486a0ea69c996928e4efdc4e547cb77bbdb7ba395d8939f7ae570e5e7f3f1f68caec5a8bb69da9e0fe46
7
+ data.tar.gz: e93d2b334d55d89f9401b351dcd4670a3a52371dc43f06f483e151aeb2fcb285c5d37de0832d81c804147d8231b20a502b97d278ea068c5ee2daa7eb14ce8d8e
@@ -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,14 +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
13
- Rails:
14
- Enabled: true
10
+ TargetRubyVersion: 2.5
@@ -787,6 +787,7 @@
787
787
  <value>adapted</value>
788
788
  <value>vote-started</value>
789
789
  <value>vote-ended</value>
790
+ <value>announced</value>
790
791
  </choice>
791
792
  </define>
792
793
  <define name="bdate">
@@ -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>
@@ -543,6 +548,9 @@
543
548
  </define>
544
549
  <define name="BibDataExtensionType">
545
550
  <ref name="doctype"/>
551
+ <optional>
552
+ <ref name="docsubtype"/>
553
+ </optional>
546
554
  <optional>
547
555
  <ref name="editorialgroup"/>
548
556
  </optional>
@@ -876,8 +884,28 @@
876
884
  </zeroOrMore>
877
885
  </element>
878
886
  </define>
887
+ <define name="pagebreak">
888
+ <element name="pagebreak">
889
+ <optional>
890
+ <attribute name="orientation">
891
+ <choice>
892
+ <value>landscape</value>
893
+ <value>portrait</value>
894
+ </choice>
895
+ </attribute>
896
+ </optional>
897
+ </element>
898
+ </define>
879
899
  </include>
880
900
  <!-- end overrides -->
901
+ <define name="docsubtype">
902
+ <element name="docsubtype">
903
+ <ref name="DocumentSubtype"/>
904
+ </element>
905
+ </define>
906
+ <define name="DocumentSubtype">
907
+ <text/>
908
+ </define>
881
909
  <define name="colgroup">
882
910
  <element name="colgroup">
883
911
  <oneOrMore>
@@ -927,7 +955,24 @@
927
955
  <define name="concept">
928
956
  <element name="concept">
929
957
  <optional>
930
- <attribute name="term"/>
958
+ <element name="refterm">
959
+ <zeroOrMore>
960
+ <choice>
961
+ <ref name="PureTextElement"/>
962
+ <ref name="stem"/>
963
+ </choice>
964
+ </zeroOrMore>
965
+ </element>
966
+ </optional>
967
+ <optional>
968
+ <element name="renderterm">
969
+ <zeroOrMore>
970
+ <choice>
971
+ <ref name="PureTextElement"/>
972
+ <ref name="stem"/>
973
+ </choice>
974
+ </zeroOrMore>
975
+ </element>
931
976
  </optional>
932
977
  <choice>
933
978
  <ref name="eref"/>
@@ -943,8 +988,170 @@
943
988
  <ref name="permission"/>
944
989
  <ref name="imagemap"/>
945
990
  <ref name="svgmap"/>
991
+ <ref name="inputform"/>
992
+ </choice>
993
+ </define>
994
+ <define name="inputform">
995
+ <element name="form">
996
+ <attribute name="id">
997
+ <data type="ID"/>
998
+ </attribute>
999
+ <attribute name="name"/>
1000
+ <attribute name="action"/>
1001
+ <zeroOrMore>
1002
+ <choice>
1003
+ <ref name="TextElement"/>
1004
+ <ref name="FormInput"/>
1005
+ </choice>
1006
+ </zeroOrMore>
1007
+ </element>
1008
+ </define>
1009
+ <define name="FormInput">
1010
+ <choice>
1011
+ <ref name="input"/>
1012
+ <ref name="formlabel"/>
1013
+ <ref name="select"/>
1014
+ <ref name="textarea"/>
946
1015
  </choice>
947
1016
  </define>
1017
+ <define name="InputType">
1018
+ <choice>
1019
+ <value>button</value>
1020
+ <value>checkbox</value>
1021
+ <value>date</value>
1022
+ <value>file</value>
1023
+ <value>password</value>
1024
+ <value>radio</value>
1025
+ <value>submit</value>
1026
+ <value>text</value>
1027
+ </choice>
1028
+ </define>
1029
+ <define name="input">
1030
+ <element name="input">
1031
+ <attribute name="type">
1032
+ <ref name="InputType"/>
1033
+ </attribute>
1034
+ <optional>
1035
+ <attribute name="checked">
1036
+ <data type="boolean"/>
1037
+ </attribute>
1038
+ </optional>
1039
+ <optional>
1040
+ <attribute name="disabled">
1041
+ <data type="boolean"/>
1042
+ </attribute>
1043
+ </optional>
1044
+ <optional>
1045
+ <attribute name="readonly">
1046
+ <data type="boolean"/>
1047
+ </attribute>
1048
+ </optional>
1049
+ <optional>
1050
+ <attribute name="maxlength">
1051
+ <data type="int"/>
1052
+ </attribute>
1053
+ </optional>
1054
+ <optional>
1055
+ <attribute name="minlength">
1056
+ <data type="int"/>
1057
+ </attribute>
1058
+ </optional>
1059
+ <optional>
1060
+ <attribute name="name"/>
1061
+ </optional>
1062
+ <optional>
1063
+ <attribute name="value"/>
1064
+ </optional>
1065
+ <optional>
1066
+ <attribute name="id">
1067
+ <data type="ID"/>
1068
+ </attribute>
1069
+ </optional>
1070
+ </element>
1071
+ </define>
1072
+ <define name="formlabel">
1073
+ <element name="label">
1074
+ <attribute name="for">
1075
+ <data type="IDREF"/>
1076
+ </attribute>
1077
+ <zeroOrMore>
1078
+ <ref name="PureTextElement"/>
1079
+ </zeroOrMore>
1080
+ </element>
1081
+ </define>
1082
+ <define name="select">
1083
+ <element name="select">
1084
+ <optional>
1085
+ <attribute name="name"/>
1086
+ </optional>
1087
+ <optional>
1088
+ <attribute name="value"/>
1089
+ </optional>
1090
+ <optional>
1091
+ <attribute name="id">
1092
+ <data type="ID"/>
1093
+ </attribute>
1094
+ </optional>
1095
+ <optional>
1096
+ <attribute name="disabled">
1097
+ <data type="boolean"/>
1098
+ </attribute>
1099
+ </optional>
1100
+ <optional>
1101
+ <attribute name="multiple">
1102
+ <data type="boolean"/>
1103
+ </attribute>
1104
+ </optional>
1105
+ <optional>
1106
+ <attribute name="size">
1107
+ <data type="int"/>
1108
+ </attribute>
1109
+ </optional>
1110
+ <oneOrMore>
1111
+ <ref name="option"/>
1112
+ </oneOrMore>
1113
+ </element>
1114
+ </define>
1115
+ <define name="option">
1116
+ <element name="option">
1117
+ <optional>
1118
+ <attribute name="disabled">
1119
+ <data type="boolean"/>
1120
+ </attribute>
1121
+ </optional>
1122
+ <optional>
1123
+ <attribute name="value"/>
1124
+ </optional>
1125
+ <zeroOrMore>
1126
+ <ref name="PureTextElement"/>
1127
+ </zeroOrMore>
1128
+ </element>
1129
+ </define>
1130
+ <define name="textarea">
1131
+ <element name="textarea">
1132
+ <optional>
1133
+ <attribute name="name"/>
1134
+ </optional>
1135
+ <optional>
1136
+ <attribute name="value"/>
1137
+ </optional>
1138
+ <optional>
1139
+ <attribute name="id">
1140
+ <data type="ID"/>
1141
+ </attribute>
1142
+ </optional>
1143
+ <optional>
1144
+ <attribute name="rows">
1145
+ <data type="int"/>
1146
+ </attribute>
1147
+ </optional>
1148
+ <optional>
1149
+ <attribute name="cols">
1150
+ <data type="int"/>
1151
+ </attribute>
1152
+ </optional>
1153
+ </element>
1154
+ </define>
948
1155
  <define name="bibliography">
949
1156
  <element name="bibliography">
950
1157
  <oneOrMore>
@@ -1017,9 +1224,7 @@
1017
1224
  </define>
1018
1225
  <define name="IsoWorkgroup">
1019
1226
  <optional>
1020
- <attribute name="number">
1021
- <data type="int"/>
1022
- </attribute>
1227
+ <attribute name="number"/>
1023
1228
  </optional>
1024
1229
  <optional>
1025
1230
  <attribute name="type"/>
@@ -14,8 +14,12 @@
14
14
 
15
15
 
16
16
  <xsl:variable name="debug">false</xsl:variable>
17
- <xsl:variable name="pageWidth" select="'215.9mm'"/>
18
- <xsl:variable name="pageHeight" select="'279.4mm'"/>
17
+ <xsl:variable name="pageWidth" select="215.9"/>
18
+ <xsl:variable name="pageHeight" select="279.4"/>
19
+ <xsl:variable name="marginLeftRight1" select="17.3"/>
20
+ <xsl:variable name="marginLeftRight2" select="17.3"/>
21
+ <xsl:variable name="marginTop" select="35"/>
22
+ <xsl:variable name="marginBottom" select="23"/>
19
23
 
20
24
  <xsl:variable name="title-en" select="/m3d:m3d-standard/m3d:bibdata/m3d:title[@language = 'en']"/>
21
25
  <!-- Example:
@@ -39,7 +43,7 @@
39
43
  <fo:layout-master-set>
40
44
 
41
45
  <!-- cover page -->
42
- <fo:simple-page-master master-name="cover" page-width="{$pageWidth}" page-height="{$pageHeight}">
46
+ <fo:simple-page-master master-name="cover" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
43
47
  <fo:region-body margin-top="31mm" margin-bottom="32mm" margin-left="17.3mm" margin-right="22mm"/>
44
48
  <fo:region-before region-name="cover-header" extent="31mm"/>
45
49
  <fo:region-after region-name="cover-footer" extent="32mm"/>
@@ -48,17 +52,17 @@
48
52
  </fo:simple-page-master>
49
53
 
50
54
  <!-- contents pages -->
51
- <fo:simple-page-master master-name="page" page-width="{$pageWidth}" page-height="{$pageHeight}">
52
- <fo:region-body margin-top="20mm" margin-bottom="23mm" margin-left="17.3mm" margin-right="17.3mm"/>
53
- <fo:region-before region-name="header" extent="35mm"/>
54
- <fo:region-after region-name="footer" extent="23mm"/>
55
- <fo:region-start region-name="left-region" extent="17.3mm"/>
56
- <fo:region-end region-name="right-region" extent="17.3mm"/>
55
+ <fo:simple-page-master master-name="page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
56
+ <fo:region-body margin-top="20mm" margin-bottom="23mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
57
+ <fo:region-before region-name="header" extent="{$marginTop}mm"/>
58
+ <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
59
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
60
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
57
61
  </fo:simple-page-master>
58
62
 
59
- <fo:simple-page-master master-name="last" page-width="{$pageWidth}" page-height="{$pageHeight}">
60
- <fo:region-body margin-top="20mm" margin-bottom="53mm" margin-left="17.3mm" margin-right="17.3mm"/>
61
- <fo:region-before region-name="header" extent="35mm"/>
63
+ <fo:simple-page-master master-name="last" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
64
+ <fo:region-body margin-top="20mm" margin-bottom="53mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
65
+ <fo:region-before region-name="header" extent="{$marginTop}mm"/>
62
66
  <fo:region-after region-name="footer-last" extent="53mm"/>
63
67
  <fo:region-start region-name="left-region" extent="17.3mm"/>
64
68
  <fo:region-end region-name="right-region" extent="17.3mm"/>
@@ -1021,6 +1025,9 @@
1021
1025
  <title-continued lang="en">(continued)</title-continued>
1022
1026
  <title-continued lang="fr">(continué)</title-continued>
1023
1027
 
1028
+ </xsl:variable><xsl:variable name="bibdata">
1029
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
1030
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
1024
1031
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1025
1032
  <xsl:param name="name"/>
1026
1033
  <xsl:param name="lang"/>
@@ -1049,11 +1056,13 @@
1049
1056
 
1050
1057
  </xsl:attribute-set><xsl:attribute-set name="link-style">
1051
1058
 
1059
+
1052
1060
  <xsl:attribute name="color">blue</xsl:attribute>
1053
1061
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1054
1062
 
1055
1063
 
1056
1064
 
1065
+
1057
1066
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1058
1067
  <xsl:attribute name="white-space">pre</xsl:attribute>
1059
1068
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -1102,7 +1111,7 @@
1102
1111
  <xsl:attribute name="text-align">justify</xsl:attribute>
1103
1112
 
1104
1113
 
1105
-
1114
+
1106
1115
  </xsl:attribute-set><xsl:attribute-set name="example-style">
1107
1116
 
1108
1117
 
@@ -1118,6 +1127,7 @@
1118
1127
 
1119
1128
 
1120
1129
 
1130
+
1121
1131
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1122
1132
 
1123
1133
 
@@ -1137,9 +1147,7 @@
1137
1147
 
1138
1148
 
1139
1149
 
1140
-
1141
-
1142
-
1150
+
1143
1151
 
1144
1152
 
1145
1153
 
@@ -1170,8 +1178,10 @@
1170
1178
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
1171
1179
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1172
1180
 
1181
+
1173
1182
  </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1174
1183
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1184
+
1175
1185
 
1176
1186
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1177
1187
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -1188,6 +1198,9 @@
1188
1198
 
1189
1199
 
1190
1200
 
1201
+
1202
+ </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
1203
+
1191
1204
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1192
1205
 
1193
1206
  <xsl:attribute name="font-size">12pt</xsl:attribute>
@@ -1209,15 +1222,20 @@
1209
1222
 
1210
1223
 
1211
1224
 
1225
+
1226
+
1212
1227
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1213
1228
 
1214
1229
 
1215
1230
 
1216
1231
 
1232
+
1233
+
1217
1234
  </xsl:attribute-set><xsl:attribute-set name="note-style">
1218
1235
 
1219
1236
 
1220
1237
 
1238
+
1221
1239
 
1222
1240
 
1223
1241
 
@@ -1234,6 +1252,7 @@
1234
1252
 
1235
1253
 
1236
1254
 
1255
+
1237
1256
  </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">
1238
1257
 
1239
1258
 
@@ -1243,6 +1262,7 @@
1243
1262
 
1244
1263
 
1245
1264
 
1265
+
1246
1266
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
1247
1267
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1248
1268
 
@@ -1273,9 +1293,13 @@
1273
1293
 
1274
1294
 
1275
1295
 
1296
+
1297
+
1276
1298
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1299
+
1277
1300
 
1278
1301
 
1302
+
1279
1303
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1280
1304
 
1281
1305
 
@@ -1300,14 +1324,18 @@
1300
1324
 
1301
1325
 
1302
1326
 
1327
+
1328
+
1303
1329
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1304
1330
 
1305
1331
 
1306
1332
 
1333
+
1307
1334
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1308
1335
 
1309
1336
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1310
1337
 
1338
+
1311
1339
 
1312
1340
 
1313
1341
 
@@ -1326,6 +1354,7 @@
1326
1354
 
1327
1355
 
1328
1356
 
1357
+
1329
1358
 
1330
1359
 
1331
1360
 
@@ -1339,11 +1368,13 @@
1339
1368
 
1340
1369
 
1341
1370
 
1371
+
1342
1372
  </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1343
1373
 
1344
1374
  </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1345
1375
 
1346
1376
 
1377
+
1347
1378
  <xsl:attribute name="width">100%</xsl:attribute>
1348
1379
  <xsl:attribute name="content-height">100%</xsl:attribute>
1349
1380
  <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
@@ -1370,11 +1401,14 @@
1370
1401
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1371
1402
 
1372
1403
 
1404
+
1373
1405
  </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1374
1406
 
1407
+
1375
1408
  </xsl:attribute-set><xsl:attribute-set name="definition-style">
1376
1409
 
1377
1410
 
1411
+
1378
1412
  </xsl:attribute-set><xsl:variable name="color-added-text">
1379
1413
  <xsl:text>rgb(0, 255, 0)</xsl:text>
1380
1414
  </xsl:variable><xsl:attribute-set name="add-style">
@@ -1393,6 +1427,8 @@
1393
1427
  <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
1394
1428
 
1395
1429
 
1430
+ </xsl:attribute-set><xsl:attribute-set name="list-style">
1431
+
1396
1432
  </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">
1397
1433
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1398
1434
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -1403,14 +1439,15 @@
1403
1439
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1404
1440
 
1405
1441
  <!-- Normative references -->
1406
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1442
+ <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"/>
1407
1443
  <!-- Terms and definitions -->
1408
1444
  <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"/>
1409
1445
  <!-- Another main sections -->
1410
1446
  <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"/>
1411
1447
  <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1412
1448
  <!-- Bibliography -->
1413
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1449
+ <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"/>
1450
+
1414
1451
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1415
1452
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1416
1453
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
@@ -1450,11 +1487,11 @@
1450
1487
  <xsl:variable name="table">
1451
1488
 
1452
1489
  <xsl:variable name="simple-table">
1453
- <xsl:call-template name="getSimpleTable"/>
1490
+ <xsl:call-template name="getSimpleTable"/>
1454
1491
  </xsl:variable>
1455
1492
 
1456
1493
  <!-- <xsl:if test="$namespace = 'bipm'">
1457
- <fo:block>&#xA0;</fo:block>
1494
+ <fo:block>&#xA0;</fo:block>
1458
1495
  </xsl:if> -->
1459
1496
 
1460
1497
  <!-- $namespace = 'iso' or -->
@@ -1517,6 +1554,7 @@
1517
1554
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1518
1555
 
1519
1556
 
1557
+
1520
1558
 
1521
1559
 
1522
1560
 
@@ -1529,6 +1567,8 @@
1529
1567
 
1530
1568
 
1531
1569
 
1570
+
1571
+
1532
1572
  <xsl:variable name="table_width">
1533
1573
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1534
1574
  100%
@@ -1546,12 +1586,14 @@
1546
1586
 
1547
1587
 
1548
1588
 
1589
+
1549
1590
 
1550
1591
 
1551
1592
 
1552
1593
 
1553
1594
 
1554
1595
 
1596
+
1555
1597
  </xsl:variable>
1556
1598
 
1557
1599
 
@@ -1688,11 +1730,25 @@
1688
1730
  </xsl:choose>
1689
1731
 
1690
1732
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1733
+ <xsl:param name="continued"/>
1691
1734
  <xsl:if test="normalize-space() != ''">
1692
1735
  <fo:block xsl:use-attribute-sets="table-name-style">
1693
1736
 
1694
1737
 
1695
- <xsl:apply-templates/>
1738
+
1739
+
1740
+
1741
+ <xsl:choose>
1742
+ <xsl:when test="$continued = 'true'">
1743
+ <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
1744
+
1745
+ </xsl:when>
1746
+ <xsl:otherwise>
1747
+ <xsl:apply-templates/>
1748
+ </xsl:otherwise>
1749
+ </xsl:choose>
1750
+
1751
+
1696
1752
  </fo:block>
1697
1753
  </xsl:if>
1698
1754
  </xsl:template><xsl:template name="calculate-columns-numbers">
@@ -1829,21 +1885,22 @@
1829
1885
  <!-- font-weight="bold" -->
1830
1886
  <fo:table-header>
1831
1887
 
1888
+
1832
1889
  <xsl:apply-templates/>
1833
1890
  </fo:table-header>
1834
1891
  </xsl:template><xsl:template name="table-header-title">
1835
- <xsl:param name="cols-count"/>
1892
+ <xsl:param name="cols-count"/>
1836
1893
  <!-- row for title -->
1837
1894
  <fo:table-row>
1838
1895
  <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">
1839
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1896
+
1897
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
1898
+ <xsl:with-param name="continued">true</xsl:with-param>
1899
+ </xsl:apply-templates>
1840
1900
  <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1841
1901
  <xsl:call-template name="fn_name_display"/>
1842
- </xsl:for-each>
1843
- <fo:block text-align="right" font-style="italic">
1844
- <xsl:text> </xsl:text>
1845
- <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1846
- </fo:block>
1902
+ </xsl:for-each>
1903
+
1847
1904
  </fo:table-cell>
1848
1905
  </fo:table-row>
1849
1906
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -2064,6 +2121,7 @@
2064
2121
 
2065
2122
 
2066
2123
 
2124
+
2067
2125
  </xsl:if>
2068
2126
  <xsl:if test="$parent-name = 'tfoot'">
2069
2127
 
@@ -2073,6 +2131,10 @@
2073
2131
 
2074
2132
 
2075
2133
 
2134
+
2135
+
2136
+
2137
+
2076
2138
  <!-- <xsl:if test="$namespace = 'bipm'">
2077
2139
  <xsl:attribute name="height">8mm</xsl:attribute>
2078
2140
  </xsl:if> -->
@@ -2101,6 +2163,8 @@
2101
2163
 
2102
2164
 
2103
2165
 
2166
+
2167
+
2104
2168
  <xsl:if test="$lang = 'ar'">
2105
2169
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2106
2170
  </xsl:if>
@@ -2155,6 +2219,11 @@
2155
2219
 
2156
2220
 
2157
2221
 
2222
+
2223
+
2224
+
2225
+
2226
+
2158
2227
  <xsl:if test=".//*[local-name() = 'table']">
2159
2228
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2160
2229
  </xsl:if>
@@ -2184,6 +2253,7 @@
2184
2253
 
2185
2254
 
2186
2255
 
2256
+
2187
2257
  <fo:inline padding-right="2mm">
2188
2258
 
2189
2259
 
@@ -2227,6 +2297,7 @@
2227
2297
 
2228
2298
 
2229
2299
 
2300
+
2230
2301
  <xsl:value-of select="@reference"/>
2231
2302
 
2232
2303
 
@@ -2370,6 +2441,10 @@
2370
2441
 
2371
2442
 
2372
2443
 
2444
+
2445
+
2446
+
2447
+
2373
2448
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2374
2449
 
2375
2450
 
@@ -2461,6 +2536,7 @@
2461
2536
 
2462
2537
 
2463
2538
 
2539
+
2464
2540
  <xsl:variable name="title-key">
2465
2541
 
2466
2542
 
@@ -2671,6 +2747,7 @@
2671
2747
 
2672
2748
  <fo:table-row>
2673
2749
 
2750
+
2674
2751
  <fo:table-cell>
2675
2752
 
2676
2753
  <fo:block margin-top="6pt">
@@ -2686,6 +2763,7 @@
2686
2763
 
2687
2764
 
2688
2765
 
2766
+
2689
2767
  <xsl:apply-templates/>
2690
2768
  <!-- <xsl:if test="$namespace = 'gb'">
2691
2769
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2742,6 +2820,8 @@
2742
2820
 
2743
2821
  <xsl:apply-templates/>
2744
2822
  </fo:inline>
2823
+ </xsl:template><xsl:template match="*[local-name()='padding']">
2824
+ <fo:inline padding-right="{@value}"> </fo:inline>
2745
2825
  </xsl:template><xsl:template match="*[local-name()='sup']">
2746
2826
  <fo:inline font-size="80%" vertical-align="super">
2747
2827
  <xsl:apply-templates/>
@@ -2762,6 +2842,7 @@
2762
2842
 
2763
2843
 
2764
2844
 
2845
+
2765
2846
  <xsl:choose>
2766
2847
  <xsl:when test="not(ancestor::*[local-name()='note'])">10</xsl:when>
2767
2848
  <xsl:otherwise>11</xsl:otherwise>
@@ -3153,11 +3234,15 @@
3153
3234
  </xsl:apply-templates>
3154
3235
  </xsl:template><xsl:template name="getLang">
3155
3236
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3237
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3156
3238
  <xsl:variable name="language">
3157
3239
  <xsl:choose>
3158
3240
  <xsl:when test="$language_current != ''">
3159
3241
  <xsl:value-of select="$language_current"/>
3160
3242
  </xsl:when>
3243
+ <xsl:when test="$language_current_2 != ''">
3244
+ <xsl:value-of select="$language_current_2"/>
3245
+ </xsl:when>
3161
3246
  <xsl:otherwise>
3162
3247
  <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3163
3248
  </xsl:otherwise>
@@ -3231,9 +3316,27 @@
3231
3316
  <xsl:copy>
3232
3317
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
3233
3318
  </xsl:copy>
3234
- <mathml:mspace width="0.5ex"/>
3319
+ <xsl:choose>
3320
+ <!-- if in msub, then don't add space -->
3321
+ <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3322
+ <!-- if next char in digit, don't add space -->
3323
+ <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3324
+ <xsl:otherwise>
3325
+ <mathml:mspace width="0.5ex"/>
3326
+ </xsl:otherwise>
3327
+ </xsl:choose>
3235
3328
  </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">
3236
3329
  <xsl:variable name="target">
3330
+ <xsl:choose>
3331
+ <xsl:when test="@updatetype = 'true'">
3332
+ <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
3333
+ </xsl:when>
3334
+ <xsl:otherwise>
3335
+ <xsl:value-of select="normalize-space(@target)"/>
3336
+ </xsl:otherwise>
3337
+ </xsl:choose>
3338
+ </xsl:variable>
3339
+ <xsl:variable name="target_text">
3237
3340
  <xsl:choose>
3238
3341
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
3239
3342
  <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
@@ -3245,20 +3348,22 @@
3245
3348
  </xsl:variable>
3246
3349
  <fo:inline xsl:use-attribute-sets="link-style">
3247
3350
 
3351
+
3352
+
3248
3353
  <xsl:choose>
3249
- <xsl:when test="$target = ''">
3354
+ <xsl:when test="$target_text = ''">
3250
3355
  <xsl:apply-templates/>
3251
3356
  </xsl:when>
3252
3357
  <xsl:otherwise>
3253
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3358
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
3254
3359
  <xsl:choose>
3255
3360
  <xsl:when test="normalize-space(.) = ''">
3256
- <!-- <xsl:value-of select="$target"/> -->
3257
3361
  <xsl:call-template name="add-zero-spaces-link-java">
3258
- <xsl:with-param name="text" select="$target"/>
3362
+ <xsl:with-param name="text" select="$target_text"/>
3259
3363
  </xsl:call-template>
3260
3364
  </xsl:when>
3261
3365
  <xsl:otherwise>
3366
+ <!-- output text from <link>text</link> -->
3262
3367
  <xsl:apply-templates/>
3263
3368
  </xsl:otherwise>
3264
3369
  </xsl:choose>
@@ -3370,6 +3475,7 @@
3370
3475
 
3371
3476
 
3372
3477
  <fo:inline xsl:use-attribute-sets="note-name-style">
3478
+
3373
3479
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3374
3480
  </fo:inline>
3375
3481
  <xsl:apply-templates/>
@@ -3395,7 +3501,9 @@
3395
3501
  </xsl:choose>
3396
3502
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
3397
3503
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
3504
+
3398
3505
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
3506
+
3399
3507
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3400
3508
  </fo:inline>
3401
3509
  <xsl:apply-templates/>
@@ -3473,13 +3581,17 @@
3473
3581
  </xsl:call-template>
3474
3582
 
3475
3583
  <fo:block>
3584
+
3476
3585
  <xsl:apply-templates/>
3477
3586
  </fo:block>
3478
3587
  <xsl:call-template name="fn_display_figure"/>
3479
3588
  <xsl:for-each select="*[local-name() = 'note']">
3480
3589
  <xsl:call-template name="note"/>
3481
3590
  </xsl:for-each>
3482
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3591
+
3592
+
3593
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3594
+
3483
3595
  </fo:block-container>
3484
3596
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
3485
3597
  <fo:block id="{@id}">
@@ -3592,21 +3704,249 @@
3592
3704
  <xsl:param name="height"/>
3593
3705
  <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; "/>
3594
3706
  <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; "/>
3707
+ </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">
3708
+ <xsl:param name="name"/>
3709
+
3710
+ <xsl:variable name="svg_content">
3711
+ <xsl:apply-templates select="." mode="svg_update"/>
3712
+ </xsl:variable>
3713
+
3714
+ <xsl:variable name="alt-text">
3715
+ <xsl:choose>
3716
+ <xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
3717
+ <xsl:value-of select="../*[local-name() = 'name']"/>
3718
+ </xsl:when>
3719
+ <xsl:when test="normalize-space($name) != ''">
3720
+ <xsl:value-of select="$name"/>
3721
+ </xsl:when>
3722
+ <xsl:otherwise>Figure</xsl:otherwise>
3723
+ </xsl:choose>
3724
+ </xsl:variable>
3725
+
3726
+ <xsl:choose>
3727
+ <xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
3728
+ <fo:block>
3729
+ <xsl:variable name="width" select="@width"/>
3730
+ <xsl:variable name="height" select="@height"/>
3731
+
3732
+ <xsl:variable name="scale_x">
3733
+ <xsl:choose>
3734
+ <xsl:when test="$width &gt; $width_effective_px">
3735
+ <xsl:value-of select="$width_effective_px div $width"/>
3736
+ </xsl:when>
3737
+ <xsl:otherwise>1</xsl:otherwise>
3738
+ </xsl:choose>
3739
+ </xsl:variable>
3740
+
3741
+ <xsl:variable name="scale_y">
3742
+ <xsl:choose>
3743
+ <xsl:when test="$height * $scale_x &gt; $height_effective_px">
3744
+ <xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
3745
+ </xsl:when>
3746
+ <xsl:otherwise>1</xsl:otherwise>
3747
+ </xsl:choose>
3748
+ </xsl:variable>
3749
+
3750
+ <xsl:variable name="scale">
3751
+ <xsl:choose>
3752
+ <xsl:when test="$scale_y != 1">
3753
+ <xsl:value-of select="$scale_x * $scale_y"/>
3754
+ </xsl:when>
3755
+ <xsl:otherwise>
3756
+ <xsl:value-of select="$scale_x"/>
3757
+ </xsl:otherwise>
3758
+ </xsl:choose>
3759
+ </xsl:variable>
3760
+
3761
+ <xsl:variable name="width_scale" select="round($width * $scale)"/>
3762
+ <xsl:variable name="height_scale" select="round($height * $scale)"/>
3763
+
3764
+ <fo:table table-layout="fixed" width="100%">
3765
+ <fo:table-column column-width="proportional-column-width(1)"/>
3766
+ <fo:table-column column-width="{$width_scale}px"/>
3767
+ <fo:table-column column-width="proportional-column-width(1)"/>
3768
+ <fo:table-body>
3769
+ <fo:table-row>
3770
+ <fo:table-cell column-number="2">
3771
+ <fo:block>
3772
+ <fo:block-container width="{$width_scale}px" height="{$height_scale}px">
3773
+ <xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
3774
+ <fo:block line-height="0" font-size="0">
3775
+ <xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
3776
+ <xsl:call-template name="bookmark"/>
3777
+ </xsl:for-each>
3778
+ </fo:block>
3779
+ </xsl:if>
3780
+ <fo:block text-depth="0" line-height="0" font-size="0">
3781
+
3782
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
3783
+ <xsl:attribute name="width">100%</xsl:attribute>
3784
+ <xsl:attribute name="content-height">100%</xsl:attribute>
3785
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3786
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
3787
+
3788
+ <xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
3789
+ </fo:instream-foreign-object>
3790
+ </fo:block>
3791
+
3792
+ <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">
3793
+ <xsl:with-param name="scale" select="$scale"/>
3794
+ </xsl:apply-templates>
3795
+ </fo:block-container>
3796
+ </fo:block>
3797
+ </fo:table-cell>
3798
+ </fo:table-row>
3799
+ </fo:table-body>
3800
+ </fo:table>
3801
+ </fo:block>
3802
+
3803
+ </xsl:when>
3804
+ <xsl:otherwise>
3805
+ <fo:block xsl:use-attribute-sets="image-style">
3806
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
3807
+ <xsl:attribute name="width">100%</xsl:attribute>
3808
+ <xsl:attribute name="content-height">100%</xsl:attribute>
3809
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3810
+ <!-- effective height 297 - 27.4 - 13 = 256.6 -->
3811
+ <!-- effective width 210 - 12.5 - 25 = 172.5 -->
3812
+ <!-- effective height / width = 1.48, 1.4 - with title -->
3813
+ <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
3814
+ <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
3815
+ <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
3816
+ </xsl:if>
3817
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
3818
+ <xsl:copy-of select="$svg_content"/>
3819
+ </fo:instream-foreign-object>
3820
+ </fo:block>
3821
+ </xsl:otherwise>
3822
+ </xsl:choose>
3823
+ </xsl:template><xsl:template match="@*|node()" mode="svg_update">
3824
+ <xsl:copy>
3825
+ <xsl:apply-templates select="@*|node()" mode="svg_update"/>
3826
+ </xsl:copy>
3827
+ </xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
3828
+ <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
3829
+ <xsl:value-of select="."/>
3830
+ </xsl:attribute>
3831
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
3832
+ <xsl:variable name="svg_content" select="document(@src)"/>
3833
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
3834
+ <xsl:for-each select="xalan:nodeset($svg_content)/node()">
3835
+ <xsl:call-template name="image_svg">
3836
+ <xsl:with-param name="name" select="$name"/>
3837
+ </xsl:call-template>
3838
+ </xsl:for-each>
3839
+ </xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
3840
+ <xsl:copy>
3841
+ <xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
3842
+ </xsl:copy>
3843
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
3844
+ <xsl:apply-templates mode="svg_remove_a"/>
3845
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
3846
+ <xsl:param name="scale"/>
3847
+ <xsl:variable name="dest">
3848
+ <xsl:choose>
3849
+ <xsl:when test="starts-with(@href, '#')">
3850
+ <xsl:value-of select="substring-after(@href, '#')"/>
3851
+ </xsl:when>
3852
+ <xsl:otherwise>
3853
+ <xsl:value-of select="@href"/>
3854
+ </xsl:otherwise>
3855
+ </xsl:choose>
3856
+ </xsl:variable>
3857
+ <xsl:for-each select="./*[local-name() = 'rect']">
3858
+ <xsl:call-template name="insertSVGMapLink">
3859
+ <xsl:with-param name="left" select="floor(@x * $scale)"/>
3860
+ <xsl:with-param name="top" select="floor(@y * $scale)"/>
3861
+ <xsl:with-param name="width" select="floor(@width * $scale)"/>
3862
+ <xsl:with-param name="height" select="floor(@height * $scale)"/>
3863
+ <xsl:with-param name="dest" select="$dest"/>
3864
+ </xsl:call-template>
3865
+ </xsl:for-each>
3866
+
3867
+ <xsl:for-each select="./*[local-name() = 'polygon']">
3868
+ <xsl:variable name="points">
3869
+ <xsl:call-template name="split">
3870
+ <xsl:with-param name="pText" select="@points"/>
3871
+ </xsl:call-template>
3872
+ </xsl:variable>
3873
+ <xsl:variable name="x_coords">
3874
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
3875
+ <xsl:sort select="." data-type="number"/>
3876
+ <x><xsl:value-of select="."/></x>
3877
+ </xsl:for-each>
3878
+ </xsl:variable>
3879
+ <xsl:variable name="y_coords">
3880
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
3881
+ <xsl:sort select="." data-type="number"/>
3882
+ <y><xsl:value-of select="."/></y>
3883
+ </xsl:for-each>
3884
+ </xsl:variable>
3885
+ <xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
3886
+ <xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
3887
+ <xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
3888
+ <xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
3889
+ <xsl:call-template name="insertSVGMapLink">
3890
+ <xsl:with-param name="left" select="floor($x * $scale)"/>
3891
+ <xsl:with-param name="top" select="floor($y * $scale)"/>
3892
+ <xsl:with-param name="width" select="floor($width * $scale)"/>
3893
+ <xsl:with-param name="height" select="floor($height * $scale)"/>
3894
+ <xsl:with-param name="dest" select="$dest"/>
3895
+ </xsl:call-template>
3896
+ </xsl:for-each>
3897
+
3898
+ <xsl:for-each select="./*[local-name() = 'circle']">
3899
+ <xsl:call-template name="insertSVGMapLink">
3900
+ <xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
3901
+ <xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
3902
+ <xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
3903
+ <xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
3904
+ <xsl:with-param name="dest" select="$dest"/>
3905
+ </xsl:call-template>
3906
+ </xsl:for-each>
3907
+ <xsl:for-each select="./*[local-name() = 'ellipse']">
3908
+ <xsl:call-template name="insertSVGMapLink">
3909
+ <xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
3910
+ <xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
3911
+ <xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
3912
+ <xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
3913
+ <xsl:with-param name="dest" select="$dest"/>
3914
+ </xsl:call-template>
3915
+ </xsl:for-each>
3916
+ </xsl:template><xsl:template name="insertSVGMapLink">
3917
+ <xsl:param name="left"/>
3918
+ <xsl:param name="top"/>
3919
+ <xsl:param name="width"/>
3920
+ <xsl:param name="height"/>
3921
+ <xsl:param name="dest"/>
3922
+ <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
3923
+ <fo:block font-size="1pt">
3924
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
3925
+ <fo:inline-container inline-progression-dimension="100%">
3926
+ <fo:block-container height="{$height - 1}px" width="100%">
3927
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
3928
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
3929
+ </xsl:if> -->
3930
+ <fo:block> </fo:block></fo:block-container>
3931
+ </fo:inline-container>
3932
+ </fo:basic-link>
3933
+ </fo:block>
3934
+ </fo:block-container>
3595
3935
  </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">
3596
3936
  <xsl:apply-templates mode="contents"/>
3597
3937
  <xsl:text> </xsl:text>
3598
3938
  </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">
3599
3939
  <xsl:apply-templates mode="bookmarks"/>
3600
3940
  <xsl:text> </xsl:text>
3601
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
3941
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
3602
3942
  <xsl:value-of select="."/>
3603
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
3943
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
3604
3944
  <xsl:value-of select="."/>
3605
3945
  </xsl:template><xsl:template match="node()" mode="contents">
3606
3946
  <xsl:apply-templates mode="contents"/>
3607
3947
  </xsl:template><xsl:template match="node()" mode="bookmarks">
3608
3948
  <xsl:apply-templates mode="bookmarks"/>
3609
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3949
+ </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
3610
3950
  <xsl:apply-templates select="."/>
3611
3951
  </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3612
3952
  <xsl:apply-templates mode="bookmarks"/>
@@ -3620,28 +3960,39 @@
3620
3960
  <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3621
3961
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3622
3962
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3963
+ <xsl:if test="@bundle = 'true'">
3964
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
3965
+ </xsl:if>
3623
3966
  <fo:bookmark-title>
3624
- <xsl:variable name="bookmark-title_">
3625
- <xsl:call-template name="getLangVersion">
3626
- <xsl:with-param name="lang" select="@lang"/>
3627
- <xsl:with-param name="doctype" select="@doctype"/>
3628
- <xsl:with-param name="title" select="@title-part"/>
3629
- </xsl:call-template>
3630
- </xsl:variable>
3631
3967
  <xsl:choose>
3632
- <xsl:when test="normalize-space($bookmark-title_) != ''">
3633
- <xsl:value-of select="normalize-space($bookmark-title_)"/>
3634
- </xsl:when>
3635
- <xsl:otherwise>
3968
+ <xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
3969
+ <xsl:variable name="bookmark-title_">
3970
+ <xsl:call-template name="getLangVersion">
3971
+ <xsl:with-param name="lang" select="@lang"/>
3972
+ <xsl:with-param name="doctype" select="@doctype"/>
3973
+ <xsl:with-param name="title" select="@title-part"/>
3974
+ </xsl:call-template>
3975
+ </xsl:variable>
3636
3976
  <xsl:choose>
3637
- <xsl:when test="@lang = 'en'">English</xsl:when>
3638
- <xsl:when test="@lang = 'fr'">Français</xsl:when>
3639
- <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3640
- <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3977
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3978
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3979
+ </xsl:when>
3980
+ <xsl:otherwise>
3981
+ <xsl:choose>
3982
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3983
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3984
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3985
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3986
+ </xsl:choose>
3987
+ </xsl:otherwise>
3641
3988
  </xsl:choose>
3989
+ </xsl:when>
3990
+ <xsl:otherwise>
3991
+ <xsl:value-of select="@title-part"/>
3642
3992
  </xsl:otherwise>
3643
3993
  </xsl:choose>
3644
3994
  </fo:bookmark-title>
3995
+
3645
3996
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3646
3997
 
3647
3998
  <xsl:call-template name="insertFigureBookmarks">
@@ -3740,20 +4091,28 @@
3740
4091
  <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3741
4092
  </xsl:choose>
3742
4093
  </xsl:template><xsl:template match="item" mode="bookmark">
3743
- <fo:bookmark internal-destination="{@id}" starting-state="hide">
3744
- <fo:bookmark-title>
3745
- <xsl:if test="@section != ''">
3746
- <xsl:value-of select="@section"/>
3747
- <xsl:text> </xsl:text>
3748
- </xsl:if>
3749
- <xsl:value-of select="normalize-space(title)"/>
3750
- </fo:bookmark-title>
3751
- <xsl:apply-templates mode="bookmark"/>
3752
- </fo:bookmark>
4094
+ <xsl:choose>
4095
+ <xsl:when test="@id != ''">
4096
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
4097
+ <fo:bookmark-title>
4098
+ <xsl:if test="@section != ''">
4099
+ <xsl:value-of select="@section"/>
4100
+ <xsl:text> </xsl:text>
4101
+ </xsl:if>
4102
+ <xsl:value-of select="normalize-space(title)"/>
4103
+ </fo:bookmark-title>
4104
+ <xsl:apply-templates mode="bookmark"/>
4105
+ </fo:bookmark>
4106
+ </xsl:when>
4107
+ <xsl:otherwise>
4108
+ <xsl:apply-templates mode="bookmark"/>
4109
+ </xsl:otherwise>
4110
+ </xsl:choose>
3753
4111
  </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">
3754
4112
  <xsl:if test="normalize-space() != ''">
3755
4113
  <fo:block xsl:use-attribute-sets="figure-name-style">
3756
4114
 
4115
+
3757
4116
  <xsl:apply-templates/>
3758
4117
  </fo:block>
3759
4118
  </xsl:if>
@@ -3805,6 +4164,8 @@
3805
4164
  </fo:list-item-body>
3806
4165
  </fo:list-item>
3807
4166
  </fo:list-block>
4167
+ </xsl:template><xsl:template name="extractSection">
4168
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3808
4169
  </xsl:template><xsl:template name="extractTitle">
3809
4170
  <xsl:choose>
3810
4171
  <xsl:when test="*[local-name() = 'tab']">
@@ -3831,6 +4192,8 @@
3831
4192
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3832
4193
 
3833
4194
  <fo:block-container margin-left="0mm">
4195
+ <xsl:copy-of select="@id"/>
4196
+
3834
4197
  <xsl:if test="parent::*[local-name() = 'note']">
3835
4198
  <xsl:attribute name="margin-left">
3836
4199
  <xsl:choose>
@@ -3841,7 +4204,9 @@
3841
4204
 
3842
4205
  </xsl:if>
3843
4206
  <fo:block-container margin-left="0mm">
3844
-
4207
+
4208
+
4209
+
3845
4210
  <fo:block xsl:use-attribute-sets="sourcecode-style">
3846
4211
  <xsl:variable name="_font-size">
3847
4212
 
@@ -3852,6 +4217,7 @@
3852
4217
 
3853
4218
 
3854
4219
 
4220
+
3855
4221
 
3856
4222
 
3857
4223
 
@@ -3869,10 +4235,14 @@
3869
4235
  </xsl:choose>
3870
4236
  </xsl:attribute>
3871
4237
  </xsl:if>
3872
- <xsl:apply-templates/>
3873
- </fo:block>
4238
+
4239
+ <xsl:apply-templates/>
4240
+ </fo:block>
4241
+
4242
+
3874
4243
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3875
4244
 
4245
+
3876
4246
  </fo:block-container>
3877
4247
  </fo:block-container>
3878
4248
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -4107,6 +4477,7 @@
4107
4477
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4108
4478
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4109
4479
 
4480
+
4110
4481
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4111
4482
 
4112
4483
  <xsl:variable name="element">
@@ -4174,7 +4545,7 @@
4174
4545
  </fo:inline>
4175
4546
  </xsl:otherwise>
4176
4547
  </xsl:choose>
4177
- </xsl:template><xsl:template match="*[local-name() = 'termsource']">
4548
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
4178
4549
  <fo:block xsl:use-attribute-sets="termsource-style">
4179
4550
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
4180
4551
  <xsl:variable name="termsource_text">
@@ -4183,13 +4554,15 @@
4183
4554
 
4184
4555
  <xsl:choose>
4185
4556
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
4186
- <xsl:apply-templates/>
4557
+ <!-- <xsl:apply-templates /> -->
4558
+ <xsl:copy-of select="$termsource_text"/>
4187
4559
  </xsl:when>
4188
4560
  <xsl:otherwise>
4189
4561
 
4190
4562
  <xsl:text>[</xsl:text>
4191
4563
 
4192
- <xsl:apply-templates/>
4564
+ <!-- <xsl:apply-templates /> -->
4565
+ <xsl:copy-of select="$termsource_text"/>
4193
4566
 
4194
4567
  <xsl:text>]</xsl:text>
4195
4568
 
@@ -4200,8 +4573,15 @@
4200
4573
  <xsl:if test="normalize-space() != ''">
4201
4574
  <xsl:value-of select="."/>
4202
4575
  </xsl:if>
4203
- </xsl:template><xsl:template match="*[local-name() = 'origin']">
4576
+ </xsl:template><xsl:variable name="localized.source">
4577
+ <xsl:call-template name="getLocalizedString">
4578
+ <xsl:with-param name="key">source</xsl:with-param>
4579
+ </xsl:call-template>
4580
+ </xsl:variable><xsl:template match="*[local-name() = 'origin']">
4204
4581
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4582
+ <xsl:if test="normalize-space(@citeas) = ''">
4583
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4584
+ </xsl:if>
4205
4585
 
4206
4586
  <fo:inline xsl:use-attribute-sets="origin-style">
4207
4587
  <xsl:apply-templates/>
@@ -4273,6 +4653,7 @@
4273
4653
  </xsl:if>
4274
4654
 
4275
4655
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4656
+
4276
4657
  <xsl:if test="normalize-space(@citeas) = ''">
4277
4658
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
4278
4659
  </xsl:if>
@@ -4307,6 +4688,7 @@
4307
4688
 
4308
4689
 
4309
4690
 
4691
+
4310
4692
 
4311
4693
  <xsl:variable name="references_num_current">
4312
4694
  <xsl:number level="any" count="m3d:references"/>
@@ -4413,7 +4795,6 @@
4413
4795
 
4414
4796
 
4415
4797
 
4416
-
4417
4798
  <xsl:apply-templates/>
4418
4799
  </fo:block>
4419
4800
 
@@ -4430,6 +4811,7 @@
4430
4811
  <xsl:call-template name="setId"/>
4431
4812
 
4432
4813
 
4814
+
4433
4815
  <xsl:apply-templates/>
4434
4816
  </fo:block>
4435
4817
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
@@ -4456,7 +4838,7 @@
4456
4838
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
4457
4839
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
4458
4840
  <xsl:choose>
4459
- <xsl:when test="parent::*[local-name() = 'note']">
4841
+ <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
4460
4842
  <fo:block-container>
4461
4843
  <xsl:attribute name="margin-left">
4462
4844
  <xsl:choose>
@@ -4466,6 +4848,7 @@
4466
4848
  </xsl:attribute>
4467
4849
 
4468
4850
 
4851
+
4469
4852
  <fo:block-container margin-left="0mm">
4470
4853
  <fo:block>
4471
4854
  <xsl:apply-templates select="." mode="ul_ol"/>
@@ -4667,21 +5050,25 @@
4667
5050
 
4668
5051
 
4669
5052
 
5053
+
5054
+
5055
+
5056
+
4670
5057
  </xsl:template><xsl:template name="processBibitemDocId">
4671
5058
  <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')]"/>
4672
5059
  <xsl:choose>
4673
5060
  <xsl:when test="normalize-space($_doc_ident) != ''">
4674
- <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"/>
5061
+ <!-- <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"/>
4675
5062
  <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
4676
5063
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4677
- </xsl:if>
5064
+ </xsl:if> -->
4678
5065
  <xsl:value-of select="$_doc_ident"/>
4679
5066
  </xsl:when>
4680
5067
  <xsl:otherwise>
4681
- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
5068
+ <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
4682
5069
  <xsl:if test="$type != ''">
4683
5070
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4684
- </xsl:if>
5071
+ </xsl:if> -->
4685
5072
  <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
4686
5073
  </xsl:otherwise>
4687
5074
  </xsl:choose>
@@ -4723,6 +5110,70 @@
4723
5110
  <xsl:value-of select="substring(.,1,1)"/>
4724
5111
  </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
4725
5112
  <fo:inline><xsl:apply-templates/></fo:inline>
5113
+ </xsl:template><xsl:template match="*[local-name() = 'form']">
5114
+ <fo:block>
5115
+ <xsl:apply-templates/>
5116
+ </fo:block>
5117
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
5118
+ <fo:inline><xsl:apply-templates/></fo:inline>
5119
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
5120
+ <fo:inline>
5121
+ <xsl:call-template name="text_input"/>
5122
+ </fo:inline>
5123
+ </xsl:template><xsl:template name="text_input">
5124
+ <xsl:variable name="count">
5125
+ <xsl:choose>
5126
+ <xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
5127
+ <xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
5128
+ <xsl:otherwise>10</xsl:otherwise>
5129
+ </xsl:choose>
5130
+ </xsl:variable>
5131
+ <xsl:call-template name="repeat">
5132
+ <xsl:with-param name="char" select="'_'"/>
5133
+ <xsl:with-param name="count" select="$count"/>
5134
+ </xsl:call-template>
5135
+ <xsl:text> </xsl:text>
5136
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
5137
+ <xsl:variable name="caption">
5138
+ <xsl:choose>
5139
+ <xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
5140
+ <xsl:otherwise>BUTTON</xsl:otherwise>
5141
+ </xsl:choose>
5142
+ </xsl:variable>
5143
+ <fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
5144
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
5145
+ <fo:inline padding-right="1mm">
5146
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
5147
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
5148
+ <xsl:attribute name="content-width">100%</xsl:attribute>
5149
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
5150
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
5151
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
5152
+ <polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
5153
+ </svg>
5154
+ </fo:instream-foreign-object>
5155
+ </fo:inline>
5156
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
5157
+ <fo:inline padding-right="1mm">
5158
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
5159
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
5160
+ <xsl:attribute name="content-width">100%</xsl:attribute>
5161
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
5162
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
5163
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
5164
+ <circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
5165
+ <circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
5166
+ </svg>
5167
+ </fo:instream-foreign-object>
5168
+ </fo:inline>
5169
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
5170
+ <fo:inline>
5171
+ <xsl:call-template name="text_input"/>
5172
+ </fo:inline>
5173
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
5174
+ <fo:block-container border="1pt solid black" width="50%">
5175
+ <fo:block> </fo:block>
5176
+ </fo:block-container>
4726
5177
  </xsl:template><xsl:template name="convertDate">
4727
5178
  <xsl:param name="date"/>
4728
5179
  <xsl:param name="format" select="'short'"/>
@@ -4930,6 +5381,9 @@
4930
5381
  <xsl:when test="parent::*[local-name() = 'preface']">
4931
5382
  <xsl:value-of select="$level_total - 1"/>
4932
5383
  </xsl:when>
5384
+ <xsl:when test="ancestor::*[local-name() = 'preface'] and not(ancestor::*[local-name() = 'foreword']) and not(ancestor::*[local-name() = 'introduction'])"> <!-- for preface/clause -->
5385
+ <xsl:value-of select="$level_total - 1"/>
5386
+ </xsl:when>
4933
5387
  <xsl:when test="ancestor::*[local-name() = 'preface']">
4934
5388
  <xsl:value-of select="$level_total - 2"/>
4935
5389
  </xsl:when>
@@ -4994,6 +5448,7 @@
4994
5448
 
4995
5449
 
4996
5450
 
5451
+
4997
5452
  <xsl:value-of select="document('')//*/namespace::m3d"/>
4998
5453
 
4999
5454
 
@@ -5054,17 +5509,29 @@
5054
5509
  </xsl:call-template>
5055
5510
  </xsl:if>
5056
5511
  </xsl:template><xsl:template name="getLocalizedString">
5057
- <xsl:param name="key"/>
5512
+ <xsl:param name="key"/>
5058
5513
 
5059
5514
  <xsl:variable name="curr_lang">
5060
5515
  <xsl:call-template name="getLang"/>
5061
5516
  </xsl:variable>
5062
5517
 
5518
+ <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
5519
+
5063
5520
  <xsl:choose>
5521
+ <xsl:when test="$data_value != ''">
5522
+ <xsl:value-of select="$data_value"/>
5523
+ </xsl:when>
5064
5524
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5065
5525
  <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5066
5526
  </xsl:when>
5067
- <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
5527
+ <xsl:otherwise>
5528
+ <xsl:variable name="key_">
5529
+ <xsl:call-template name="capitalize">
5530
+ <xsl:with-param name="str" select="translate($key, '_', ' ')"/>
5531
+ </xsl:call-template>
5532
+ </xsl:variable>
5533
+ <xsl:value-of select="$key_"/>
5534
+ </xsl:otherwise>
5068
5535
  </xsl:choose>
5069
5536
 
5070
5537
  </xsl:template><xsl:template name="setTrackChangesStyles">
@@ -5107,4 +5574,14 @@
5107
5574
  <xsl:value-of select="$align"/>
5108
5575
  </xsl:when>
5109
5576
  </xsl:choose>
5577
+ </xsl:template><xsl:template name="setTextAlignment">
5578
+ <xsl:param name="default">left</xsl:param>
5579
+ <xsl:attribute name="text-align">
5580
+ <xsl:choose>
5581
+ <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
5582
+ <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
5583
+ <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
5584
+ <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
5585
+ </xsl:choose>
5586
+ </xsl:attribute>
5110
5587
  </xsl:template></xsl:stylesheet>