metanorma-m3aawg 1.6.8 → 1.7.3

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: e2c14367a19ac3e626087fc058207b281990867aa528f08f70ba6eb2780f1fbe
4
- data.tar.gz: 7f9d8fcdc4d946e525d089521c9cab8309a134d1288571cd0c5f81cd83b84876
3
+ metadata.gz: fdbb2f2eecda7549e307a465831998882079ebe7ed26100790809a89bd7952a9
4
+ data.tar.gz: 9f96d2ad4b74b4a953d908690b1b307c5c9f0994514d98a2bd5b84e992f43f5c
5
5
  SHA512:
6
- metadata.gz: d51169449e5e14b5803fdea2f394f9e38e2ab5a4d8d6065391a1c956bc06bafc9c3a2ae6306f09aafd67627ba39186764e304b2f54c1d79c7f73822159d51641
7
- data.tar.gz: f8e1825ec91766a43d741f0cd8f6db401d16ada002bed0b1a3d7c73838d292074d5ba1187c22e557128f1fb8f96a769ae29c1c50cfca1636c74202eeef0faaa8
6
+ metadata.gz: 8f5a64a375bea2db893b472e54a9792ed5408dfd337e043620a573f02159ddd5776cbeadd58838f0aed5423da83c0f302a0bf6b31c8724f95376a36e7b98db57
7
+ data.tar.gz: 8b5989657e3ab1b26ddb504c55099bea13af39046060a37b9aa5ff036dddd4c29c3fae5f37c001d96b01c0ba6d65d86a85f2d6373cf7773b73c05690a912e4e6
data/.gitignore CHANGED
@@ -1 +1,3 @@
1
1
  .DS_Store
2
+
3
+ .rubocop-https--*
data/.rubocop.yml CHANGED
@@ -1,6 +1,12 @@
1
1
  # This project follows the Ribose OSS style guide.
2
2
  # https://github.com/riboseinc/oss-guides
3
3
  # All project-specific additions and overrides should be specified in this file.
4
-
5
4
  inherit_from:
6
5
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
6
+
7
+ # local repo-specific modifications
8
+
9
+ AllCops:
10
+ DisplayCopNames: false
11
+ StyleGuideCopsOnly: false
12
+ TargetRubyVersion: 2.4
@@ -124,7 +124,7 @@
124
124
  <value>application/tei+xml</value>
125
125
  <value>text/x-asciidoc</value>
126
126
  <value>text/markdown</value>
127
- <value>application/x-isodoc+xml</value>
127
+ <value>application/x-metanorma+xml</value>
128
128
  <text/>
129
129
  </choice>
130
130
  </attribute>
@@ -452,6 +452,7 @@
452
452
  <attribute name="type">
453
453
  <choice>
454
454
  <value>isni</value>
455
+ <value>orcid</value>
455
456
  <value>uri</value>
456
457
  </choice>
457
458
  </attribute>
@@ -461,10 +462,7 @@
461
462
  <define name="org-identifier">
462
463
  <element name="identifier">
463
464
  <attribute name="type">
464
- <choice>
465
- <value>orcid</value>
466
- <value>uri</value>
467
- </choice>
465
+ <data type="string" datatypeLibrary=""/>
468
466
  </attribute>
469
467
  <text/>
470
468
  </element>
@@ -789,6 +787,7 @@
789
787
  <value>adapted</value>
790
788
  <value>vote-started</value>
791
789
  <value>vote-ended</value>
790
+ <value>announced</value>
792
791
  </choice>
793
792
  </define>
794
793
  <define name="bdate">
@@ -1106,7 +1105,7 @@
1106
1105
  <value>complementOf</value>
1107
1106
  <value>obsoletes</value>
1108
1107
  <value>obsoletedBy</value>
1109
- <value>cited</value>
1108
+ <value>cites</value>
1110
1109
  <value>isCitedIn</value>
1111
1110
  </choice>
1112
1111
  </define>
@@ -86,6 +86,35 @@
86
86
  <text/>
87
87
  </element>
88
88
  </define>
89
+ <define name="erefType">
90
+ <optional>
91
+ <attribute name="normative">
92
+ <data type="boolean"/>
93
+ </attribute>
94
+ </optional>
95
+ <attribute name="citeas"/>
96
+ <attribute name="type">
97
+ <ref name="ReferenceFormat"/>
98
+ </attribute>
99
+ <optional>
100
+ <attribute name="alt"/>
101
+ </optional>
102
+ <optional>
103
+ <attribute name="case">
104
+ <choice>
105
+ <value>capital</value>
106
+ <value>lowercase</value>
107
+ </choice>
108
+ </attribute>
109
+ </optional>
110
+ <optional>
111
+ <attribute name="droploc">
112
+ <data type="boolean"/>
113
+ </attribute>
114
+ </optional>
115
+ <ref name="CitationType"/>
116
+ <text/>
117
+ </define>
89
118
  <define name="ul">
90
119
  <element name="ul">
91
120
  <attribute name="id">
@@ -775,6 +804,90 @@
775
804
  <ref name="paragraph"/>
776
805
  </element>
777
806
  </define>
807
+ <define name="em">
808
+ <element name="em">
809
+ <zeroOrMore>
810
+ <choice>
811
+ <ref name="PureTextElement"/>
812
+ <ref name="stem"/>
813
+ <ref name="index"/>
814
+ </choice>
815
+ </zeroOrMore>
816
+ </element>
817
+ </define>
818
+ <define name="strong">
819
+ <element name="strong">
820
+ <zeroOrMore>
821
+ <choice>
822
+ <ref name="PureTextElement"/>
823
+ <ref name="stem"/>
824
+ <ref name="index"/>
825
+ </choice>
826
+ </zeroOrMore>
827
+ </element>
828
+ </define>
829
+ <define name="tt">
830
+ <element name="tt">
831
+ <zeroOrMore>
832
+ <choice>
833
+ <ref name="PureTextElement"/>
834
+ <ref name="index"/>
835
+ </choice>
836
+ </zeroOrMore>
837
+ </element>
838
+ </define>
839
+ <define name="keyword">
840
+ <element name="keyword">
841
+ <zeroOrMore>
842
+ <choice>
843
+ <ref name="PureTextElement"/>
844
+ <ref name="index"/>
845
+ </choice>
846
+ </zeroOrMore>
847
+ </element>
848
+ </define>
849
+ <define name="strike">
850
+ <element name="strike">
851
+ <zeroOrMore>
852
+ <choice>
853
+ <ref name="PureTextElement"/>
854
+ <ref name="index"/>
855
+ </choice>
856
+ </zeroOrMore>
857
+ </element>
858
+ </define>
859
+ <define name="underline">
860
+ <element name="underline">
861
+ <zeroOrMore>
862
+ <choice>
863
+ <ref name="PureTextElement"/>
864
+ <ref name="index"/>
865
+ </choice>
866
+ </zeroOrMore>
867
+ </element>
868
+ </define>
869
+ <define name="smallcap">
870
+ <element name="smallcap">
871
+ <zeroOrMore>
872
+ <choice>
873
+ <ref name="PureTextElement"/>
874
+ <ref name="index"/>
875
+ </choice>
876
+ </zeroOrMore>
877
+ </element>
878
+ </define>
879
+ <define name="pagebreak">
880
+ <element name="pagebreak">
881
+ <optional>
882
+ <attribute name="orientation">
883
+ <choice>
884
+ <value>landscape</value>
885
+ <value>portrait</value>
886
+ </choice>
887
+ </attribute>
888
+ </optional>
889
+ </element>
890
+ </define>
778
891
  </include>
