metanorma-ribose 1.6.15 → 1.7.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -74,7 +74,7 @@ mso-line-height-rule:exactly'><span lang=EN-GB>RR&nbsp;{{ docnumber }}:{{ docyea
74
74
 
75
75
  <p class=MsoHeader style='margin-bottom:18.0pt'><span lang=EN-GB
76
76
  style='font-size:10.0pt;mso-bidi-font-size:11.0pt;font-weight:normal'>©
77
- Ribose Asia Limited&nbsp;{{ docyear }}&nbsp;– All rights reserved</span><span lang=EN-GB
77
+ {{ publisher }}&nbsp;{{ docyear }}&nbsp;– All rights reserved</span><span lang=EN-GB
78
78
  style='font-weight:normal'><o:p></o:p></span></p>
79
79
 
80
80
  </div>
@@ -93,7 +93,7 @@ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
93
93
  mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
94
94
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
95
95
  style='mso-tab-count:1'>                                                                                                                                                                           </span>©
96
- Ribose Asia Limited&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
96
+ {{ Publisher }}&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
97
97
 
98
98
  </div>
99
99
 
@@ -129,7 +129,7 @@ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
129
129
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
130
130
  style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span style='mso-tab-count:
131
131
  1'>                                                                                                                                                                           </span>©
132
- Ribose Asia Limited&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
132
+ {{ Publisher }}&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
133
133
  </div>
134
134
 
135
135
  <div style='mso-element:footer' id=ef2l>
@@ -144,12 +144,12 @@ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
144
144
  style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
145
145
  style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span style='mso-tab-count:
146
146
  1'>                                                                                                                                                                           </span>©
147
- Ribose Asia Limited&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
147
+ {{ Publisher }}&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
148
148
  </div>
149
149
 
150
150
  <div style='mso-element:footer' id=f2>
151
151
  <p class=MsoFooter style='line-height:12.0pt'><span lang=EN-GB
152
- style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© Ribose Asia Limited&nbsp;{{ docyear }}&nbsp;– All
152
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ Publisher }}&nbsp;{{ docyear }}&nbsp;– All
153
153
  rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                          </span></span><!--[if supportFields]><span
154
154
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
155
155
  style='mso-element:field-begin'></span> PAGE<span style='mso-spacerun:yes'>  
@@ -163,7 +163,7 @@ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span></p>
163
163
 
164
164
  <div style='mso-element:footer' id=f2l>
165
165
  <p class=MsoFooterLandscape style='line-height:12.0pt'><span lang=EN-GB
166
- style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© Ribose Asia Limited&nbsp;{{ docyear }}&nbsp;– All
166
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ Publisher }}&nbsp;{{ docyear }}&nbsp;– All
167
167
  rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                          </span></span><!--[if supportFields]><span
168
168
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
169
169
  style='mso-element:field-begin'></span> PAGE<span style='mso-spacerun:yes'>  
@@ -188,7 +188,7 @@ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
188
188
  mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
189
189
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
190
190
  style='mso-tab-count:1'>                                                                                                                                                                           </span>©
191
- Ribose Asia Limited&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
191
+ {{ Publisher }}&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
192
192
  </div>
193
193
 
194
194
  <div style='mso-element:footer' id=ef3l>
@@ -204,12 +204,12 @@ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
204
204
  mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
205
205
  lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
206
206
  style='mso-tab-count:1'>                                                                                                                                                                           </span>©
207
- Ribose Asia Limited&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
207
+ {{ Publisher }}&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
208
208
  </div>
209
209
 
210
210
  <div style='mso-element:footer' id=f3>
211
211
  <p class=MsoFooter style='line-height:12.0pt'><span lang=EN-GB
212
- style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© Ribose Asia Limited&nbsp;{{ docyear }}&nbsp;– All
212
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ Publisher }}&nbsp;{{ docyear }}&nbsp;– All
213
213
  rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                           </span></span><!--[if supportFields]><b
214
214
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
215
215
  mso-bidi-font-size:11.0pt'><span style='mso-element:field-begin'></span>
@@ -224,7 +224,7 @@ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span>
224
224
 
225
225
  <div style='mso-element:footer' id=f3l>
226
226
  <p class=MsoFooterLandscape style='line-height:12.0pt'><span lang=EN-GB
227
- style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© Ribose Asia Limited&nbsp;{{ docyear }}&nbsp;– All
227
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ Publisher }}&nbsp;{{ docyear }}&nbsp;– All
228
228
  rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                           </span></span><!--[if supportFields]><b
229
229
  style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
230
230
  mso-bidi-font-size:11.0pt'><span style='mso-element:field-begin'></span>
@@ -76,16 +76,16 @@
76
76
  <div id="boilerplate-copyright-destination"/>
77
77
  </div>
78
78
 
79
- <div class="message">
80
- <div id="boilerplate-legal-destination"/>
81
- </div>
82
-
83
79
  <div class="contact-info">
84
80
  <div id="boilerplate-feedback-destination"/>
85
- </div>
86
81
  </div>
87
82
 
88
- <div class="rule"></div>
83
+ <div class="message">
84
+ <div id="boilerplate-legal-destination"/>
85
+ </div>
86
+ </div>
87
+
88
+ <div class="rule"></div>
89
89
  </div>
90
90
  </div>
91
91
 
@@ -115,6 +115,13 @@ a.FootnoteRef + a.FootnoteRef:before {
115
115
  content: ", ";
116
116
  vertical-align: super; }
117
117
 
118
+ .addition {
119
+ color: blue; }
120
+
121
+ .deletion {
122
+ color: red;
123
+ text-decoration: line-through; }
124
+
118
125
  #standard-band {
119
126
  background-color: #0AC442; }
120
127
 
@@ -3,6 +3,6 @@
3
3
  WORDTOC
4
4
 
5
5
  <div class="zzCopyright">
6
- <div id="boilerplate-feedback-destination" style='color:windowtext'/>
7
6
  <div id="boilerplate-copyright-destination" style='color:windowtext'/>