779
892
  <!-- end overrides -->
780
893
  <define name="colgroup">
@@ -793,7 +906,35 @@
793
906
  <value>internal</value>
794
907
  </define>
795
908
  <define name="TextElement" combine="choice">
796
- <ref name="concept"/>
909
+ <choice>
910
+ <ref name="concept"/>
911
+ <ref name="add"/>
912
+ <ref name="del"/>
913
+ </choice>
914
+ </define>
915
+ <define name="add">
916
+ <element name="add">
917
+ <choice>
918
+ <ref name="PureTextElement"/>
919
+ <ref name="eref"/>
920
+ <ref name="stem"/>
921
+ <ref name="keyword"/>
922
+ <ref name="xref"/>
923
+ <ref name="hyperlink"/>
924
+ </choice>
925
+ </element>
926
+ </define>
927
+ <define name="del">
928
+ <element name="del">
929
+ <choice>
930
+ <ref name="PureTextElement"/>
931
+ <ref name="eref"/>
932
+ <ref name="stem"/>
933
+ <ref name="keyword"/>
934
+ <ref name="xref"/>
935
+ <ref name="hyperlink"/>
936
+ </choice>
937
+ </element>
797
938
  </define>
798
939
  <define name="concept">
799
940
  <element name="concept">
@@ -814,8 +955,170 @@
814
955
  <ref name="permission"/>
815
956
  <ref name="imagemap"/>
816
957
  <ref name="svgmap"/>
958
+ <ref name="inputform"/>
959
+ </choice>
960
+ </define>
961
+ <define name="inputform">
962
+ <element name="form">
963
+ <attribute name="id">
964
+ <data type="ID"/>
965
+ </attribute>
966
+ <attribute name="name"/>
967
+ <attribute name="action"/>
968
+ <zeroOrMore>
969
+ <choice>
970
+ <ref name="TextElement"/>
971
+ <ref name="FormInput"/>
972
+ </choice>
973
+ </zeroOrMore>
974
+ </element>
975
+ </define>
976
+ <define name="FormInput">
977
+ <choice>
978
+ <ref name="input"/>
979
+ <ref name="formlabel"/>
980
+ <ref name="select"/>
981
+ <ref name="textarea"/>
982
+ </choice>
983
+ </define>
984
+ <define name="InputType">
985
+ <choice>
986
+ <value>button</value>
987
+ <value>checkbox</value>
988
+ <value>date</value>
989
+ <value>file</value>
990
+ <value>password</value>
991
+ <value>radio</value>
992
+ <value>submit</value>
993
+ <value>text</value>
817
994
  </choice>
818
995
  </define>
996
+ <define name="input">
997
+ <element name="input">
998
+ <attribute name="type">
999
+ <ref name="InputType"/>
1000
+ </attribute>
1001
+ <optional>
1002
+ <attribute name="checked">
1003
+ <data type="boolean"/>
1004
+ </attribute>
1005
+ </optional>
1006
+ <optional>
1007
+ <attribute name="disabled">
1008
+ <data type="boolean"/>
1009
+ </attribute>
1010
+ </optional>
1011
+ <optional>
1012
+ <attribute name="readonly">
1013
+ <data type="boolean"/>
1014
+ </attribute>
1015
+ </optional>
1016
+ <optional>
1017
+ <attribute name="maxlength">
1018
+ <data type="int"/>
1019
+ </attribute>
1020
+ </optional>
1021
+ <optional>
1022
+ <attribute name="minlength">
1023
+ <data type="int"/>
1024
+ </attribute>
1025
+ </optional>
1026
+ <optional>
1027
+ <attribute name="name"/>
1028
+ </optional>
1029
+ <optional>
1030
+ <attribute name="value"/>
1031
+ </optional>
1032
+ <optional>
1033
+ <attribute name="id">
1034
+ <data type="ID"/>
1035
+ </attribute>
1036
+ </optional>
1037
+ </element>
1038
+ </define>
1039
+ <define name="formlabel">
1040
+ <element name="label">
1041
+ <attribute name="for">
1042
+ <data type="IDREF"/>
1043
+ </attribute>
1044
+ <zeroOrMore>
1045
+ <ref name="PureTextElement"/>
1046
+ </zeroOrMore>
1047
+ </element>
1048
+ </define>
1049
+ <define name="select">
1050
+ <element name="select">
1051
+ <optional>
1052
+ <attribute name="name"/>
1053
+ </optional>
1054
+ <optional>
1055
+ <attribute name="value"/>
1056
+ </optional>
1057
+ <optional>
1058
+ <attribute name="id">
1059
+ <data type="ID"/>
1060
+ </attribute>
1061
+ </optional>
1062
+ <optional>
1063
+ <attribute name="disabled">
1064
+ <data type="boolean"/>
1065
+ </attribute>
1066
+ </optional>
1067
+ <optional>
1068
+ <attribute name="multiple">
1069
+ <data type="boolean"/>
1070
+ </attribute>
1071
+ </optional>
1072
+ <optional>
1073
+ <attribute name="size">
1074
+ <data type="int"/>
1075
+ </attribute>
1076
+ </optional>
1077
+ <oneOrMore>
1078
+ <ref name="option"/>
1079
+ </oneOrMore>
1080
+ </element>
1081
+ </define>
1082
+ <define name="option">
1083
+ <element name="option">
1084
+ <optional>
1085
+ <attribute name="disabled">
1086
+ <data type="boolean"/>
1087
+ </attribute>
1088
+ </optional>
1089
+ <optional>
1090
+ <attribute name="value"/>
1091
+ </optional>
1092
+ <zeroOrMore>
1093
+ <ref name="PureTextElement"/>
1094
+ </zeroOrMore>
1095
+ </element>
1096
+ </define>
1097
+ <define name="textarea">
1098
+ <element name="textarea">
1099
+ <optional>
1100
+ <attribute name="name"/>
1101
+ </optional>
1102
+ <optional>
1103
+ <attribute name="value"/>
1104
+ </optional>
1105
+ <optional>
1106
+ <attribute name="id">
1107
+ <data type="ID"/>
1108
+ </attribute>
1109
+ </optional>
1110
+ <optional>
1111
+ <attribute name="rows">
1112
+ <data type="int"/>
1113
+ </attribute>
1114
+ </optional>
1115
+ <optional>
1116
+ <attribute name="cols">
1117
+ <data type="int"/>
1118
+ </attribute>
1119
+ </optional>
1120
+ </element>
1121
+ </define>
819
1122
  <define name="bibliography">
820
1123
  <element name="bibliography">
821
1124
  <oneOrMore>
@@ -888,9 +1191,7 @@
888
1191
  </define>
889
1192
  <define name="IsoWorkgroup">
890
1193
  <optional>
891
- <attribute name="number">
892
- <data type="int"/>
893
- </attribute>
1194
+ <attribute name="number"/>
894
1195
  </optional>
895
1196
  <optional>
896
1197
  <attribute name="type"/>
@@ -122,6 +122,13 @@ a.FootnoteRef + a.FootnoteRef:before {
122
122
  content: ", ";
123
123
  vertical-align: super; }
124
124
 
125
+ .addition {
126
+ color: blue; }
127
+
128
+ .deletion {
129
+ color: red;
130
+ text-decoration: line-through; }
131
+
125
132
  #standard-band {
126
133
  background-color: #0AC442; }
127
134
 
@@ -5,6 +5,7 @@
5
5
  <xsl:param name="svg_images"/>
6
6
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
7
7
  <xsl:variable name="images" select="document($svg_images)"/>
8
+ <xsl:param name="basepath"/>
8
9
 
9
10
 
10
11
 
@@ -1020,6 +1021,9 @@
1020
1021
  <title-continued lang="en">(continued)</title-continued>
1021
1022
  <title-continued lang="fr">(continué)</title-continued>
1022
1023
 
1024
+ </xsl:variable><xsl:variable name="bibdata">
1025
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
1026
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
1023
1027
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1024
1028
  <xsl:param name="name"/>
1025
1029
  <xsl:param name="lang"/>
@@ -1045,8 +1049,10 @@
1045
1049
  </xsl:choose>
1046
1050
  </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="root-style">
1047
1051
 
1052
+
1048
1053
  </xsl:attribute-set><xsl:attribute-set name="link-style">
1049
1054
 
1055
+
1050
1056
  <xsl:attribute name="color">blue</xsl:attribute>
1051
1057
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1052
1058
 
@@ -1170,6 +1176,7 @@
1170
1176
 
1171
1177
  </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1172
1178
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1179
+
1173
1180
 
1174
1181
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1175
1182
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -1207,6 +1214,7 @@
1207
1214
 
1208
1215
 
1209
1216
 
1217
+
1210
1218
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1211
1219
 
1212
1220
 
@@ -1216,6 +1224,7 @@
1216
1224
 
1217
1225
 
1218
1226
 
1227
+
1219
1228
 
1220
1229
 
1221
1230
 
@@ -1241,6 +1250,7 @@
1241
1250
 
1242
1251
 
1243
1252
 
1253
+
1244
1254
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
1245
1255
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1246
1256
 
@@ -1271,7 +1281,9 @@
1271
1281
 
1272
1282
 
1273
1283
 
1284
+
1274
1285
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1286
+
1275
1287
 
1276
1288
 
1277
1289
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
@@ -1298,6 +1310,7 @@
1298
1310
 
1299
1311
 
1300
1312
 
1313
+
1301
1314
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1302
1315
 
1303
1316
 
@@ -1306,6 +1319,7 @@
1306
1319
 
1307
1320
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1308
1321
 
1322
+
1309
1323
 
1310
1324
 
1311
1325
 
@@ -1337,11 +1351,13 @@
1337
1351
 
1338
1352
 
1339
1353
 
1354
+
1340
1355
  </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1341
1356
 
1342
1357
  </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1343
1358
 
1344
1359
 
1360
+
1345
1361
  <xsl:attribute name="width">100%</xsl:attribute>
1346
1362
  <xsl:attribute name="content-height">100%</xsl:attribute>
1347
1363
  <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
@@ -1367,13 +1383,32 @@
1367
1383
 
1368
1384
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1369
1385
 
1370
-
1386
+
1371
1387
  </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1372
1388
 
1373
1389
  </xsl:attribute-set><xsl:attribute-set name="definition-style">
1374
1390
 
1375
1391
 
1376
- </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
1392
+
1393
+ </xsl:attribute-set><xsl:variable name="color-added-text">
1394
+ <xsl:text>rgb(0, 255, 0)</xsl:text>
1395
+ </xsl:variable><xsl:attribute-set name="add-style">
1396
+ <xsl:attribute name="color">red</xsl:attribute>
1397
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1398
+ <!-- <xsl:attribute name="color">black</xsl:attribute>
1399
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
1400
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
1401
+ <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
1402
+ </xsl:attribute-set><xsl:variable name="color-deleted-text">
1403
+ <xsl:text>red</xsl:text>
1404
+ </xsl:variable><xsl:attribute-set name="del-style">
1405
+ <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
1406
+ <xsl:attribute name="text-decoration">line-through</xsl:attribute>
1407
+ </xsl:attribute-set><xsl:attribute-set name="mathml-style">
1408
+ <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
1409
+
1410
+
1411
+ </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">
1377
1412
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1378
1413
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1379
1414
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
@@ -1422,16 +1457,17 @@
1422
1457
  <xsl:call-template name="add-zero-spaces-java"/>
1423
1458
  </xsl:template><xsl:template match="*[local-name()='table']" name="table">
1424
1459
 
1460
+ <xsl:variable name="table-preamble">
1461
+
1462
+
1463
+ </xsl:variable>
1464
+
1425
1465
  <xsl:variable name="table">
1426
1466
 
1427
1467
  <xsl:variable name="simple-table">
1428
1468
  <xsl:call-template name="getSimpleTable"/>
1429
1469
  </xsl:variable>
1430
1470
 
1431
-
1432
-
1433
-
1434
-
1435
1471
  <!-- <xsl:if test="$namespace = 'bipm'">
1436
1472
  <fo:block>&#xA0;</fo:block>
1437
1473
  </xsl:if> -->
@@ -1446,7 +1482,7 @@
1446
1482
 
1447
1483
 
1448
1484
 
1449
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1485
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
1450
1486
 
1451
1487
  <!-- <xsl:variable name="cols-count">
1452
1488
  <xsl:choose>
@@ -1465,8 +1501,6 @@
1465
1501
  <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1466
1502
  <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1467
1503
 
1468
-
1469
-
1470
1504
  <xsl:variable name="colwidths">
1471
1505
  <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1472
1506
  <xsl:call-template name="calculate-column-widths">
@@ -1494,9 +1528,11 @@
1494
1528
  </xsl:choose>