7
+ <div id="boilerplate-feedback-destination" style='color:windowtext'/>
8
8
  </div>
@@ -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
  <xsl:variable name="pageWidth" select="'210mm'"/>
10
11
  <xsl:variable name="pageHeight" select="'297mm'"/>
@@ -213,6 +214,8 @@
213
214
 
214
215
  <xsl:apply-templates select="/rsd:rsd-standard/rsd:boilerplate/rsd:legal-statement"/>
215
216
 
217
+ <xsl:apply-templates select="/rsd:rsd-standard/rsd:boilerplate/rsd:feedback-statement"/>
218
+
216
219
  </fo:flow>
217
220
  </fo:page-sequence>
218
221
 
@@ -346,9 +349,11 @@
346
349
  </xsl:template>
347
350
 
348
351
  <xsl:template match="rsd:feedback-statement">
349
- <fo:block margin-top="12pt" margin-bottom="12pt">
350
- <xsl:apply-templates select="rsd:clause[1]"/>
351
- </fo:block>
352
+ <fo:block-container border="1pt solid black" padding="1mm" padding-left="2mm">
353
+ <fo:block>
354
+ <xsl:apply-templates/>
355
+ </fo:block>
356
+ </fo:block-container>
352
357
  </xsl:template>
353
358
 
354
359
  <xsl:template match="rsd:copyright-statement//rsd:title">
@@ -477,6 +482,7 @@
477
482
  <xsl:attribute name="space-after">
478
483
  <xsl:choose>
479
484
  <xsl:when test="ancestor::rsd:li">0pt</xsl:when>
485
+ <xsl:when test="ancestor::rsd:feedback-statement and not(following-sibling::rsd:p)">0pt</xsl:when>
480
486
  <xsl:otherwise>12pt</xsl:otherwise>
481
487
  </xsl:choose>
482
488
  </xsl:attribute>
@@ -1028,6 +1034,9 @@
1028
1034
  <title-continued lang="en">(continued)</title-continued>
1029
1035
  <title-continued lang="fr">(continué)</title-continued>
1030
1036
 
1037
+ </xsl:variable><xsl:variable name="bibdata">
1038
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
1039
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
1031
1040
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1032
1041
  <xsl:param name="name"/>
1033
1042
  <xsl:param name="lang"/>
@@ -1053,8 +1062,10 @@
1053
1062
  </xsl:choose>
1054
1063
  </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">
1055
1064
 
1065
+
1056
1066
  </xsl:attribute-set><xsl:attribute-set name="link-style">
1057
1067
 
1068
+
1058
1069
  <xsl:attribute name="color">blue</xsl:attribute>
1059
1070
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1060
1071
 
@@ -1182,6 +1193,7 @@
1182
1193
 
1183
1194
  </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1184
1195
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1196
+
1185
1197
 
1186
1198
 
1187
1199
 
@@ -1214,6 +1226,7 @@
1214
1226
  </xsl:attribute-set><xsl:attribute-set name="xref-style">
1215
1227
 
1216
1228
 
1229
+
1217
1230
  <xsl:attribute name="color">blue</xsl:attribute>
1218
1231
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1219
1232
 
@@ -1230,6 +1243,7 @@
1230
1243
 
1231
1244
 
1232
1245
 
1246
+
1233
1247
 
1234
1248
 
1235
1249
 
@@ -1257,6 +1271,7 @@
1257
1271
 
1258
1272
 
1259
1273
 
1274
+
1260
1275
  <xsl:attribute name="padding-right">4mm</xsl:attribute>
1261
1276
 
1262
1277
 
@@ -1280,6 +1295,7 @@
1280
1295
 
1281
1296
  </xsl:attribute-set><xsl:attribute-set name="termnote-style">
1282
1297
 
1298
+
1283
1299
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1284
1300
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1285
1301
 
@@ -1288,6 +1304,7 @@
1288
1304
 
1289
1305
 
1290
1306
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1307
+
1291
1308
 
1292
1309
 
1293
1310
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
@@ -1311,6 +1328,7 @@
1311
1328
 
1312
1329
  </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1313
1330
 
1331
+
1314
1332
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1315
1333
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1316
1334
 
@@ -1329,6 +1347,7 @@
1329
1347
 
1330
1348
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1331
1349
 
1350
+
1332
1351
 
1333
1352
 
1334
1353
 
@@ -1362,10 +1381,12 @@
1362
1381
 
1363
1382
 
1364
1383
 
1384
+
1365
1385
  </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1366
1386
 
1367
1387
  </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1368
1388
 
1389
+
1369
1390
  <xsl:attribute name="width">100%</xsl:attribute>
1370
1391
  <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
1371
1392
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -1394,7 +1415,7 @@
1394
1415
 
1395
1416
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1396
1417
 
1397
-
1418
+
1398
1419
  </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1399
1420
 
1400
1421
  </xsl:attribute-set><xsl:attribute-set name="definition-style">
@@ -1402,7 +1423,26 @@
1402
1423
  <xsl:attribute name="space-after">6pt</xsl:attribute>
1403
1424
 
1404
1425
 
1405
- </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
1426
+
1427
+ </xsl:attribute-set><xsl:variable name="color-added-text">
1428
+ <xsl:text>rgb(0, 255, 0)</xsl:text>
1429
+ </xsl:variable><xsl:attribute-set name="add-style">
1430
+ <xsl:attribute name="color">red</xsl:attribute>
1431
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1432
+ <!-- <xsl:attribute name="color">black</xsl:attribute>
1433
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
1434
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
1435
+ <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
1436
+ </xsl:attribute-set><xsl:variable name="color-deleted-text">
1437
+ <xsl:text>red</xsl:text>
1438
+ </xsl:variable><xsl:attribute-set name="del-style">
1439
+ <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
1440
+ <xsl:attribute name="text-decoration">line-through</xsl:attribute>
1441
+ </xsl:attribute-set><xsl:attribute-set name="mathml-style">
1442
+ <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
1443
+
1444
+
1445
+ </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">
1406
1446
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1407
1447
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1408
1448
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
@@ -1447,16 +1487,17 @@
1447
1487
  <xsl:call-template name="add-zero-spaces-java"/>