1495
1529
  </xsl:variable>
1496
1530
 
1531
+
1497
1532
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1498
1533
 
1499
1534
 
1535
+
1500
1536
 
1501
1537
 
1502
1538
 
@@ -1509,6 +1545,8 @@
1509
1545
 
1510
1546
 
1511
1547
 
1548
+
1549
+
1512
1550
  <xsl:variable name="table_width">
1513
1551
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1514
1552
  100%
@@ -1525,6 +1563,8 @@
1525
1563
 
1526
1564
 
1527
1565
 
1566
+
1567
+
1528
1568
 
1529
1569
 
1530
1570
 
@@ -1614,7 +1654,8 @@
1614
1654
  </fo:block-container>
1615
1655
  </xsl:variable>
1616
1656
 
1617
-
1657
+ <xsl:variable name="isAdded" select="@added"/>
1658
+ <xsl:variable name="isDeleted" select="@deleted"/>
1618
1659
 
1619
1660
  <xsl:choose>
1620
1661
  <xsl:when test="@width">
@@ -1628,7 +1669,14 @@
1628
1669
  <fo:table-body>
1629
1670
  <fo:table-row>
1630
1671
  <fo:table-cell column-number="2">
1631
- <fo:block><xsl:copy-of select="$table"/></fo:block>
1672
+ <xsl:copy-of select="$table-preamble"/>
1673
+ <fo:block>
1674
+ <xsl:call-template name="setTrackChangesStyles">
1675
+ <xsl:with-param name="isAdded" select="$isAdded"/>
1676
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
1677
+ </xsl:call-template>
1678
+ <xsl:copy-of select="$table"/>
1679
+ </fo:block>
1632
1680
  </fo:table-cell>
1633
1681
  </fo:table-row>
1634
1682
  </fo:table-body>
@@ -1639,16 +1687,42 @@
1639
1687
 
1640
1688
  </xsl:when>
1641
1689
  <xsl:otherwise>
1642
- <xsl:copy-of select="$table"/>
1690
+ <xsl:choose>
1691
+ <xsl:when test="$isAdded = 'true' or $isDeleted = 'true'">
1692
+ <xsl:copy-of select="$table-preamble"/>
1693
+ <fo:block>
1694
+ <xsl:call-template name="setTrackChangesStyles">
1695
+ <xsl:with-param name="isAdded" select="$isAdded"/>
1696
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
1697
+ </xsl:call-template>
1698
+ <xsl:copy-of select="$table"/>
1699
+ </fo:block>
1700
+ </xsl:when>
1701
+ <xsl:otherwise>
1702
+ <xsl:copy-of select="$table-preamble"/>
1703
+ <xsl:copy-of select="$table"/>
1704
+ </xsl:otherwise>
1705
+ </xsl:choose>
1643
1706
  </xsl:otherwise>
1644
1707
  </xsl:choose>
1645
1708
 
1646
1709
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1710
+ <xsl:param name="continued"/>
1647
1711
  <xsl:if test="normalize-space() != ''">
1648
1712
  <fo:block xsl:use-attribute-sets="table-name-style">
1649
1713
 
1650
1714
 
1651
- <xsl:apply-templates/>
1715
+ <xsl:choose>
1716
+ <xsl:when test="$continued = 'true'">
1717
+ <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
1718
+
1719
+ </xsl:when>
1720
+ <xsl:otherwise>
1721
+ <xsl:apply-templates/>
1722
+ </xsl:otherwise>
1723
+ </xsl:choose>
1724
+
1725
+
1652
1726
  </fo:block>
1653
1727
  </xsl:if>
1654
1728
  </xsl:template><xsl:template name="calculate-columns-numbers">
@@ -1700,7 +1774,7 @@
1700
1774
  </xsl:for-each>
1701
1775
  </xsl:when>
1702
1776
  <xsl:otherwise>
1703
- <xsl:for-each select="xalan:nodeset($table)//tr">
1777
+ <xsl:for-each select="xalan:nodeset($table)/*/tr">
1704
1778
  <xsl:variable name="td_text">
1705
1779
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1706
1780
 
@@ -1788,18 +1862,18 @@
1788
1862
  <xsl:apply-templates/>
1789
1863
  </fo:table-header>
1790
1864
  </xsl:template><xsl:template name="table-header-title">
1791
- <xsl:param name="cols-count"/>
1865
+ <xsl:param name="cols-count"/>
1792
1866
  <!-- row for title -->
1793
1867
  <fo:table-row>
1794
1868
  <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">
1795
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1869
+
1870
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
1871
+ <xsl:with-param name="continued">true</xsl:with-param>
1872
+ </xsl:apply-templates>
1796
1873
  <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1797
1874
  <xsl:call-template name="fn_name_display"/>
1798
- </xsl:for-each>
1799
- <fo:block text-align="right" font-style="italic">
1800
- <xsl:text> </xsl:text>
1801
- <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1802
- </fo:block>
1875
+ </xsl:for-each>
1876
+
1803
1877
  </fo:table-cell>
1804
1878
  </fo:table-row>
1805
1879
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -2020,6 +2094,7 @@
2020
2094
 
2021
2095
 
2022
2096
 
2097
+
2023
2098
  </xsl:if>
2024
2099
  <xsl:if test="$parent-name = 'tfoot'">
2025
2100
 
@@ -2040,7 +2115,8 @@
2040
2115
  <xsl:attribute name="text-align">
2041
2116
  <xsl:choose>
2042
2117
  <xsl:when test="@align">
2043
- <xsl:value-of select="@align"/>
2118
+ <xsl:call-template name="setAlignment"/>
2119
+ <!-- <xsl:value-of select="@align"/> -->
2044
2120
  </xsl:when>
2045
2121
  <xsl:otherwise>center</xsl:otherwise>
2046
2122
  </xsl:choose>
@@ -2056,6 +2132,10 @@
2056
2132
 
2057
2133
 
2058
2134
 
2135
+
2136
+ <xsl:if test="$lang = 'ar'">
2137
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2138
+ </xsl:if>
2059
2139
  <xsl:if test="@colspan">
2060
2140
  <xsl:attribute name="number-columns-spanned">
2061
2141
  <xsl:value-of select="@colspan"/>
@@ -2087,11 +2167,15 @@
2087
2167
  <xsl:attribute name="text-align">
2088
2168
  <xsl:choose>
2089
2169
  <xsl:when test="@align">
2090
- <xsl:value-of select="@align"/>
2170
+ <xsl:call-template name="setAlignment"/>
2171
+ <!-- <xsl:value-of select="@align"/> -->
2091
2172
  </xsl:when>
2092
2173
  <xsl:otherwise>left</xsl:otherwise>
2093
2174
  </xsl:choose>
2094
2175
  </xsl:attribute>