1448
1488
  </xsl:template><xsl:template match="*[local-name()='table']" name="table">
1449
1489
 
1490
+ <xsl:variable name="table-preamble">
1491
+
1492
+
1493
+ </xsl:variable>
1494
+
1450
1495
  <xsl:variable name="table">
1451
1496
 
1452
1497
  <xsl:variable name="simple-table">
1453
1498
  <xsl:call-template name="getSimpleTable"/>
1454
1499
  </xsl:variable>
1455
1500
 
1456
-
1457
-
1458
-
1459
-
1460
1501
  <!-- <xsl:if test="$namespace = 'bipm'">
1461
1502
  <fo:block>&#xA0;</fo:block>
1462
1503
  </xsl:if> -->
@@ -1469,7 +1510,7 @@
1469
1510
 
1470
1511
 
1471
1512
 
1472
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1513
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
1473
1514
 
1474
1515
  <!-- <xsl:variable name="cols-count">
1475
1516
  <xsl:choose>
@@ -1488,8 +1529,6 @@
1488
1529
  <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1489
1530
  <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1490
1531
 
1491
-
1492
-
1493
1532
  <xsl:variable name="colwidths">
1494
1533
  <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1495
1534
  <xsl:call-template name="calculate-column-widths">
@@ -1517,9 +1556,11 @@
1517
1556
  </xsl:choose>
1518
1557
  </xsl:variable>
1519
1558
 
1559
+
1520
1560
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1521
1561
 
1522
1562
 
1563
+
1523
1564
 
1524
1565
 
1525
1566
 
@@ -1532,6 +1573,8 @@
1532
1573
 
1533
1574
 
1534
1575
 
1576
+
1577
+
1535
1578
  <xsl:variable name="table_width">
1536
1579
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1537
1580
  100%
@@ -1548,6 +1591,8 @@
1548
1591
 
1549
1592
 
1550
1593
 
1594
+
1595
+
1551
1596
 
1552
1597
 
1553
1598
 
@@ -1637,7 +1682,8 @@
1637
1682
  </fo:block-container>
1638
1683
  </xsl:variable>
1639
1684
 
1640
-
1685
+ <xsl:variable name="isAdded" select="@added"/>
1686
+ <xsl:variable name="isDeleted" select="@deleted"/>
1641
1687
 
1642
1688
  <xsl:choose>
1643
1689
  <xsl:when test="@width">
@@ -1651,7 +1697,14 @@
1651
1697
  <fo:table-body>
1652
1698
  <fo:table-row>
1653
1699
  <fo:table-cell column-number="2">
1654
- <fo:block><xsl:copy-of select="$table"/></fo:block>
1700
+ <xsl:copy-of select="$table-preamble"/>
1701
+ <fo:block>
1702
+ <xsl:call-template name="setTrackChangesStyles">
1703
+ <xsl:with-param name="isAdded" select="$isAdded"/>
1704
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
1705
+ </xsl:call-template>
1706
+ <xsl:copy-of select="$table"/>
1707
+ </fo:block>
1655
1708
  </fo:table-cell>
1656
1709
  </fo:table-row>
1657
1710
  </fo:table-body>
@@ -1662,16 +1715,42 @@
1662
1715
 
1663
1716
  </xsl:when>
1664
1717
  <xsl:otherwise>
1665
- <xsl:copy-of select="$table"/>
1718
+ <xsl:choose>
1719
+ <xsl:when test="$isAdded = 'true' or $isDeleted = 'true'">
1720
+ <xsl:copy-of select="$table-preamble"/>
1721
+ <fo:block>
1722
+ <xsl:call-template name="setTrackChangesStyles">
1723
+ <xsl:with-param name="isAdded" select="$isAdded"/>
1724
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
1725
+ </xsl:call-template>
1726
+ <xsl:copy-of select="$table"/>
1727
+ </fo:block>
1728
+ </xsl:when>
1729
+ <xsl:otherwise>
1730
+ <xsl:copy-of select="$table-preamble"/>
1731
+ <xsl:copy-of select="$table"/>
1732
+ </xsl:otherwise>
1733
+ </xsl:choose>
1666
1734
  </xsl:otherwise>
1667
1735
  </xsl:choose>
1668
1736
 
1669
1737
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1738
+ <xsl:param name="continued"/>
1670
1739
  <xsl:if test="normalize-space() != ''">
1671
1740
  <fo:block xsl:use-attribute-sets="table-name-style">
1672
1741
 
1673
1742
 
1674
- <xsl:apply-templates/>
1743
+ <xsl:choose>
1744
+ <xsl:when test="$continued = 'true'">
1745
+ <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
1746
+
1747
+ </xsl:when>
1748
+ <xsl:otherwise>
1749
+ <xsl:apply-templates/>
1750
+ </xsl:otherwise>
1751
+ </xsl:choose>
1752
+
1753
+
1675
1754
  </fo:block>
1676
1755
  </xsl:if>
1677
1756
  </xsl:template><xsl:template name="calculate-columns-numbers">
@@ -1723,7 +1802,7 @@
1723
1802
  </xsl:for-each>
1724
1803
  </xsl:when>
1725
1804
  <xsl:otherwise>
1726
- <xsl:for-each select="xalan:nodeset($table)//tr">
1805
+ <xsl:for-each select="xalan:nodeset($table)/*/tr">
1727
1806
  <xsl:variable name="td_text">
1728
1807
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1729
1808
 
@@ -1811,18 +1890,18 @@
1811
1890
  <xsl:apply-templates/>
1812
1891
  </fo:table-header>
1813
1892
  </xsl:template><xsl:template name="table-header-title">
1814
- <xsl:param name="cols-count"/>
1893
+ <xsl:param name="cols-count"/>
1815
1894
  <!-- row for title -->