2176
+ <xsl:if test="$lang = 'ar'">
2177
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2178
+ </xsl:if>
2095
2179
 
2096
2180
 
2097
2181
 
@@ -2103,6 +2187,10 @@
2103
2187
 
2104
2188
 
2105
2189
 
2190
+
2191
+ <xsl:if test=".//*[local-name() = 'table']">
2192
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2193
+ </xsl:if>
2106
2194
  <xsl:if test="@colspan">
2107
2195
  <xsl:attribute name="number-columns-spanned">
2108
2196
  <xsl:value-of select="@colspan"/>
@@ -2230,13 +2318,13 @@
2230
2318
  </xsl:choose>
2231
2319
  </xsl:variable>
2232
2320
  <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2233
- <xsl:element name="{$ns}:table">
2321
+ <!-- <xsl:element name="{$ns}:table"> -->
2234
2322
  <xsl:for-each select="*[local-name() = 'dl'][1]">
2235
2323
  <tbody>
2236
2324
  <xsl:apply-templates mode="dl"/>
2237
2325
  </tbody>
2238
2326
  </xsl:for-each>
2239
- </xsl:element>
2327
+ <!-- </xsl:element> -->
2240
2328
  </xsl:variable>
2241
2329
 
2242
2330
  <xsl:call-template name="calculate-column-widths">
@@ -2327,6 +2415,8 @@
2327
2415
  <xsl:apply-templates/>
2328
2416
  </fo:inline>
2329
2417
  </xsl:template><xsl:template match="*[local-name()='dl']">
2418
+ <xsl:variable name="isAdded" select="@added"/>
2419
+ <xsl:variable name="isDeleted" select="@deleted"/>
2330
2420
  <fo:block-container>
2331
2421
 
2332
2422
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -2343,6 +2433,12 @@
2343
2433
  </xsl:attribute>
2344
2434
 
2345
2435
  </xsl:if>
2436
+
2437
+ <xsl:call-template name="setTrackChangesStyles">
2438
+ <xsl:with-param name="isAdded" select="$isAdded"/>
2439
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
2440
+ </xsl:call-template>
2441
+
2346
2442
  <fo:block-container>
2347
2443
 
2348
2444
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -2450,11 +2546,11 @@
2450
2546
  </xsl:choose>
2451
2547
  </xsl:variable>
2452
2548
  <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2453
- <xsl:element name="{$ns}:table">
2549
+ <!-- <xsl:element name="{$ns}:table"> -->
2454
2550
  <tbody>
2455
2551
  <xsl:apply-templates mode="dl"/>
2456
2552
  </tbody>
2457
- </xsl:element>
2553
+ <!-- </xsl:element> -->
2458
2554
  </xsl:variable>
2459
2555
  <!-- html-table<xsl:copy-of select="$html-table"/> -->
2460
2556
  <xsl:variable name="colwidths">
@@ -2699,6 +2795,7 @@
2699
2795
 
2700
2796
 
2701
2797
 
2798
+
2702
2799
  <xsl:choose>
2703
2800
  <xsl:when test="not(ancestor::*[local-name()='note'])">10</xsl:when>
2704
2801
  <xsl:otherwise>11</xsl:otherwise>
@@ -2726,8 +2823,74 @@
2726
2823
  <fo:inline text-decoration="underline">
2727
2824
  <xsl:apply-templates/>
2728
2825
  </fo:inline>
2826
+ </xsl:template><xsl:template match="*[local-name()='add']">
2827
+ <xsl:choose>
2828
+ <xsl:when test="@amendment">
2829
+ <fo:inline>
2830
+ <xsl:call-template name="insertTag">
2831
+ <xsl:with-param name="kind">A</xsl:with-param>
2832
+ <xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
2833
+ </xsl:call-template>
2834
+ <xsl:apply-templates/>
2835
+ <xsl:call-template name="insertTag">
2836
+ <xsl:with-param name="type">closing</xsl:with-param>
2837
+ <xsl:with-param name="kind">A</xsl:with-param>
2838
+ <xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
2839
+ </xsl:call-template>
2840
+ </fo:inline>
2841
+ </xsl:when>
2842
+ <xsl:when test="@corrigenda">
2843
+ <fo:inline>
2844
+ <xsl:call-template name="insertTag">
2845
+ <xsl:with-param name="kind">C</xsl:with-param>
2846
+ <xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
2847
+ </xsl:call-template>
2848
+ <xsl:apply-templates/>
2849
+ <xsl:call-template name="insertTag">
2850
+ <xsl:with-param name="type">closing</xsl:with-param>
2851
+ <xsl:with-param name="kind">C</xsl:with-param>
2852
+ <xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
2853
+ </xsl:call-template>
2854
+ </fo:inline>
2855
+ </xsl:when>
2856
+ <xsl:otherwise>
2857
+ <fo:inline xsl:use-attribute-sets="add-style">
2858
+ <xsl:apply-templates/>
2859
+ </fo:inline>
2860
+ </xsl:otherwise>
2861
+ </xsl:choose>
2862
+
2863
+ </xsl:template><xsl:template name="insertTag">
2864
+ <xsl:param name="type"/>
2865
+ <xsl:param name="kind"/>
2866
+ <xsl:param name="value"/>
2867
+ <xsl:variable name="add_width" select="string-length($value) * 20"/>
2868
+ <xsl:variable name="maxwidth" select="60 + $add_width"/>
2869
+ <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
2870
+ <!-- <xsl:attribute name="width">7mm</xsl:attribute>
2871
+ <xsl:attribute name="content-height">100%</xsl:attribute> -->
2872
+ <xsl:attribute name="height">5mm</xsl:attribute>
2873
+ <xsl:attribute name="content-width">100%</xsl:attribute>
2874
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
2875
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
2876
+ <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
2877
+ <g>
2878
+ <xsl:if test="$type = 'closing'">
2879
+ <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
2880
+ </xsl:if>
2881
+ <polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
2882
+ <line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
2883
+ </g>
2884
+ <text font-family="Arial" x="15" y="57" font-size="40pt">
2885
+ <xsl:if test="$type = 'closing'">
2886
+ <xsl:attribute name="x">25</xsl:attribute>
2887
+ </xsl:if>
2888
+ <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
2889
+ </text>
2890
+ </svg>
2891
+ </fo:instream-foreign-object>
2729
2892
  </xsl:template><xsl:template match="*[local-name()='del']">
2730
- <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2893
+ <fo:inline xsl:use-attribute-sets="del-style">
2731
2894
  <xsl:apply-templates/>
2732
2895
  </fo:inline>
2733
2896
  </xsl:template><xsl:template match="*[local-name()='hi']">
@@ -3024,11 +3187,15 @@
3024
3187
  </xsl:apply-templates>
3025
3188
  </xsl:template><xsl:template name="getLang">
3026
3189
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3190
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3027
3191
  <xsl:variable name="language">