1816
1895
  <fo:table-row>
1817
1896
  <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">
1818
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1897
+
1898
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
1899
+ <xsl:with-param name="continued">true</xsl:with-param>
1900
+ </xsl:apply-templates>
1819
1901
  <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1820
1902
  <xsl:call-template name="fn_name_display"/>
1821
- </xsl:for-each>
1822
- <fo:block text-align="right" font-style="italic">
1823
- <xsl:text> </xsl:text>
1824
- <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1825
- </fo:block>
1903
+ </xsl:for-each>
1904
+
1826
1905
  </fo:table-cell>
1827
1906
  </fo:table-row>
1828
1907
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -2043,6 +2122,7 @@
2043
2122
 
2044
2123
 
2045
2124
 
2125
+
2046
2126
  </xsl:if>
2047
2127
  <xsl:if test="$parent-name = 'tfoot'">
2048
2128
 
@@ -2063,7 +2143,8 @@
2063
2143
  <xsl:attribute name="text-align">
2064
2144
  <xsl:choose>
2065
2145
  <xsl:when test="@align">
2066
- <xsl:value-of select="@align"/>
2146
+ <xsl:call-template name="setAlignment"/>
2147
+ <!-- <xsl:value-of select="@align"/> -->
2067
2148
  </xsl:when>
2068
2149
  <xsl:otherwise>center</xsl:otherwise>
2069
2150
  </xsl:choose>
@@ -2079,6 +2160,10 @@
2079
2160
 
2080
2161
 
2081
2162
 
2163
+
2164
+ <xsl:if test="$lang = 'ar'">
2165
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2166
+ </xsl:if>
2082
2167
  <xsl:if test="@colspan">
2083
2168
  <xsl:attribute name="number-columns-spanned">
2084
2169
  <xsl:value-of select="@colspan"/>
@@ -2110,11 +2195,16 @@
2110
2195
  <xsl:attribute name="text-align">
2111
2196
  <xsl:choose>
2112
2197
  <xsl:when test="@align">
2113
- <xsl:value-of select="@align"/>
2198
+ <xsl:call-template name="setAlignment"/>
2199
+ <!-- <xsl:value-of select="@align"/> -->
2114
2200
  </xsl:when>
2115
2201
  <xsl:otherwise>left</xsl:otherwise>
2116
2202
  </xsl:choose>
2117
2203
  </xsl:attribute>
2204
+ <xsl:if test="$lang = 'ar'">
2205
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2206
+ </xsl:if>
2207
+
2118
2208
 
2119
2209
 
2120
2210
 
@@ -2126,6 +2216,9 @@
2126
2216
 
2127
2217
 
2128
2218
 
2219
+ <xsl:if test=".//*[local-name() = 'table']">
2220
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2221
+ </xsl:if>
2129
2222
  <xsl:if test="@colspan">
2130
2223
  <xsl:attribute name="number-columns-spanned">
2131
2224
  <xsl:value-of select="@colspan"/>
@@ -2251,13 +2344,13 @@
2251
2344
  </xsl:choose>
2252
2345
  </xsl:variable>
2253
2346
  <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2254
- <xsl:element name="{$ns}:table">
2347
+ <!-- <xsl:element name="{$ns}:table"> -->
2255
2348
  <xsl:for-each select="*[local-name() = 'dl'][1]">
2256
2349
  <tbody>
2257
2350
  <xsl:apply-templates mode="dl"/>
2258
2351
  </tbody>
2259
2352
  </xsl:for-each>
2260
- </xsl:element>
2353
+ <!-- </xsl:element> -->
2261
2354
  </xsl:variable>
2262
2355
 
2263
2356
  <xsl:call-template name="calculate-column-widths">
@@ -2348,6 +2441,8 @@
2348
2441
  <xsl:apply-templates/>
2349
2442
  </fo:inline>
2350
2443
  </xsl:template><xsl:template match="*[local-name()='dl']">
2444
+ <xsl:variable name="isAdded" select="@added"/>
2445
+ <xsl:variable name="isDeleted" select="@deleted"/>
2351
2446
  <fo:block-container>
2352
2447
 
2353
2448
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -2364,6 +2459,12 @@
2364
2459
  </xsl:attribute>
2365
2460
 
2366
2461
  </xsl:if>
2462
+
2463
+ <xsl:call-template name="setTrackChangesStyles">
2464
+ <xsl:with-param name="isAdded" select="$isAdded"/>
2465
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
2466
+ </xsl:call-template>
2467
+
2367
2468
  <fo:block-container>
2368
2469
 
2369
2470
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -2471,11 +2572,11 @@
2471
2572
  </xsl:choose>
2472
2573
  </xsl:variable>
2473
2574
  <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2474
- <xsl:element name="{$ns}:table">
2575
+ <!-- <xsl:element name="{$ns}:table"> -->
2475
2576
  <tbody>
2476
2577
  <xsl:apply-templates mode="dl"/>
2477
2578
  </tbody>
2478
- </xsl:element>
2579
+ <!-- </xsl:element> -->
2479
2580
  </xsl:variable>
2480
2581
  <!-- html-table<xsl:copy-of select="$html-table"/> -->
2481
2582
  <xsl:variable name="colwidths">
@@ -2726,6 +2827,7 @@
2726
2827
 
2727
2828
 
2728
2829
 
2830
+
2729
2831
  10
2730
2832
 
2731
2833
  </xsl:variable>
@@ -2744,8 +2846,74 @@
2744
2846
  <fo:inline text-decoration="underline">
2745
2847
  <xsl:apply-templates/>
2746
2848
  </fo:inline>