3028
3192
  <xsl:choose>
3029
3193
  <xsl:when test="$language_current != ''">
3030
3194
  <xsl:value-of select="$language_current"/>
3031
3195
  </xsl:when>
3196
+ <xsl:when test="$language_current_2 != ''">
3197
+ <xsl:value-of select="$language_current_2"/>
3198
+ </xsl:when>
3032
3199
  <xsl:otherwise>
3033
3200
  <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3034
3201
  </xsl:otherwise>
@@ -3068,13 +3235,23 @@
3068
3235
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
3069
3236
  <xsl:value-of select="substring($str, 2)"/>
3070
3237
  </xsl:template><xsl:template match="mathml:math">
3071
- <fo:inline font-family="STIX Two Math"> <!-- -->
3238
+ <xsl:variable name="isAdded" select="@added"/>
3239
+ <xsl:variable name="isDeleted" select="@deleted"/>
3240
+
3241
+ <fo:inline xsl:use-attribute-sets="mathml-style">
3242
+
3243
+
3244
+ <xsl:call-template name="setTrackChangesStyles">
3245
+ <xsl:with-param name="isAdded" select="$isAdded"/>
3246
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
3247
+ </xsl:call-template>
3072
3248
 
3073
3249
  <xsl:variable name="mathml">
3074
3250
  <xsl:apply-templates select="." mode="mathml"/>
3075
3251
  </xsl:variable>
3076
3252
  <fo:instream-foreign-object fox:alt-text="Math">
3077
3253
 
3254
+
3078
3255
  <!-- <xsl:copy-of select="."/> -->
3079
3256
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3080
3257
  </fo:instream-foreign-object>
@@ -3231,6 +3408,7 @@
3231
3408
 
3232
3409
 
3233
3410
  <fo:inline xsl:use-attribute-sets="note-name-style">
3411
+
3234
3412
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3235
3413
  </fo:inline>
3236
3414
  <xsl:apply-templates/>
@@ -3257,6 +3435,7 @@
3257
3435
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
3258
3436
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
3259
3437
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
3438
+
3260
3439
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3261
3440
  </fo:inline>
3262
3441
  <xsl:apply-templates/>
@@ -3324,8 +3503,15 @@
3324
3503
  </fo:inline>
3325
3504
  </xsl:if>
3326
3505
  </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
3506
+ <xsl:variable name="isAdded" select="@added"/>
3507
+ <xsl:variable name="isDeleted" select="@deleted"/>
3327
3508
  <fo:block-container id="{@id}">
3328
3509
 
3510
+ <xsl:call-template name="setTrackChangesStyles">
3511
+ <xsl:with-param name="isAdded" select="$isAdded"/>
3512
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
3513
+ </xsl:call-template>
3514
+
3329
3515
  <fo:block>
3330
3516
  <xsl:apply-templates/>
3331
3517
  </fo:block>
@@ -3333,7 +3519,10 @@
3333
3519
  <xsl:for-each select="*[local-name() = 'note']">
3334
3520
  <xsl:call-template name="note"/>
3335
3521
  </xsl:for-each>
3336
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3522
+
3523
+
3524
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3525
+
3337
3526
  </fo:block-container>
3338
3527
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
3339
3528
  <fo:block id="{@id}">
@@ -3345,37 +3534,122 @@
3345
3534
  <xsl:apply-templates/>
3346
3535
  </fo:block>
3347
3536
  </xsl:template><xsl:template match="*[local-name() = 'image']">
3348
- <fo:block xsl:use-attribute-sets="image-style">
3349
-
3350
-
3351
- <xsl:variable name="src">
3352
- <xsl:choose>
3353
- <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3354
- <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3355
- </xsl:when>
3356
- <xsl:otherwise>
3357
- <xsl:value-of select="@src"/>
3358
- </xsl:otherwise>
3359
- </xsl:choose>
3360
- </xsl:variable>
3361
-
3362
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3363
- </fo:block>
3537
+ <xsl:variable name="isAdded" select="../@added"/>
3538
+ <xsl:variable name="isDeleted" select="../@deleted"/>
3539
+ <xsl:choose>
3540
+ <xsl:when test="ancestor::*[local-name() = 'title']">
3541
+ <fo:inline padding-left="1mm" padding-right="1mm">
3542
+ <xsl:variable name="src">
3543
+ <xsl:call-template name="image_src"/>
3544
+ </xsl:variable>
3545
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/>
3546
+ </fo:inline>
3547
+ </xsl:when>
3548
+ <xsl:otherwise>
3549
+ <fo:block xsl:use-attribute-sets="image-style">
3550
+
3551
+ <xsl:variable name="src">
3552
+ <xsl:call-template name="image_src"/>
3553
+ </xsl:variable>
3554
+
3555
+ <xsl:choose>
3556
+ <xsl:when test="$isDeleted = 'true'">
3557
+ <!-- enclose in svg -->
3558
+ <fo:instream-foreign-object fox:alt-text="Image {@alt}">
3559
+ <xsl:attribute name="width">100%</xsl:attribute>
3560
+ <xsl:attribute name="content-height">100%</xsl:attribute>
3561
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3562
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
3563
+
3564
+
3565
+ <xsl:apply-templates select="." mode="cross_image"/>
3566
+
3567
+ </fo:instream-foreign-object>
3568
+ </xsl:when>
3569
+ <xsl:otherwise>
3570
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3571
+ </xsl:otherwise>
3572
+ </xsl:choose>
3573
+
3574
+ </fo:block>
3575
+ </xsl:otherwise>
3576
+ </xsl:choose>
3577
+ </xsl:template><xsl:template name="image_src">
3578
+ <xsl:choose>
3579
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3580
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3581
+ </xsl:when>
3582
+ <xsl:when test="not(starts-with(@src, 'data:'))">
3583
+ <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
3584
+ </xsl:when>
3585
+ <xsl:otherwise>
3586
+ <xsl:value-of select="@src"/>
3587
+ </xsl:otherwise>
3588
+ </xsl:choose>
3589
+ </xsl:template><xsl:template match="*[local-name() = 'image']" mode="cross_image">
3590
+ <xsl:choose>
3591
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3592
+ <xsl:variable name="src">
3593
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3594
+ </xsl:variable>
3595
+ <xsl:variable name="width" select="document($src)/@width"/>
3596
+ <xsl:variable name="height" select="document($src)/@height"/>
3597
+ <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
3598
+ <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
3599
+ </svg>
3600
+ </xsl:when>
3601
+ <xsl:when test="not(starts-with(@src, 'data:'))">
3602
+ <xsl:variable name="src">
3603
+ <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
3604
+ </xsl:variable>
3605
+ <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
3606
+ <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
3607
+ <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
3608
+ <xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
3609
+ <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
3610
+ <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
3611
+ </svg>
3612
+ </xsl:when>
3613
+ <xsl:otherwise>
3614
+ <xsl:variable name="base64String" select="substring-after(@src, 'base64,')"/>
3615
+ <xsl:variable name="decoder" select="java:java.util.Base64.getDecoder()"/>
3616
+ <xsl:variable name="fileContent" select="java:decode($decoder, $base64String)"/>
3617
+ <xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/>
3618
+ <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/>
3619
+ <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
3620
+ <!-- width=<xsl:value-of select="$width"/> -->
3621
+ <xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
3622
+ <!-- height=<xsl:value-of select="$height"/> -->
3623
+ <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
3624
+ <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/>
3625
+ <xsl:call-template name="svg_cross">
3626
+ <xsl:with-param name="width" select="$width"/>
3627
+ <xsl:with-param name="height" select="$height"/>
3628
+ </xsl:call-template>
3629
+ </svg>
3630
+ </xsl:otherwise>
3631
+ </xsl:choose>
3632
+
3633
+ </xsl:template><xsl:template name="svg_cross">
3634
+ <xsl:param name="width"/>
3635
+ <xsl:param name="height"/>
3636
+ <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; "/>
3637
+ <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; "/>
3364
3638
  </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">
3365
3639
  <xsl:apply-templates mode="contents"/>
3366
3640
  <xsl:text> </xsl:text>
3367
3641
  </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">
3368
3642
  <xsl:apply-templates mode="bookmarks"/>
3369
3643
  <xsl:text> </xsl:text>
3370
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
3644
+ </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">
3371
3645
  <xsl:value-of select="."/>
3372
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
3646
+ </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">
3373
3647
  <xsl:value-of select="."/>
3374
3648
  </xsl:template><xsl:template match="node()" mode="contents">
3375
3649
  <xsl:apply-templates mode="contents"/>
3376
3650
  </xsl:template><xsl:template match="node()" mode="bookmarks">
3377
3651
  <xsl:apply-templates mode="bookmarks"/>
3378
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3652
+ </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
3379
3653
  <xsl:apply-templates select="."/>
3380
3654
  </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3381
3655
  <xsl:apply-templates mode="bookmarks"/>
@@ -3574,6 +3848,8 @@
3574
3848
  </fo:list-item-body>
3575
3849
  </fo:list-item>
3576
3850
  </fo:list-block>
3851
+ </xsl:template><xsl:template name="extractSection">
3852
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3577
3853
  </xsl:template><xsl:template name="extractTitle">
3578
3854
  <xsl:choose>
3579
3855
  <xsl:when test="*[local-name() = 'tab']">
@@ -3621,6 +3897,7 @@
3621
3897
 
3622
3898
 
3623
3899
 
3900
+
3624
3901
 
3625
3902
 
3626
3903
 
@@ -3903,6 +4180,7 @@
3903
4180
  <xsl:variable name="element">
3904
4181
 
3905
4182
  inline
4183
+ <xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
3906
4184
  </xsl:variable>
3907
4185
  <xsl:choose>
3908
4186
  <xsl:when test="ancestor::*[local-name() = 'appendix']">
@@ -3910,7 +4188,7 @@
3910
4188
  <xsl:apply-templates/>
3911
4189
  </fo:inline>
3912
4190
  </xsl:when>
3913
- <xsl:when test="normalize-space($element) = 'block'">
4191
+ <xsl:when test="contains(normalize-space($element), 'block')">
3914
4192
  <fo:block xsl:use-attribute-sets="example-name-style">
3915
4193
  <xsl:apply-templates/>
3916
4194
  </fo:block>
@@ -3942,7 +4220,7 @@
3942
4220
  </fo:inline>
3943
4221
  </xsl:otherwise>
3944
4222
  </xsl:choose>
3945
- </xsl:template><xsl:template match="*[local-name() = 'termsource']">
4223
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
3946
4224
  <fo:block xsl:use-attribute-sets="termsource-style">
3947
4225
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3948
4226
  <xsl:variable name="termsource_text">
@@ -3951,13 +4229,15 @@
3951
4229
 
3952
4230
  <xsl:choose>
3953
4231
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3954
- <xsl:apply-templates/>
4232
+ <!-- <xsl:apply-templates /> -->
4233
+ <xsl:copy-of select="$termsource_text"/>
3955
4234
  </xsl:when>
3956
4235
  <xsl:otherwise>
3957
4236
 
3958
4237
  <xsl:text>[</xsl:text>
3959
4238
 
3960
- <xsl:apply-templates/>
4239
+ <!-- <xsl:apply-templates /> -->
4240
+ <xsl:copy-of select="$termsource_text"/>
3961
4241
 
3962
4242
  <xsl:text>]</xsl:text>
3963
4243
 
@@ -3968,8 +4248,15 @@
3968
4248
  <xsl:if test="normalize-space() != ''">
3969
4249
  <xsl:value-of select="."/>
3970
4250
  </xsl:if>
3971
- </xsl:template><xsl:template match="*[local-name() = 'origin']">
4251
+ </xsl:template><xsl:variable name="localized.source">
4252
+ <xsl:call-template name="getLocalizedString">
4253
+ <xsl:with-param name="key">source</xsl:with-param>
4254
+ </xsl:call-template>
4255
+ </xsl:variable><xsl:template match="*[local-name() = 'origin']">
3972
4256
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4257
+ <xsl:if test="normalize-space(@citeas) = ''">
4258
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4259
+ </xsl:if>
3973
4260
 
3974
4261
  <fo:inline xsl:use-attribute-sets="origin-style">
3975
4262
  <xsl:apply-templates/>
@@ -4119,7 +4406,8 @@
4119
4406
  </fo:inline>
4120
4407
  </xsl:when>
4121
4408
  <xsl:otherwise>
4122
- <fo:inline padding-right="{$padding-right}mm">​</fo:inline>
4409
+ <xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
4410
+ <fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/>​</fo:inline>
4123
4411
  </xsl:otherwise>
4124
4412
  </xsl:choose>
4125
4413
 
@@ -4180,7 +4468,6 @@
4180
4468
 
4181
4469
 
4182
4470
 
4183
-
4184
4471
  <xsl:apply-templates/>
4185
4472
  </fo:block>
4186
4473
 
@@ -4223,7 +4510,7 @@
4223
4510
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
4224
4511
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
4225
4512
  <xsl:choose>
4226
- <xsl:when test="parent::*[local-name() = 'note']">
4513
+ <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
4227
4514
  <fo:block-container>
4228
4515
  <xsl:attribute name="margin-left">
4229
4516
  <xsl:choose>
@@ -4233,6 +4520,7 @@
4233
4520
  </xsl:attribute>
4234
4521
 
4235
4522
 
4523
+
4236
4524
  <fo:block-container margin-left="0mm">
4237
4525
  <fo:block>