2849
+ </xsl:template><xsl:template match="*[local-name()='add']">
2850
+ <xsl:choose>
2851
+ <xsl:when test="@amendment">
2852
+ <fo:inline>
2853
+ <xsl:call-template name="insertTag">
2854
+ <xsl:with-param name="kind">A</xsl:with-param>
2855
+ <xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
2856
+ </xsl:call-template>
2857
+ <xsl:apply-templates/>
2858
+ <xsl:call-template name="insertTag">
2859
+ <xsl:with-param name="type">closing</xsl:with-param>
2860
+ <xsl:with-param name="kind">A</xsl:with-param>
2861
+ <xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
2862
+ </xsl:call-template>
2863
+ </fo:inline>
2864
+ </xsl:when>
2865
+ <xsl:when test="@corrigenda">
2866
+ <fo:inline>
2867
+ <xsl:call-template name="insertTag">
2868
+ <xsl:with-param name="kind">C</xsl:with-param>
2869
+ <xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
2870
+ </xsl:call-template>
2871
+ <xsl:apply-templates/>
2872
+ <xsl:call-template name="insertTag">
2873
+ <xsl:with-param name="type">closing</xsl:with-param>
2874
+ <xsl:with-param name="kind">C</xsl:with-param>
2875
+ <xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
2876
+ </xsl:call-template>
2877
+ </fo:inline>
2878
+ </xsl:when>
2879
+ <xsl:otherwise>
2880
+ <fo:inline xsl:use-attribute-sets="add-style">
2881
+ <xsl:apply-templates/>
2882
+ </fo:inline>
2883
+ </xsl:otherwise>
2884
+ </xsl:choose>
2885
+
2886
+ </xsl:template><xsl:template name="insertTag">
2887
+ <xsl:param name="type"/>
2888
+ <xsl:param name="kind"/>
2889
+ <xsl:param name="value"/>
2890
+ <xsl:variable name="add_width" select="string-length($value) * 20"/>
2891
+ <xsl:variable name="maxwidth" select="60 + $add_width"/>
2892
+ <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
2893
+ <!-- <xsl:attribute name="width">7mm</xsl:attribute>
2894
+ <xsl:attribute name="content-height">100%</xsl:attribute> -->
2895
+ <xsl:attribute name="height">5mm</xsl:attribute>
2896
+ <xsl:attribute name="content-width">100%</xsl:attribute>
2897
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
2898
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
2899
+ <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
2900
+ <g>
2901
+ <xsl:if test="$type = 'closing'">
2902
+ <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
2903
+ </xsl:if>
2904
+ <polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
2905
+ <line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
2906
+ </g>
2907
+ <text font-family="Arial" x="15" y="57" font-size="40pt">
2908
+ <xsl:if test="$type = 'closing'">
2909
+ <xsl:attribute name="x">25</xsl:attribute>
2910
+ </xsl:if>
2911
+ <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
2912
+ </text>
2913
+ </svg>
2914
+ </fo:instream-foreign-object>
2747
2915
  </xsl:template><xsl:template match="*[local-name()='del']">
2748
- <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2916
+ <fo:inline xsl:use-attribute-sets="del-style">
2749
2917
  <xsl:apply-templates/>
2750
2918
  </fo:inline>
2751
2919
  </xsl:template><xsl:template match="*[local-name()='hi']">
@@ -3042,11 +3210,15 @@
3042
3210
  </xsl:apply-templates>
3043
3211
  </xsl:template><xsl:template name="getLang">
3044
3212
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3213
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3045
3214
  <xsl:variable name="language">
3046
3215
  <xsl:choose>
3047
3216
  <xsl:when test="$language_current != ''">
3048
3217
  <xsl:value-of select="$language_current"/>
3049
3218
  </xsl:when>
3219
+ <xsl:when test="$language_current_2 != ''">
3220
+ <xsl:value-of select="$language_current_2"/>
3221
+ </xsl:when>
3050
3222
  <xsl:otherwise>
3051
3223
  <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3052
3224
  </xsl:otherwise>
@@ -3086,13 +3258,23 @@
3086
3258
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
3087
3259
  <xsl:value-of select="substring($str, 2)"/>
3088
3260
  </xsl:template><xsl:template match="mathml:math">
3089
- <fo:inline font-family="STIX Two Math"> <!-- -->
3261
+ <xsl:variable name="isAdded" select="@added"/>
3262
+ <xsl:variable name="isDeleted" select="@deleted"/>
3263
+
3264
+ <fo:inline xsl:use-attribute-sets="mathml-style">
3265
+
3266
+
3267
+ <xsl:call-template name="setTrackChangesStyles">
3268
+ <xsl:with-param name="isAdded" select="$isAdded"/>
3269
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
3270
+ </xsl:call-template>
3090
3271
 
3091
3272
  <xsl:variable name="mathml">
3092
3273
  <xsl:apply-templates select="." mode="mathml"/>
3093
3274
  </xsl:variable>
3094
3275
  <fo:instream-foreign-object fox:alt-text="Math">
3095
3276
 
3277
+
3096
3278
  <!-- <xsl:copy-of select="."/> -->
3097
3279
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3098
3280
  </fo:instream-foreign-object>
@@ -3253,6 +3435,7 @@
3253
3435
 
3254
3436
 
3255
3437
  <fo:inline xsl:use-attribute-sets="note-name-style">
3438
+
3256
3439
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3257
3440
  </fo:inline>
3258
3441
  <xsl:apply-templates/>
@@ -3279,6 +3462,7 @@
3279
3462
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
3280
3463
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
3281
3464
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
3465
+
3282
3466
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3283
3467
  </fo:inline>
3284
3468
  <xsl:apply-templates/>
@@ -3344,8 +3528,15 @@
3344
3528
  </fo:inline>
3345
3529
  </xsl:if>
3346
3530
  </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
3531
+ <xsl:variable name="isAdded" select="@added"/>
3532
+ <xsl:variable name="isDeleted" select="@deleted"/>
3347
3533
  <fo:block-container id="{@id}">
3348
3534
 
3535
+ <xsl:call-template name="setTrackChangesStyles">
3536
+ <xsl:with-param name="isAdded" select="$isAdded"/>
3537
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
3538
+ </xsl:call-template>
3539
+
3349
3540
  <fo:block>
3350
3541
  <xsl:apply-templates/>
3351
3542
  </fo:block>
@@ -3353,7 +3544,10 @@
3353
3544
  <xsl:for-each select="*[local-name() = 'note']">
3354
3545
  <xsl:call-template name="note"/>
3355
3546
  </xsl:for-each>
3356
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3547
+
3548
+
3549
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3550
+
3357
3551
  </fo:block-container>
3358
3552
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
3359
3553
  <fo:block id="{@id}">
@@ -3365,37 +3559,122 @@
3365
3559
  <xsl:apply-templates/>
3366
3560
  </fo:block>
3367
3561
  </xsl:template><xsl:template match="*[local-name() = 'image']">
3368
- <fo:block xsl:use-attribute-sets="image-style">
3369
-
3370
-
3371
- <xsl:variable name="src">
3372
- <xsl:choose>
3373
- <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3374
- <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3375
- </xsl:when>
3376
- <xsl:otherwise>
3377
- <xsl:value-of select="@src"/>
3378
- </xsl:otherwise>
3379
- </xsl:choose>
3380
- </xsl:variable>
3381
-
3382
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3383
- </fo:block>
3562
+ <xsl:variable name="isAdded" select="../@added"/>
3563
+ <xsl:variable name="isDeleted" select="../@deleted"/>
3564
+ <xsl:choose>
3565
+ <xsl:when test="ancestor::*[local-name() = 'title']">
3566
+ <fo:inline padding-left="1mm" padding-right="1mm">
3567
+ <xsl:variable name="src">
3568
+ <xsl:call-template name="image_src"/>
3569
+ </xsl:variable>
3570
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/>
3571
+ </fo:inline>
3572
+ </xsl:when>
3573
+ <xsl:otherwise>
3574
+ <fo:block xsl:use-attribute-sets="image-style">
3575
+
3576
+ <xsl:variable name="src">
3577
+ <xsl:call-template name="image_src"/>
3578
+ </xsl:variable>
3579
+
3580
+ <xsl:choose>
3581
+ <xsl:when test="$isDeleted = 'true'">
3582
+ <!-- enclose in svg -->
3583
+ <fo:instream-foreign-object fox:alt-text="Image {@alt}">
3584
+ <xsl:attribute name="width">100%</xsl:attribute>
3585
+ <xsl:attribute name="content-height">100%</xsl:attribute>
3586
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3587
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
3588
+
3589
+
3590
+ <xsl:apply-templates select="." mode="cross_image"/>
3591
+
3592
+ </fo:instream-foreign-object>
3593
+ </xsl:when>
3594
+ <xsl:otherwise>
3595
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3596
+ </xsl:otherwise>
3597
+ </xsl:choose>
3598
+
3599
+ </fo:block>
3600
+ </xsl:otherwise>
3601
+ </xsl:choose>
3602
+ </xsl:template><xsl:template name="image_src">
3603
+ <xsl:choose>
3604
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3605
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3606
+ </xsl:when>
3607
+ <xsl:when test="not(starts-with(@src, 'data:'))">
3608
+ <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
3609
+ </xsl:when>
3610
+ <xsl:otherwise>
3611
+ <xsl:value-of select="@src"/>
3612
+ </xsl:otherwise>
3613
+ </xsl:choose>
3614
+ </xsl:template><xsl:template match="*[local-name() = 'image']" mode="cross_image">
3615
+ <xsl:choose>
3616
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3617
+ <xsl:variable name="src">
3618
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3619
+ </xsl:variable>
3620
+ <xsl:variable name="width" select="document($src)/@width"/>
3621
+ <xsl:variable name="height" select="document($src)/@height"/>
3622
+ <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">
3623
+ <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
3624
+ </svg>
3625
+ </xsl:when>
3626
+ <xsl:when test="not(starts-with(@src, 'data:'))">
3627
+ <xsl:variable name="src">
3628
+ <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
3629
+ </xsl:variable>
3630
+ <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
3631
+ <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
3632
+ <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
3633
+ <xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
3634
+ <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">
3635
+ <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
3636
+ </svg>
3637
+ </xsl:when>
3638
+ <xsl:otherwise>
3639
+ <xsl:variable name="base64String" select="substring-after(@src, 'base64,')"/>
3640
+ <xsl:variable name="decoder" select="java:java.util.Base64.getDecoder()"/>
3641
+ <xsl:variable name="fileContent" select="java:decode($decoder, $base64String)"/>
3642
+ <xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/>
3643
+ <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/>
3644
+ <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
3645
+ <!-- width=<xsl:value-of select="$width"/> -->
3646
+ <xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
3647
+ <!-- height=<xsl:value-of select="$height"/> -->
3648
+ <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">
3649
+ <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/>
3650
+ <xsl:call-template name="svg_cross">
3651
+ <xsl:with-param name="width" select="$width"/>
3652
+ <xsl:with-param name="height" select="$height"/>
3653
+ </xsl:call-template>
3654
+ </svg>
3655
+ </xsl:otherwise>
3656
+ </xsl:choose>
3657
+
3658
+ </xsl:template><xsl:template name="svg_cross">
3659
+ <xsl:param name="width"/>
3660
+ <xsl:param name="height"/>
3661
+ <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; "/>
3662
+ <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; "/>
3384
3663
  </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">
3385
3664
  <xsl:apply-templates mode="contents"/>
3386
3665
  <xsl:text> </xsl:text>
3387
3666
  </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">
3388
3667
  <xsl:apply-templates mode="bookmarks"/>
3389
3668
  <xsl:text> </xsl:text>
3390
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
3669
+ </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">
3391
3670
  <xsl:value-of select="."/>
3392
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
3671
+ </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">
3393
3672
  <xsl:value-of select="."/>
3394
3673
  </xsl:template><xsl:template match="node()" mode="contents">
3395
3674
  <xsl:apply-templates mode="contents"/>
3396
3675
  </xsl:template><xsl:template match="node()" mode="bookmarks">