4238
4526
  <xsl:apply-templates select="." mode="ul_ol"/>
@@ -4391,8 +4679,8 @@
4391
4679
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
4392
4680
  <xsl:apply-templates/>
4393
4681
  </fo:block>
4394
- </xsl:template><xsl:template match="*[local-name() = 'bookmark']">
4395
- <fo:inline id="{@id}"/>
4682
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
4683
+ <fo:inline id="{@id}" font-size="1pt"/>
4396
4684
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
4397
4685
  <!-- <row>
4398
4686
  <date>05-07-2013</date>
@@ -4434,6 +4722,10 @@
4434
4722
 
4435
4723
 
4436
4724
 
4725
+
4726
+
4727
+
4728
+
4437
4729
  </xsl:template><xsl:template name="processBibitemDocId">
4438
4730
  <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')]"/>
4439
4731
  <xsl:choose>
@@ -4490,6 +4782,70 @@
4490
4782
  <xsl:value-of select="substring(.,1,1)"/>
4491
4783
  </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
4492
4784
  <fo:inline><xsl:apply-templates/></fo:inline>
4785
+ </xsl:template><xsl:template match="*[local-name() = 'form']">
4786
+ <fo:block>
4787
+ <xsl:apply-templates/>
4788
+ </fo:block>
4789
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
4790
+ <fo:inline><xsl:apply-templates/></fo:inline>
4791
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
4792
+ <fo:inline>
4793
+ <xsl:call-template name="text_input"/>
4794
+ </fo:inline>
4795
+ </xsl:template><xsl:template name="text_input">
4796
+ <xsl:variable name="count">
4797
+ <xsl:choose>
4798
+ <xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
4799
+ <xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
4800
+ <xsl:otherwise>10</xsl:otherwise>
4801
+ </xsl:choose>
4802
+ </xsl:variable>
4803
+ <xsl:call-template name="repeat">
4804
+ <xsl:with-param name="char" select="'_'"/>
4805
+ <xsl:with-param name="count" select="$count"/>
4806
+ </xsl:call-template>
4807
+ <xsl:text> </xsl:text>
4808
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
4809
+ <xsl:variable name="caption">
4810
+ <xsl:choose>
4811
+ <xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
4812
+ <xsl:otherwise>BUTTON</xsl:otherwise>
4813
+ </xsl:choose>
4814
+ </xsl:variable>
4815
+ <fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
4816
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
4817
+ <fo:inline padding-right="1mm">
4818
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
4819
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
4820
+ <xsl:attribute name="content-width">100%</xsl:attribute>
4821
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4822
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
4823
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
4824
+ <polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
4825
+ </svg>
4826
+ </fo:instream-foreign-object>
4827
+ </fo:inline>
4828
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
4829
+ <fo:inline padding-right="1mm">
4830
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
4831
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
4832
+ <xsl:attribute name="content-width">100%</xsl:attribute>
4833
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4834
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
4835
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
4836
+ <circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
4837
+ <circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
4838
+ </svg>
4839
+ </fo:instream-foreign-object>
4840
+ </fo:inline>
4841
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
4842
+ <fo:inline>
4843
+ <xsl:call-template name="text_input"/>
4844
+ </fo:inline>
4845
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
4846
+ <fo:block-container border="1pt solid black" width="50%">
4847
+ <fo:block> </fo:block>
4848
+ </fo:block-container>
4493
4849
  </xsl:template><xsl:template name="convertDate">
4494
4850
  <xsl:param name="date"/>
4495
4851
  <xsl:param name="format" select="'short'"/>
@@ -4761,6 +5117,7 @@
4761
5117
 
4762
5118
 
4763
5119
 
5120
+
4764
5121
  <xsl:value-of select="document('')//*/namespace::m3d"/>
4765
5122
 
4766
5123
 
@@ -4821,17 +5178,62 @@
4821
5178
  </xsl:call-template>
4822
5179
  </xsl:if>
4823
5180
  </xsl:template><xsl:template name="getLocalizedString">
4824
- <xsl:param name="key"/>
5181
+ <xsl:param name="key"/>
4825
5182
 
4826
5183
  <xsl:variable name="curr_lang">
4827
5184
  <xsl:call-template name="getLang"/>
4828
5185
  </xsl:variable>
4829
5186
 
5187
+ <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
5188
+
4830
5189
  <xsl:choose>
5190
+ <xsl:when test="$data_value != ''">
5191
+ <xsl:value-of select="$data_value"/>
5192
+ </xsl:when>
4831
5193
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
4832
5194
  <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4833
5195
  </xsl:when>
4834
5196
  <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
4835
5197
  </xsl:choose>
4836
5198
 
5199
+ </xsl:template><xsl:template name="setTrackChangesStyles">
5200
+ <xsl:param name="isAdded"/>
5201
+ <xsl:param name="isDeleted"/>
5202
+ <xsl:choose>
5203
+ <xsl:when test="local-name() = 'math'">
5204
+ <xsl:if test="$isAdded = 'true'">
5205
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
5206
+ </xsl:if>
5207
+ <xsl:if test="$isDeleted = 'true'">
5208
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
5209
+ </xsl:if>
5210
+ </xsl:when>
5211
+ <xsl:otherwise>
5212
+ <xsl:if test="$isAdded = 'true'">
5213
+ <xsl:attribute name="border"><xsl:value-of select="$border-block-added"/></xsl:attribute>
5214
+ <xsl:attribute name="padding">2mm</xsl:attribute>
5215
+ </xsl:if>
5216
+ <xsl:if test="$isDeleted = 'true'">
5217
+ <xsl:attribute name="border"><xsl:value-of select="$border-block-deleted"/></xsl:attribute>
5218
+ <xsl:if test="local-name() = 'table'">
5219
+ <xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute>
5220
+ </xsl:if>
5221
+ <!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> -->
5222
+ <xsl:attribute name="padding">2mm</xsl:attribute>
5223
+ </xsl:if>
5224
+ </xsl:otherwise>
5225
+ </xsl:choose>
5226
+ </xsl:template><xsl:variable name="LRM" select="'‎'"/><xsl:variable name="RLM" select="'‏'"/><xsl:template name="setWritingMode">
5227
+ <xsl:if test="$lang = 'ar'">
5228
+ <xsl:attribute name="writing-mode">rl-tb</xsl:attribute>
5229
+ </xsl:if>
5230
+ </xsl:template><xsl:template name="setAlignment">
5231
+ <xsl:param name="align" select="normalize-space(@align)"/>
5232
+ <xsl:choose>
5233
+ <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
5234
+ <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
5235
+ <xsl:when test="$align != ''">
5236
+ <xsl:value-of select="$align"/>
5237
+ </xsl:when>
5238
+ </xsl:choose>
4837
5239
  </xsl:template></xsl:stylesheet>