3397
3676
  <xsl:apply-templates mode="bookmarks"/>
3398
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3677
+ </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
3399
3678
  <xsl:apply-templates select="."/>
3400
3679
  </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3401
3680
  <xsl:apply-templates mode="bookmarks"/>
@@ -3594,6 +3873,8 @@
3594
3873
  </fo:list-item-body>
3595
3874
  </fo:list-item>
3596
3875
  </fo:list-block>
3876
+ </xsl:template><xsl:template name="extractSection">
3877
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3597
3878
  </xsl:template><xsl:template name="extractTitle">
3598
3879
  <xsl:choose>
3599
3880
  <xsl:when test="*[local-name() = 'tab']">
@@ -3641,6 +3922,7 @@
3641
3922
 
3642
3923
 
3643
3924
 
3925
+
3644
3926
 
3645
3927
 
3646
3928
 
@@ -3923,6 +4205,7 @@
3923
4205
  <xsl:variable name="element">
3924
4206
  block
3925
4207
 
4208
+ <xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
3926
4209
  </xsl:variable>
3927
4210
  <xsl:choose>
3928
4211
  <xsl:when test="ancestor::*[local-name() = 'appendix']">
@@ -3930,7 +4213,7 @@
3930
4213
  <xsl:apply-templates/>
3931
4214
  </fo:inline>
3932
4215
  </xsl:when>
3933
- <xsl:when test="normalize-space($element) = 'block'">
4216
+ <xsl:when test="contains(normalize-space($element), 'block')">
3934
4217
  <fo:block xsl:use-attribute-sets="example-name-style">
3935
4218
  <xsl:apply-templates/>
3936
4219
  </fo:block>
@@ -3962,7 +4245,7 @@
3962
4245
  </fo:inline>
3963
4246
  </xsl:otherwise>
3964
4247
  </xsl:choose>
3965
- </xsl:template><xsl:template match="*[local-name() = 'termsource']">
4248
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
3966
4249
  <fo:block xsl:use-attribute-sets="termsource-style">
3967
4250
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3968
4251
  <xsl:variable name="termsource_text">
@@ -3971,13 +4254,15 @@
3971
4254
 
3972
4255
  <xsl:choose>
3973
4256
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3974
- <xsl:apply-templates/>
4257
+ <!-- <xsl:apply-templates /> -->
4258
+ <xsl:copy-of select="$termsource_text"/>
3975
4259
  </xsl:when>
3976
4260
  <xsl:otherwise>
3977
4261
 
3978
4262
  <xsl:text>[</xsl:text>
3979
4263
 
3980
- <xsl:apply-templates/>
4264
+ <!-- <xsl:apply-templates /> -->
4265
+ <xsl:copy-of select="$termsource_text"/>
3981
4266
 
3982
4267
  <xsl:text>]</xsl:text>
3983
4268
 
@@ -3988,14 +4273,20 @@
3988
4273
  <xsl:if test="normalize-space() != ''">
3989
4274
  <xsl:value-of select="."/>
3990
4275
  </xsl:if>
3991
- </xsl:template><xsl:template match="*[local-name() = 'origin']">
4276
+ </xsl:template><xsl:variable name="localized.source">
4277
+ <xsl:call-template name="getLocalizedString">
4278
+ <xsl:with-param name="key">source</xsl:with-param>
4279
+ </xsl:call-template>
4280
+ </xsl:variable><xsl:template match="*[local-name() = 'origin']">
3992
4281
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4282
+ <xsl:if test="normalize-space(@citeas) = ''">
4283
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4284
+ </xsl:if>
3993
4285
 
3994
4286
  <fo:inline>
3995
4287
 
3996
4288
 
3997
4289
 
3998
-
3999
4290
  <xsl:call-template name="getTitle">
4000
4291
  <xsl:with-param name="name" select="'title-source'"/>
4001
4292
  </xsl:call-template>
@@ -4144,7 +4435,8 @@
4144
4435
  </fo:inline>
4145
4436
  </xsl:when>
4146
4437
  <xsl:otherwise>
4147
- <fo:inline padding-right="{$padding-right}mm">​</fo:inline>
4438
+ <xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
4439
+ <fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/>​</fo:inline>
4148
4440
  </xsl:otherwise>
4149
4441
  </xsl:choose>
4150
4442
 
@@ -4203,7 +4495,6 @@
4203
4495
 
4204
4496
 
4205
4497
 
4206
-
4207
4498
  <xsl:apply-templates/>
4208
4499
  </fo:block>
4209
4500
 
@@ -4246,7 +4537,7 @@
4246
4537
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
4247
4538
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
4248
4539
  <xsl:choose>
4249
- <xsl:when test="parent::*[local-name() = 'note']">
4540
+ <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
4250
4541
  <fo:block-container>
4251
4542
  <xsl:attribute name="margin-left">
4252
4543
  <xsl:choose>
@@ -4256,6 +4547,7 @@
4256
4547
  </xsl:attribute>
4257
4548
 
4258
4549
 
4550
+
4259
4551
  <fo:block-container margin-left="0mm">
4260
4552
  <fo:block>
4261
4553
  <xsl:apply-templates select="." mode="ul_ol"/>
@@ -4414,8 +4706,8 @@
4414
4706
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
4415
4707
  <xsl:apply-templates/>
4416
4708
  </fo:block>
4417
- </xsl:template><xsl:template match="*[local-name() = 'bookmark']">
4418
- <fo:inline id="{@id}"/>
4709
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
4710
+ <fo:inline id="{@id}" font-size="1pt"/>
4419
4711
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
4420
4712
  <!-- <row>
4421
4713
  <date>05-07-2013</date>
@@ -4457,6 +4749,10 @@
4457
4749
 
4458
4750
 
4459
4751
 
4752
+
4753
+
4754
+
4755
+
4460
4756
  </xsl:template><xsl:template name="processBibitemDocId">
4461
4757
  <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')]"/>
4462
4758
  <xsl:choose>
@@ -4513,6 +4809,70 @@
4513
4809
  <xsl:value-of select="substring(.,1,1)"/>
4514
4810
  </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
4515
4811
  <fo:inline><xsl:apply-templates/></fo:inline>
4812
+ </xsl:template><xsl:template match="*[local-name() = 'form']">
4813
+ <fo:block>
4814
+ <xsl:apply-templates/>
4815
+ </fo:block>
4816
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
4817
+ <fo:inline><xsl:apply-templates/></fo:inline>
4818
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
4819
+ <fo:inline>
4820
+ <xsl:call-template name="text_input"/>
4821
+ </fo:inline>
4822
+ </xsl:template><xsl:template name="text_input">
4823
+ <xsl:variable name="count">
4824
+ <xsl:choose>
4825
+ <xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
4826
+ <xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
4827
+ <xsl:otherwise>10</xsl:otherwise>
4828
+ </xsl:choose>
4829
+ </xsl:variable>
4830
+ <xsl:call-template name="repeat">
4831
+ <xsl:with-param name="char" select="'_'"/>
4832
+ <xsl:with-param name="count" select="$count"/>
4833
+ </xsl:call-template>
4834
+ <xsl:text> </xsl:text>
4835
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
4836
+ <xsl:variable name="caption">
4837
+ <xsl:choose>
4838
+ <xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
4839
+ <xsl:otherwise>BUTTON</xsl:otherwise>
4840
+ </xsl:choose>
4841
+ </xsl:variable>
4842
+ <fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
4843
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
4844
+ <fo:inline padding-right="1mm">
4845
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
4846
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
4847
+ <xsl:attribute name="content-width">100%</xsl:attribute>
4848
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4849
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
4850
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
4851
+ <polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
4852
+ </svg>
4853
+ </fo:instream-foreign-object>
4854
+ </fo:inline>
4855
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
4856
+ <fo:inline padding-right="1mm">
4857
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
4858
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
4859
+ <xsl:attribute name="content-width">100%</xsl:attribute>
4860
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4861
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
4862
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
4863
+ <circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
4864
+ <circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
4865
+ </svg>
4866
+ </fo:instream-foreign-object>
4867
+ </fo:inline>
4868
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
4869
+ <fo:inline>
4870
+ <xsl:call-template name="text_input"/>
4871
+ </fo:inline>
4872
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
4873
+ <fo:block-container border="1pt solid black" width="50%">
4874
+ <fo:block> </fo:block>
4875
+ </fo:block-container>
4516
4876
  </xsl:template><xsl:template name="convertDate">
4517
4877
  <xsl:param name="date"/>
4518
4878
  <xsl:param name="format" select="'short'"/>
@@ -4781,6 +5141,7 @@
4781
5141
 
4782
5142
 
4783
5143
 
5144
+
4784
5145
  <xsl:value-of select="document('')//*/namespace::rsd"/>
4785
5146
 
4786
5147
 
@@ -4844,17 +5205,62 @@
4844
5205
  </xsl:call-template>
4845
5206
  </xsl:if>
4846
5207
  </xsl:template><xsl:template name="getLocalizedString">
4847
- <xsl:param name="key"/>
5208
+ <xsl:param name="key"/>
4848
5209
 
4849
5210
  <xsl:variable name="curr_lang">
4850
5211
  <xsl:call-template name="getLang"/>
4851
5212
  </xsl:variable>
4852
5213
 
5214
+ <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
5215
+
4853
5216
  <xsl:choose>
5217
+ <xsl:when test="$data_value != ''">
5218
+ <xsl:value-of select="$data_value"/>
5219
+ </xsl:when>
4854
5220
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
4855
5221
  <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4856
5222
  </xsl:when>
4857
5223
  <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
4858
5224
  </xsl:choose>
4859
5225
 
5226
+ </xsl:template><xsl:template name="setTrackChangesStyles">
5227
+ <xsl:param name="isAdded"/>
5228
+ <xsl:param name="isDeleted"/>
5229
+ <xsl:choose>
5230
+ <xsl:when test="local-name() = 'math'">
5231
+ <xsl:if test="$isAdded = 'true'">
5232
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
5233
+ </xsl:if>
5234
+ <xsl:if test="$isDeleted = 'true'">
5235
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
5236
+ </xsl:if>
5237
+ </xsl:when>
5238
+ <xsl:otherwise>
5239
+ <xsl:if test="$isAdded = 'true'">
5240
+ <xsl:attribute name="border"><xsl:value-of select="$border-block-added"/></xsl:attribute>
5241
+ <xsl:attribute name="padding">2mm</xsl:attribute>
5242
+ </xsl:if>
5243
+ <xsl:if test="$isDeleted = 'true'">
5244
+ <xsl:attribute name="border"><xsl:value-of select="$border-block-deleted"/></xsl:attribute>
5245
+ <xsl:if test="local-name() = 'table'">
5246
+ <xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute>
5247
+ </xsl:if>
5248
+ <!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> -->
5249
+ <xsl:attribute name="padding">2mm</xsl:attribute>
5250
+ </xsl:if>
5251
+ </xsl:otherwise>
5252
+ </xsl:choose>
5253
+ </xsl:template><xsl:variable name="LRM" select="'‎'"/><xsl:variable name="RLM" select="'‏'"/><xsl:template name="setWritingMode">
5254
+ <xsl:if test="$lang = 'ar'">
5255
+ <xsl:attribute name="writing-mode">rl-tb</xsl:attribute>
5256
+ </xsl:if>
5257
+ </xsl:template><xsl:template name="setAlignment">
5258
+ <xsl:param name="align" select="normalize-space(@align)"/>
5259
+ <xsl:choose>
5260
+ <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
5261
+ <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
5262
+ <xsl:when test="$align != ''">
5263
+ <xsl:value-of select="$align"/>
5264
+ </xsl:when>
5265
+ </xsl:choose>
4860
5266
  </xsl:template></xsl:stylesheet>