metanorma-mpfa 0.5.8 → 0.5.13

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: 596d79a5ba9b9bb29e0f198f49ad991e2e7050b0544208ac76debb9f7c85d18c
4
- data.tar.gz: dd508a80cb6b33f736752c4bf581f6d7721827134db82218ddb043a8726ef9f5
3
+ metadata.gz: 7b1577410b152c3962957cca6f40310e2b208d2459b29eaafc4b65bc3312ce9a
4
+ data.tar.gz: 60e2bf959a0b64e8cf7467bc27401796080e1acab16e6202eee66b1f013c4e7b
5
5
  SHA512:
6
- metadata.gz: 318a73311033294df909c6231da009cdd54695c1a731017a71945a07f034e6fa6bb66ec2e1217ccaa0703b005ca6fa95efb37ba545b64eac8c0731d873f5bac6
7
- data.tar.gz: 1109389bdd638728883b07c0112a0f714aa7520ba345a9685af1c4cf926127f22035a6e6707faa4e2b7339f50d67b84ed67b9eab890db5b7d3f2801eebb37a9b
6
+ metadata.gz: f1d63a067e5478941717072dbae5f8cfbea45caf7855a80424afe8dc68b2a6e826da72c0eef49da09a2d171894709ef87686503cfa50a8f9f85ec943a1f50cd1
7
+ data.tar.gz: 1d277cc228fea2a4d492d333f8b95e3d71086e518ebf715c1fabe919c3157d9a88014f1786cc11455ed86527402e79e04ff739cf0f59b235150fb47e374772a3
@@ -36,6 +36,9 @@ jobs:
36
36
  with:
37
37
  ruby-version: ${{ matrix.ruby }}
38
38
 
39
+ - if: matrix.os == 'macos-latest'
40
+ run: brew install autoconf automake libtool
41
+
39
42
  - uses: actions/cache@v2
40
43
  with:
41
44
  path: vendor/bundle
@@ -596,6 +596,7 @@
596
596
  <ref name="bookmark"/>
597
597
  <ref name="image"/>
598
598
  <ref name="index"/>
599
+ <ref name="index-xref"/>
599
600
  </choice>
600
601
  </define>
601
602
  <define name="PureTextElement">
@@ -728,13 +729,61 @@
728
729
  </define>
729
730
  <define name="index">
730
731
  <element name="index">
731
- <attribute name="primary"/>
732
732
  <optional>
733
- <attribute name="secondary"/>
733
+ <attribute name="to">
734
+ <data type="IDREF"/>
735
+ </attribute>
736
+ </optional>
737
+ <element name="primary">
738
+ <oneOrMore>
739
+ <ref name="PureTextElement"/>
740
+ </oneOrMore>
741
+ </element>
742
+ <optional>
743
+ <element name="secondary">
744
+ <oneOrMore>
745
+ <ref name="PureTextElement"/>
746
+ </oneOrMore>
747
+ </element>
748
+ </optional>
749
+ <optional>
750
+ <element name="tertiary">
751
+ <oneOrMore>
752
+ <ref name="PureTextElement"/>
753
+ </oneOrMore>
754
+ </element>
755
+ </optional>
756
+ </element>
757
+ </define>
758
+ <define name="index-xref">
759
+ <element name="index-xref">
760
+ <attribute name="also">
761
+ <data type="boolean"/>
762
+ </attribute>
763
+ <element name="primary">
764
+ <oneOrMore>
765
+ <ref name="PureTextElement"/>
766
+ </oneOrMore>
767
+ </element>
768
+ <optional>
769
+ <element name="secondary">
770
+ <oneOrMore>
771
+ <ref name="PureTextElement"/>
772
+ </oneOrMore>
773
+ </element>
734
774
  </optional>
735
775
  <optional>
736
- <attribute name="tertiary"/>
776
+ <element name="tertiary">
777
+ <oneOrMore>
778
+ <ref name="PureTextElement"/>
779
+ </oneOrMore>
780
+ </element>
737
781
  </optional>
782
+ <element name="target">
783
+ <oneOrMore>
784
+ <ref name="PureTextElement"/>
785
+ </oneOrMore>
786
+ </element>
738
787
  </element>
739
788
  </define>
740
789
  <!-- bare ID element, used for referencing arbitrary spans of text -->
@@ -55,6 +55,13 @@
55
55
  <param name="pattern">\i\c*|\c+#\c+</param>
56
56
  </data>
57
57
  </attribute>
58
+ <optional>
59
+ <attribute name="to">
60
+ <data type="string">
61
+ <param name="pattern">\i\c*|\c+#\c+</param>
62
+ </data>
63
+ </attribute>
64
+ </optional>
58
65
  <optional>
59
66
  <attribute name="type">
60
67
  <ref name="ReferenceFormat"/>
@@ -246,6 +253,12 @@
246
253
  <data type="boolean"/>
247
254
  </attribute>
248
255
  </optional>
256
+ <optional>
257
+ <attribute name="width"/>
258
+ </optional>
259
+ <optional>
260
+ <ref name="colgroup"/>
261
+ </optional>
249
262
  <optional>
250
263
  <ref name="tname"/>
251
264
  </optional>
@@ -764,6 +777,21 @@
764
777
  </define>
765
778
  </include>
766
779
  <!-- end overrides -->
780
+ <define name="colgroup">
781
+ <element name="colgroup">
782
+ <oneOrMore>
783
+ <ref name="col"/>
784
+ </oneOrMore>
785
+ </element>
786
+ </define>
787
+ <define name="col">
788
+ <element name="col">
789
+ <attribute name="width"/>
790
+ </element>
791
+ </define>
792
+ <define name="BibItemType" combine="choice">
793
+ <value>internal</value>
794
+ </define>
767
795
  <define name="TextElement" combine="choice">
768
796
  <ref name="concept"/>
769
797
  </define>
@@ -784,6 +812,8 @@
784
812
  <ref name="requirement"/>
785
813
  <ref name="recommendation"/>
786
814
  <ref name="permission"/>
815
+ <ref name="imagemap"/>
816
+ <ref name="svgmap"/>
787
817
  </choice>
788
818
  </define>
789
819
  <define name="bibliography">
@@ -814,6 +844,9 @@
814
844
  <data type="boolean"/>
815
845
  </attribute>
816
846
  </optional>
847
+ <optional>
848
+ <attribute name="number"/>
849
+ </optional>
817
850
  <optional>
818
851
  <attribute name="obligation">
819
852
  <choice>
@@ -869,9 +902,11 @@
869
902
  <element name="code">
870
903
  <text/>
871
904
  </element>
872
- <element name="text">
873
- <text/>
874
- </element>
905
+ <optional>
906
+ <element name="text">
907
+ <text/>
908
+ </element>
909
+ </optional>
875
910
  </element>
876
911
  </define>
877
912
  <define name="standard-document">
@@ -1041,6 +1076,9 @@
1041
1076
  </choice>
1042
1077
  </attribute>
1043
1078
  </optional>
1079
+ <optional>
1080
+ <attribute name="number"/>
1081
+ </optional>
1044
1082
  <optional>
1045
1083
  <attribute name="type"/>
1046
1084
  </optional>
@@ -1094,6 +1132,9 @@
1094
1132
  <optional>
1095
1133
  <attribute name="type"/>
1096
1134
  </optional>
1135
+ <optional>
1136
+ <attribute name="number"/>
1137
+ </optional>
1097
1138
  <optional>
1098
1139
  <ref name="section-title"/>
1099
1140
  </optional>
@@ -1196,6 +1237,9 @@
1196
1237
  <optional>
1197
1238
  <attribute name="type"/>
1198
1239
  </optional>
1240
+ <optional>
1241
+ <attribute name="number"/>
1242
+ </optional>
1199
1243
  <optional>
1200
1244
  <attribute name="obligation">
1201
1245
  <choice>
@@ -1524,6 +1568,7 @@
1524
1568
  <value>add</value>
1525
1569
  <value>modify</value>
1526
1570
  <value>delete</value>
1571
+ <value>replace</value>
1527
1572
  </choice>
1528
1573
  </attribute>
1529
1574
  <optional>
@@ -1554,6 +1599,11 @@
1554
1599
  </optional>
1555
1600
  <optional>
1556
1601
  <element name="newcontent">
1602
+ <optional>
1603
+ <attribute name="id">
1604
+ <data type="ID"/>
1605
+ </attribute>
1606
+ </optional>
1557
1607
  <zeroOrMore>
1558
1608
  <ref name="BasicBlock"/>
1559
1609
  </zeroOrMore>
@@ -1587,4 +1637,65 @@
1587
1637
  <text/>
1588
1638
  </element>
1589
1639
  </define>
1640
+ <define name="imagemap">
1641
+ <element name="imagemap">
1642
+ <ref name="figure"/>
1643
+ <zeroOrMore>
1644
+ <element name="area">
1645
+ <attribute name="type">
1646
+ <choice>
1647
+ <value>rect</value>
1648
+ <value>circle</value>
1649
+ <value>ellipse</value>
1650
+ <value>poly</value>
1651
+ </choice>
1652
+ </attribute>
1653
+ <choice>
1654
+ <ref name="xref"/>
1655
+ <ref name="hyperlink"/>
1656
+ <ref name="eref"/>
1657
+ </choice>
1658
+ <oneOrMore>
1659
+ <element name="coords">
1660
+ <attribute name="x">
1661
+ <data type="float"/>
1662
+ </attribute>
1663
+ <attribute name="y">
1664
+ <data type="float"/>
1665
+ </attribute>
1666
+ </element>
1667
+ </oneOrMore>
1668
+ <optional>
1669
+ <element name="radius">
1670
+ <attribute name="x">
1671
+ <data type="float"/>
1672
+ </attribute>
1673
+ <optional>
1674
+ <attribute name="y">
1675
+ <data type="float"/>
1676
+ </attribute>
1677
+ </optional>
1678
+ </element>
1679
+ </optional>
1680
+ </element>
1681
+ </zeroOrMore>
1682
+ </element>
1683
+ </define>
1684
+ <define name="svgmap">
1685
+ <element name="svgmap">
1686
+ <ref name="figure"/>
1687
+ <zeroOrMore>
1688
+ <element name="target">
1689
+ <attribute name="href">
1690
+ <data type="anyURI"/>
1691
+ </attribute>
1692
+ <choice>
1693
+ <ref name="xref"/>
1694
+ <ref name="hyperlink"/>
1695
+ <ref name="eref"/>
1696
+ </choice>
1697
+ </element>
1698
+ </zeroOrMore>
1699
+ </element>
1700
+ </define>
1590
1701
  </grammar>
@@ -40,12 +40,12 @@ module IsoDoc
40
40
  end
41
41
  end
42
42
 
43
- def middle_clause
43
+ def middle_clause(_docxml)
44
44
  "//clause[parent::sections][not(descendant::terms)]"
45
45
  end
46
46
 
47
47
  def middle(isoxml, out)
48
- middle_title(out)
48
+ middle_title(isoxml, out)
49
49
  middle_admonitions(isoxml, out)
50
50
  clause isoxml, out
51
51
  annex isoxml, out
@@ -59,7 +59,7 @@ module IsoDoc
59
59
  end
60
60
 
61
61
  def clause(isoxml, out)
62
- isoxml.xpath(ns(middle_clause)).each do |c|
62
+ isoxml.xpath(ns(middle_clause(isoxml))).each do |c|
63
63
  out.div **attr_code(id: c["id"]) do |s|
64
64
  clause_name(nil, c&.at(ns("./title")), s,
65
65
  class: c["container"] ? "containerhdr" : nil )
@@ -18,8 +18,8 @@ module IsoDoc
18
18
 
19
19
  def default_fonts(options)
20
20
  {
21
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Titillium Web",sans-serif'),
22
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Titillium Web",sans-serif'),
21
+ bodyfont: (options[:script] == "Hans" ? '"Source Han Sans",serif' : '"Titillium Web",sans-serif'),
22
+ headerfont: (options[:script] == "Hans" ? '"Source Han Sans",sans-serif' : '"Titillium Web",sans-serif'),
23
23
  monospacefont: '"Space Mono",monospace',
24
24
  normalfontsize: "15px",
25
25
  footnotefontsize: "0.9em",
@@ -328,16 +328,16 @@
328
328
  <xsl:otherwise> <!-- for ordered lists -->
329
329
  <xsl:choose>
330
330
  <xsl:when test="../@type = 'arabic'">
331
- <xsl:number format="a)"/>
331
+ <xsl:number format="a)" lang="en"/>
332
332
  </xsl:when>
333
333
  <xsl:when test="../@type = 'roman'">
334
334
  <xsl:number format="1)"/>
335
335
  </xsl:when>
336
336
  <xsl:when test="../@type = 'alphabet'">
337
- <xsl:number format="a)"/>
337
+ <xsl:number format="a)" lang="en"/>
338
338
  </xsl:when>
339
339
  <xsl:otherwise>
340
- <xsl:number format="a)"/>
340
+ <xsl:number format="a)" lang="en"/>
341
341
  </xsl:otherwise>
342
342
  </xsl:choose>
343
343
  </xsl:otherwise>
@@ -1138,6 +1138,7 @@
1138
1138
 
1139
1139
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1140
1140
 
1141
+
1141
1142
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1142
1143
 
1143
1144
 
@@ -1145,6 +1146,7 @@
1145
1146
 
1146
1147
 
1147
1148
 
1149
+
1148
1150
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1149
1151
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
1150
1152
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
@@ -1277,184 +1279,236 @@
1277
1279
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1278
1280
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
1279
1281
  <xsl:call-template name="add-zero-spaces-java"/>
1280
- </xsl:template><xsl:template match="*[local-name()='table']">
1282
+ </xsl:template><xsl:template match="*[local-name()='table']" name="table">
1281
1283
 
1282
- <xsl:variable name="simple-table">
1283
- <xsl:call-template name="getSimpleTable"/>
1284
- </xsl:variable>
1284
+ <xsl:variable name="table">
1285
1285
 
1286
-
1287
-
1288
-
1289
-
1290
- <!-- <xsl:if test="$namespace = 'bipm'">
1291
- <fo:block>&#xA0;</fo:block>
1292
- </xsl:if> -->
1293
-
1294
- <!-- $namespace = 'iso' or -->
1295
-
1296
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1297
-
1298
-
1299
-
1300
- <xsl:call-template name="fn_name_display"/>
1286
+ <xsl:variable name="simple-table">
1287
+ <xsl:call-template name="getSimpleTable"/>
1288
+ </xsl:variable>
1301
1289
 
1302
1290
 
1303
-
1304
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1305
-
1306
- <!-- <xsl:variable name="cols-count">
1307
- <xsl:choose>
1308
- <xsl:when test="*[local-name()='thead']">
1309
- <xsl:call-template name="calculate-columns-numbers">
1310
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1311
- </xsl:call-template>
1312
- </xsl:when>
1313
- <xsl:otherwise>
1314
- <xsl:call-template name="calculate-columns-numbers">
1315
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1316
- </xsl:call-template>
1317
- </xsl:otherwise>
1318
- </xsl:choose>
1319
- </xsl:variable> -->
1320
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1321
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1322
-
1323
-
1324
-
1325
- <xsl:variable name="colwidths">
1326
- <xsl:call-template name="calculate-column-widths">
1327
- <xsl:with-param name="cols-count" select="$cols-count"/>
1328
- <xsl:with-param name="table" select="$simple-table"/>
1329
- </xsl:call-template>
1330
- </xsl:variable>
1331
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1332
-
1333
- <!-- <xsl:variable name="colwidths2">
1334
- <xsl:call-template name="calculate-column-widths">
1335
- <xsl:with-param name="cols-count" select="$cols-count"/>
1336
- </xsl:call-template>
1337
- </xsl:variable> -->
1338
-
1339
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1340
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
1341
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1342
-
1343
- <xsl:variable name="margin-left">
1344
- <xsl:choose>
1345
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1346
- <xsl:otherwise>0</xsl:otherwise>
1347
- </xsl:choose>
1348
- </xsl:variable>
1349
-
1350
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1351
1291
 
1352
1292
 
1353
-
1354
-
1355
-
1356
1293
 
1294
+ <!-- <xsl:if test="$namespace = 'bipm'">
1295
+ <fo:block>&#xA0;</fo:block>
1296
+ </xsl:if> -->
1357
1297
 
1358
-
1298
+ <!-- $namespace = 'iso' or -->
1359
1299
 
1300
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1360
1301
 
1302
+
1361
1303
 
1304
+ <xsl:call-template name="fn_name_display"/>
1362
1305
 
1363
- <xsl:attribute name="space-after">12pt</xsl:attribute>
1364
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
1365
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
1306
+
1366
1307
 
1308
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1309
+
1310
+ <!-- <xsl:variable name="cols-count">
1311
+ <xsl:choose>
1312
+ <xsl:when test="*[local-name()='thead']">
1313
+ <xsl:call-template name="calculate-columns-numbers">
1314
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1315
+ </xsl:call-template>
1316
+ </xsl:when>
1317
+ <xsl:otherwise>
1318
+ <xsl:call-template name="calculate-columns-numbers">
1319
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1320
+ </xsl:call-template>
1321
+ </xsl:otherwise>
1322
+ </xsl:choose>
1323
+ </xsl:variable> -->
1324
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1325
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1367
1326
 
1368
1327
 
1369
1328
 
1370
- <xsl:variable name="table_attributes">
1371
- <attribute name="table-layout">fixed</attribute>
1372
- <attribute name="width">100%</attribute>
1373
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1374
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1329
+ <xsl:variable name="colwidths">
1330
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1331
+ <xsl:call-template name="calculate-column-widths">
1332
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1333
+ <xsl:with-param name="table" select="$simple-table"/>
1334
+ </xsl:call-template>
1335
+ </xsl:if>
1336
+ </xsl:variable>
1337
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1338
+
1339
+ <!-- <xsl:variable name="colwidths2">
1340
+ <xsl:call-template name="calculate-column-widths">
1341
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1342
+ </xsl:call-template>
1343
+ </xsl:variable> -->
1344
+
1345
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1346
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1347
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1348
+
1349
+ <xsl:variable name="margin-left">
1350
+ <xsl:choose>
1351
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1352
+ <xsl:otherwise>0</xsl:otherwise>
1353
+ </xsl:choose>
1354
+ </xsl:variable>
1355
+
1356
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1375
1357
 
1376
1358
 
1359
+
1360
+
1361
+
1377
1362
 
1378
1363
 
1379
-
1380
-
1381
-
1364
+
1382
1365
 
1383
1366
 
1384
- <attribute name="border-top">2pt solid black</attribute>
1385
- <attribute name="border-bottom">2pt solid black</attribute>
1386
-
1387
1367
 
1388
- </xsl:variable>
1389
-
1390
-
1391
- <fo:table id="{@id}" table-omit-footer-at-break="true">
1392
1368
 
1393
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1394
- <xsl:attribute name="{@name}">
1395
- <xsl:value-of select="."/>
1396
- </xsl:attribute>
1397
- </xsl:for-each>
1369
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
1370
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
1371
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
1372
+
1398
1373
 
1399
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1400
- <xsl:if test="$isNoteOrFnExist = 'true'">
1401
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1402
- </xsl:if>
1403
1374
 
1404
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1375
+ <xsl:variable name="table_width">
1376
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1377
+ 100%
1378
+
1379
+
1380
+ </xsl:variable>
1381
+
1382
+ <xsl:variable name="table_attributes">
1383
+ <attribute name="table-layout">fixed</attribute>
1384
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
1385
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1386
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1387
+
1388
+
1389
+
1390
+
1391
+
1392
+
1393
+
1394
+
1395
+
1396
+ <attribute name="border-top">2pt solid black</attribute>
1397
+ <attribute name="border-bottom">2pt solid black</attribute>
1398
+
1399
+
1400
+ </xsl:variable>
1401
+
1402
+
1403
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1404
+
1405
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1406
+ <xsl:attribute name="{@name}">
1407
+ <xsl:value-of select="."/>
1408
+ </xsl:attribute>
1409
+ </xsl:for-each>
1410
+
1411
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1412
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1413
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1414
+ </xsl:if>
1415
+
1405
1416
  <xsl:choose>
1406
- <xsl:when test=". = 1 or . = 0">
1407
- <fo:table-column column-width="proportional-column-width(2)"/>
1417
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1418
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1419
+ <fo:table-column column-width="{@width}"/>
1420
+ </xsl:for-each>
1408
1421
  </xsl:when>
1409
1422
  <xsl:otherwise>
1410
- <fo:table-column column-width="proportional-column-width({.})"/>
1423
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1424
+ <xsl:choose>
1425
+ <xsl:when test=". = 1 or . = 0">
1426
+ <fo:table-column column-width="proportional-column-width(2)"/>
1427
+ </xsl:when>
1428
+ <xsl:otherwise>
1429
+ <fo:table-column column-width="proportional-column-width({.})"/>
1430
+ </xsl:otherwise>
1431
+ </xsl:choose>
1432
+ </xsl:for-each>
1411
1433
  </xsl:otherwise>
1412
1434
  </xsl:choose>
1413
- </xsl:for-each>
1414
-
1415
- <xsl:choose>
1416
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1417
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1418
- </xsl:when>
1419
- <xsl:otherwise>
1420
- <xsl:apply-templates/>
1421
- </xsl:otherwise>
1422
- </xsl:choose>
1423
-
1424
- </fo:table>
1425
-
1426
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1427
- <xsl:call-template name="insertTableFooterInSeparateTable">
1428
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
1429
- <xsl:with-param name="colwidths" select="$colwidths"/>
1430
- </xsl:call-template>
1431
- </xsl:for-each>
1432
-
1433
- <!-- insert footer as table -->
1434
- <!-- <fo:table>
1435
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1436
- <xsl:attribute name="{@name}">
1437
- <xsl:value-of select="."/>
1438
- </xsl:attribute>
1439
- </xsl:for-each>
1440
-
1441
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1435
+
1442
1436
  <xsl:choose>
1443
- <xsl:when test=". = 1 or . = 0">
1444
- <fo:table-column column-width="proportional-column-width(2)"/>
1437
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1438
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1445
1439
  </xsl:when>
1446
1440
  <xsl:otherwise>
1447
- <fo:table-column column-width="proportional-column-width({.})"/>
1441
+ <xsl:apply-templates/>
1448
1442
  </xsl:otherwise>
1449
1443
  </xsl:choose>
1444
+
1445
+ </fo:table>
1446
+
1447
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1448
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1449
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1450
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1451
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1452
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1453
+ </xsl:call-template>
1450
1454
  </xsl:for-each>
1451
- </fo:table>-->
1452
-
1453
-
1454
-
1455
-
1456
-
1457
- </fo:block-container>
1455
+
1456
+ <!-- insert footer as table -->
1457
+ <!-- <fo:table>
1458
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1459
+ <xsl:attribute name="{@name}">
1460
+ <xsl:value-of select="."/>
1461
+ </xsl:attribute>
1462
+ </xsl:for-each>
1463
+
1464
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1465
+ <xsl:choose>
1466
+ <xsl:when test=". = 1 or . = 0">
1467
+ <fo:table-column column-width="proportional-column-width(2)"/>
1468
+ </xsl:when>
1469
+ <xsl:otherwise>
1470
+ <fo:table-column column-width="proportional-column-width({.})"/>
1471
+ </xsl:otherwise>
1472
+ </xsl:choose>
1473
+ </xsl:for-each>
1474
+ </fo:table>-->
1475
+
1476
+
1477
+
1478
+
1479
+
1480
+ </fo:block-container>
1481
+ </xsl:variable>
1482
+
1483
+
1484
+
1485
+ <xsl:choose>
1486
+ <xsl:when test="@width">
1487
+
1488
+ <!-- centered table when table name is centered (see table-name-style) -->
1489
+
1490
+ <fo:table table-layout="fixed" width="100%">
1491
+ <fo:table-column column-width="proportional-column-width(1)"/>
1492
+ <fo:table-column column-width="{@width}"/>
1493
+ <fo:table-column column-width="proportional-column-width(1)"/>
1494
+ <fo:table-body>
1495
+ <fo:table-row>
1496
+ <fo:table-cell column-number="2">
1497
+ <fo:block><xsl:copy-of select="$table"/></fo:block>
1498
+ </fo:table-cell>
1499
+ </fo:table-row>
1500
+ </fo:table-body>
1501
+ </fo:table>
1502
+
1503
+
1504
+
1505
+
1506
+ </xsl:when>
1507
+ <xsl:otherwise>
1508
+ <xsl:copy-of select="$table"/>
1509
+ </xsl:otherwise>
1510
+ </xsl:choose>
1511
+
1458
1512
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1459
1513
  <xsl:if test="normalize-space() != ''">
1460
1514
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -1680,12 +1734,22 @@
1680
1734
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1681
1735
  <xsl:param name="table_attributes"/>
1682
1736
  <xsl:param name="colwidths"/>
1737
+ <xsl:param name="colgroup"/>
1683
1738
 
1684
1739
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1685
1740
 
1686
1741
  <xsl:if test="$isNoteOrFnExist = 'true'">
1687
1742
 
1688
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1743
+ <xsl:variable name="cols-count">
1744
+ <xsl:choose>
1745
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1746
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
1747
+ </xsl:when>
1748
+ <xsl:otherwise>
1749
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
1750
+ </xsl:otherwise>
1751
+ </xsl:choose>
1752
+ </xsl:variable>
1689
1753
 
1690
1754
  <fo:table keep-with-previous="always">
1691
1755
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -1703,16 +1767,25 @@
1703
1767
  </xsl:choose>
1704
1768
  </xsl:for-each>
1705
1769
 
1706
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1707
- <xsl:choose>
1708
- <xsl:when test=". = 1 or . = 0">
1709
- <fo:table-column column-width="proportional-column-width(2)"/>
1710
- </xsl:when>
1711
- <xsl:otherwise>
1712
- <fo:table-column column-width="proportional-column-width({.})"/>
1713
- </xsl:otherwise>
1714
- </xsl:choose>
1715
- </xsl:for-each>
1770
+ <xsl:choose>
1771
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1772
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
1773
+ <fo:table-column column-width="{@width}"/>
1774
+ </xsl:for-each>
1775
+ </xsl:when>
1776
+ <xsl:otherwise>
1777
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1778
+ <xsl:choose>
1779
+ <xsl:when test=". = 1 or . = 0">
1780
+ <fo:table-column column-width="proportional-column-width(2)"/>
1781
+ </xsl:when>
1782
+ <xsl:otherwise>
1783
+ <fo:table-column column-width="proportional-column-width({.})"/>
1784
+ </xsl:otherwise>
1785
+ </xsl:choose>
1786
+ </xsl:for-each>
1787
+ </xsl:otherwise>
1788
+ </xsl:choose>
1716
1789
 
1717
1790
  <fo:table-body>
1718
1791
  <fo:table-row>
@@ -2115,7 +2188,9 @@
2115
2188
  </xsl:template><xsl:template match="*[local-name()='dl']">
2116
2189
  <fo:block-container>
2117
2190
 
2118
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2191
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2192
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2193
+ </xsl:if>
2119
2194
 
2120
2195
 
2121
2196
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -2130,6 +2205,7 @@
2130
2205
  <fo:block-container>
2131
2206
 
2132
2207
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2208
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2133
2209
 
2134
2210
 
2135
2211
  <xsl:variable name="parent" select="local-name(..)"/>
@@ -2246,7 +2322,7 @@
2246
2322
  <xsl:with-param name="table" select="$html-table"/>
2247
2323
  </xsl:call-template>
2248
2324
  </xsl:variable>
2249
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2325
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2250
2326
  <xsl:variable name="maxlength_dt">
2251
2327
  <xsl:call-template name="getMaxLength_dt"/>
2252
2328
  </xsl:variable>
@@ -2275,13 +2351,22 @@
2275
2351
  </xsl:when>
2276
2352
  <xsl:otherwise>
2277
2353
  <xsl:choose>
2354
+ <!-- to set width check most wide chars like `W` -->
2278
2355
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
2279
- <fo:table-column column-width="5%"/>
2280
- <fo:table-column column-width="95%"/>
2356
+ <fo:table-column column-width="7%"/>
2357
+ <fo:table-column column-width="93%"/>
2358
+ </xsl:when>
2359
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
2360
+ <fo:table-column column-width="15%"/>
2361
+ <fo:table-column column-width="85%"/>
2281
2362
  </xsl:when>
2282
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
2283
- <fo:table-column column-width="10%"/>
2284
- <fo:table-column column-width="90%"/>
2363
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
2364
+ <fo:table-column column-width="20%"/>
2365
+ <fo:table-column column-width="80%"/>
2366
+ </xsl:when>
2367
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
2368
+ <fo:table-column column-width="25%"/>
2369
+ <fo:table-column column-width="75%"/>
2285
2370
  </xsl:when>
2286
2371
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
2287
2372
  <fo:table-column column-width="60%"/>
@@ -2313,12 +2398,32 @@
2313
2398
  </xsl:otherwise>
2314
2399
  </xsl:choose>
2315
2400
  </xsl:template><xsl:template name="getMaxLength_dt">
2316
- <xsl:for-each select="*[local-name()='dt']">
2317
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2318
- <xsl:if test="position() = 1">
2319
- <xsl:value-of select="string-length(normalize-space(.))"/>
2320
- </xsl:if>
2321
- </xsl:for-each>
2401
+ <xsl:variable name="lengths">
2402
+ <xsl:for-each select="*[local-name()='dt']">
2403
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
2404
+ <xsl:variable name="attributes">
2405
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
2406
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
2407
+ </xsl:variable>
2408
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
2409
+ </xsl:for-each>
2410
+ </xsl:variable>
2411
+ <xsl:variable name="maxLength">
2412
+ <!-- <xsl:for-each select="*[local-name()='dt']">
2413
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2414
+ <xsl:if test="position() = 1">
2415
+ <xsl:value-of select="string-length(normalize-space(.))"/>
2416
+ </xsl:if>
2417
+ </xsl:for-each> -->
2418
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
2419
+ <xsl:sort select="." data-type="number" order="descending"/>
2420
+ <xsl:if test="position() = 1">
2421
+ <xsl:value-of select="."/>
2422
+ </xsl:if>
2423
+ </xsl:for-each>
2424
+ </xsl:variable>
2425
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
2426
+ <xsl:value-of select="$maxLength"/>
2322
2427
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2323
2428
  <xsl:param name="key_iso"/>
2324
2429
 
@@ -2457,6 +2562,7 @@
2457
2562
 
2458
2563
 
2459
2564
 
2565
+
2460
2566
 
2461
2567
  </xsl:variable>
2462
2568
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -2470,6 +2576,10 @@
2470
2576
  </xsl:if>
2471
2577
  <xsl:apply-templates/>
2472
2578
  </fo:inline>
2579
+ </xsl:template><xsl:template match="*[local-name()='underline']">
2580
+ <fo:inline text-decoration="underline">
2581
+ <xsl:apply-templates/>
2582
+ </fo:inline>
2473
2583
  </xsl:template><xsl:template match="*[local-name()='del']">
2474
2584
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2475
2585
  <xsl:apply-templates/>
@@ -2563,6 +2673,10 @@
2563
2673
  <xsl:param name="text" select="."/>
2564
2674
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2565
2675
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
2676
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
2677
+ <xsl:param name="text" select="."/>
2678
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2679
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
2566
2680
  </xsl:template><xsl:template name="add-zero-spaces">
2567
2681
  <xsl:param name="text" select="."/>
2568
2682
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -2823,6 +2937,11 @@
2823
2937
  <!-- replace start and end spaces to non-break space -->
2824
2938
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
2825
2939
  </xsl:copy>
2940
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
2941
+ <xsl:copy>
2942
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
2943
+ </xsl:copy>
2944
+ <mathml:mspace width="0.5ex"/>
2826
2945
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2827
2946
  <xsl:variable name="target">
2828
2947
  <xsl:choose>
@@ -2844,7 +2963,10 @@
2844
2963
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
2845
2964
  <xsl:choose>
2846
2965
  <xsl:when test="normalize-space(.) = ''">
2847
- <xsl:value-of select="$target"/>
2966
+ <!-- <xsl:value-of select="$target"/> -->
2967
+ <xsl:call-template name="add-zero-spaces-link-java">
2968
+ <xsl:with-param name="text" select="$target"/>
2969
+ </xsl:call-template>
2848
2970
  </xsl:when>
2849
2971
  <xsl:otherwise>
2850
2972
  <xsl:apply-templates/>
@@ -3046,7 +3168,7 @@
3046
3168
  </xsl:if> -->
3047
3169
  </fo:inline>
3048
3170
  </xsl:if>
3049
- </xsl:template><xsl:template match="*[local-name() = 'figure']">
3171
+ </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
3050
3172
  <fo:block-container id="{@id}">
3051
3173
 
3052
3174
  <fo:block>
@@ -3115,6 +3237,8 @@
3115
3237
  <xsl:variable name="bookmark-title_">
3116
3238
  <xsl:call-template name="getLangVersion">
3117
3239
  <xsl:with-param name="lang" select="@lang"/>
3240
+ <xsl:with-param name="doctype" select="@doctype"/>
3241
+ <xsl:with-param name="title" select="@title-part"/>
3118
3242
  </xsl:call-template>
3119
3243
  </xsl:variable>
3120
3244
  <xsl:choose>
@@ -3132,13 +3256,34 @@
3132
3256
  </xsl:choose>
3133
3257
  </fo:bookmark-title>
3134
3258
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3259
+
3260
+ <xsl:call-template name="insertFigureBookmarks">
3261
+ <xsl:with-param name="contents" select="contents"/>
3262
+ </xsl:call-template>
3263
+
3264
+ <xsl:call-template name="insertTableBookmarks">
3265
+ <xsl:with-param name="contents" select="contents"/>
3266
+ <xsl:with-param name="lang" select="@lang"/>
3267
+ </xsl:call-template>
3268
+
3135
3269
  </fo:bookmark>
3136
3270
 
3137
3271
  </xsl:for-each>
3138
3272
  </xsl:when>
3139
3273
  <xsl:otherwise>
3140
3274
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3275
+
3141
3276
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3277
+
3278
+ <xsl:call-template name="insertFigureBookmarks">
3279
+ <xsl:with-param name="contents" select="contents"/>
3280
+ </xsl:call-template>
3281
+
3282
+ <xsl:call-template name="insertTableBookmarks">
3283
+ <xsl:with-param name="contents" select="contents"/>
3284
+ <xsl:with-param name="lang" select="@lang"/>
3285
+ </xsl:call-template>
3286
+
3142
3287
  </xsl:for-each>
3143
3288
  </xsl:otherwise>
3144
3289
  </xsl:choose>
@@ -3157,8 +3302,44 @@
3157
3302
 
3158
3303
  </fo:bookmark-tree>
3159
3304
  </xsl:if>
3305
+ </xsl:template><xsl:template name="insertFigureBookmarks">
3306
+ <xsl:param name="contents"/>
3307
+ <xsl:if test="xalan:nodeset($contents)/figure">
3308
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
3309
+ <fo:bookmark-title>Figures</fo:bookmark-title>
3310
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
3311
+ <fo:bookmark internal-destination="{@id}">
3312
+ <fo:bookmark-title>
3313
+ <xsl:value-of select="normalize-space(title)"/>
3314
+ </fo:bookmark-title>
3315
+ </fo:bookmark>
3316
+ </xsl:for-each>
3317
+ </fo:bookmark>
3318
+ </xsl:if>
3319
+ </xsl:template><xsl:template name="insertTableBookmarks">
3320
+ <xsl:param name="contents"/>
3321
+ <xsl:param name="lang"/>
3322
+ <xsl:if test="xalan:nodeset($contents)/table">
3323
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
3324
+ <fo:bookmark-title>
3325
+ <xsl:choose>
3326
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
3327
+ <xsl:otherwise>Tables</xsl:otherwise>
3328
+ </xsl:choose>
3329
+ </fo:bookmark-title>
3330
+ <xsl:for-each select="xalan:nodeset($contents)/table">
3331
+ <fo:bookmark internal-destination="{@id}">
3332
+ <fo:bookmark-title>
3333
+ <xsl:value-of select="normalize-space(title)"/>
3334
+ </fo:bookmark-title>
3335
+ </fo:bookmark>
3336
+ </xsl:for-each>
3337
+ </fo:bookmark>
3338
+ </xsl:if>
3160
3339
  </xsl:template><xsl:template name="getLangVersion">
3161
3340
  <xsl:param name="lang"/>
3341
+ <xsl:param name="doctype" select="''"/>
3342
+ <xsl:param name="title" select="''"/>
3162
3343
  <xsl:choose>
3163
3344
  <xsl:when test="$lang = 'en'">
3164
3345
 
@@ -3194,6 +3375,12 @@
3194
3375
  <!-- <xsl:text> </xsl:text> -->
3195
3376
  </xsl:template><xsl:template name="getSection">
3196
3377
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3378
+ <!--
3379
+ <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
3380
+ <xsl:value-of select="."/>
3381
+ </xsl:for-each>
3382
+ -->
3383
+
3197
3384
  </xsl:template><xsl:template name="getName">
3198
3385
  <xsl:choose>
3199
3386
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -3246,6 +3433,12 @@
3246
3433
  <xsl:copy>
3247
3434
  <xsl:apply-templates mode="contents_item"/>
3248
3435
  </xsl:copy>
3436
+ </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
3437
+ <xsl:copy>
3438
+ <xsl:apply-templates mode="contents_item"/>
3439
+ </xsl:copy>
3440
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
3441
+ <xsl:copy-of select="."/>
3249
3442
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3250
3443
  <xsl:text> </xsl:text>
3251
3444
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -3271,6 +3464,7 @@
3271
3464
 
3272
3465
 
3273
3466
 
3467
+
3274
3468
 
3275
3469
 
3276
3470
 
@@ -3647,10 +3841,13 @@
3647
3841
  </xsl:if>
3648
3842
  </xsl:if>
3649
3843
 
3844
+
3650
3845
  <fo:block-container margin-left="0mm">
3651
3846
 
3652
3847
  <fo:block xsl:use-attribute-sets="quote-style">
3653
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3848
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
3849
+
3850
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
3654
3851
  </fo:block>
3655
3852
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3656
3853
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -3799,6 +3996,7 @@
3799
3996
 
3800
3997
 
3801
3998
 
3999
+
3802
4000
 
3803
4001
 
3804
4002
 
@@ -3810,7 +4008,7 @@
3810
4008
 
3811
4009
 
3812
4010
 
3813
- </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
4011
+ </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
3814
4012
  <fo:block break-after="page"/>
3815
4013
  <fo:block>
3816
4014
  <xsl:call-template name="setId"/>
@@ -3818,7 +4016,8 @@
3818
4016
  </fo:block>
3819
4017
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3820
4018
  <fo:block>
3821
- <xsl:call-template name="setId"/>
4019
+ <xsl:call-template name="setId"/>
4020
+
3822
4021
 
3823
4022
  <xsl:apply-templates/>
3824
4023
  </fo:block>
@@ -3883,7 +4082,8 @@
3883
4082
  <fo:table-column column-width="107mm"/>
3884
4083
  <fo:table-column column-width="15mm"/>
3885
4084
  <fo:table-body>
3886
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
4085
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
4086
+
3887
4087
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
3888
4088
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
3889
4089
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -3901,6 +4101,10 @@
3901
4101
  <fo:block><xsl:apply-templates/></fo:block>
3902
4102
  </fo:table-cell>
3903
4103
  </xsl:template><xsl:template name="processBibitem">
4104
+
4105
+
4106
+ <!-- end BIPM bibitem processing-->
4107
+
3904
4108
 
3905
4109
 
3906
4110
 
@@ -3959,6 +4163,8 @@
3959
4163
  <xsl:value-of select="translate(.,'. ','')"/>
3960
4164
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
3961
4165
  <xsl:value-of select="substring(.,1,1)"/>
4166
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
4167
+ <fo:inline><xsl:apply-templates/></fo:inline>
3962
4168
  </xsl:template><xsl:template name="convertDate">
3963
4169
  <xsl:param name="date"/>
3964
4170
  <xsl:param name="format" select="'short'"/>
@@ -3983,6 +4189,57 @@
3983
4189
  </xsl:variable>
3984
4190
  <xsl:variable name="result">
3985
4191
  <xsl:choose>
4192
+ <xsl:when test="$format = 'ddMMyyyy'">
4193
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4194
+ <xsl:text> </xsl:text>
4195
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4196
+ </xsl:when>
4197
+ <xsl:when test="$format = 'ddMM'">
4198
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4199
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4200
+ </xsl:when>
4201
+ <xsl:when test="$format = 'short' or $day = ''">
4202
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
4203
+ </xsl:when>
4204
+ <xsl:otherwise>
4205
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
4206
+ </xsl:otherwise>
4207
+ </xsl:choose>
4208
+ </xsl:variable>
4209
+ <xsl:value-of select="$result"/>
4210
+ </xsl:template><xsl:template name="convertDateLocalized">
4211
+ <xsl:param name="date"/>
4212
+ <xsl:param name="format" select="'short'"/>
4213
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
4214
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
4215
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
4216
+ <xsl:variable name="monthStr">
4217
+ <xsl:choose>
4218
+ <xsl:when test="$month = '01'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_january</xsl:with-param></xsl:call-template></xsl:when>
4219
+ <xsl:when test="$month = '02'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_february</xsl:with-param></xsl:call-template></xsl:when>
4220
+ <xsl:when test="$month = '03'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_march</xsl:with-param></xsl:call-template></xsl:when>
4221
+ <xsl:when test="$month = '04'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_april</xsl:with-param></xsl:call-template></xsl:when>
4222
+ <xsl:when test="$month = '05'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_may</xsl:with-param></xsl:call-template></xsl:when>
4223
+ <xsl:when test="$month = '06'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_june</xsl:with-param></xsl:call-template></xsl:when>
4224
+ <xsl:when test="$month = '07'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_july</xsl:with-param></xsl:call-template></xsl:when>
4225
+ <xsl:when test="$month = '08'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_august</xsl:with-param></xsl:call-template></xsl:when>
4226
+ <xsl:when test="$month = '09'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_september</xsl:with-param></xsl:call-template></xsl:when>
4227
+ <xsl:when test="$month = '10'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_october</xsl:with-param></xsl:call-template></xsl:when>
4228
+ <xsl:when test="$month = '11'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_november</xsl:with-param></xsl:call-template></xsl:when>
4229
+ <xsl:when test="$month = '12'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_december</xsl:with-param></xsl:call-template></xsl:when>
4230
+ </xsl:choose>
4231
+ </xsl:variable>
4232
+ <xsl:variable name="result">
4233
+ <xsl:choose>
4234
+ <xsl:when test="$format = 'ddMMyyyy'">
4235
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4236
+ <xsl:text> </xsl:text>
4237
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4238
+ </xsl:when>
4239
+ <xsl:when test="$format = 'ddMM'">
4240
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4241
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4242
+ </xsl:when>
3986
4243
  <xsl:when test="$format = 'short' or $day = ''">
3987
4244
  <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
3988
4245
  </xsl:when>
@@ -3998,7 +4255,7 @@
3998
4255
  <xsl:param name="charDelim" select="', '"/>
3999
4256
  <xsl:choose>
4000
4257
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
4001
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4258
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4002
4259
  <xsl:sort data-type="text" order="ascending"/>
4003
4260
  <xsl:call-template name="insertKeyword">
4004
4261
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -4007,7 +4264,7 @@
4007
4264
  </xsl:for-each>
4008
4265
  </xsl:when>
4009
4266
  <xsl:otherwise>
4010
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4267
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4011
4268
  <xsl:call-template name="insertKeyword">
4012
4269
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
4013
4270
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -4024,6 +4281,9 @@
4024
4281
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
4025
4282
  </xsl:choose>
4026
4283
  </xsl:template><xsl:template name="addPDFUAmeta">
4284
+ <xsl:variable name="lang">
4285
+ <xsl:call-template name="getLang"/>
4286
+ </xsl:variable>
4027
4287
  <fo:declarations>
4028
4288
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4029
4289
  <pdf:dictionary type="normal" key="ViewerPreferences">
@@ -4036,13 +4296,16 @@
4036
4296
  <!-- Dublin Core properties go here -->
4037
4297
  <dc:title>
4038
4298
  <xsl:variable name="title">
4039
-
4040
-
4041
-
4042
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/>
4043
-
4044
-
4045
-
4299
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4300
+
4301
+
4302
+
4303
+
4304
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
4305
+
4306
+
4307
+
4308
+ </xsl:for-each>
4046
4309
  </xsl:variable>
4047
4310
  <xsl:choose>
4048
4311
  <xsl:when test="normalize-space($title) != ''">
@@ -4054,15 +4317,14 @@
4054
4317
  </xsl:choose>
4055
4318
  </dc:title>
4056
4319
  <dc:creator>
4057
-
4058
-
4059
-
4060
- </dc:creator>
4061
- <dc:description>
4062
- <xsl:variable name="abstract">
4320
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4063
4321
 
4064
4322
 
4065
4323
 
4324
+ </xsl:for-each>
4325
+ </dc:creator>
4326
+ <dc:description>
4327
+ <xsl:variable name="abstract">
4066
4328
 
4067
4329
 
4068
4330
  </xsl:variable>
@@ -4175,6 +4437,7 @@
4175
4437
  <xsl:value-of select="document('')//*/namespace::mpfd"/>
4176
4438
 
4177
4439
 
4440
+
4178
4441
  </xsl:variable>
4179
4442
  <xsl:if test="$documentNS != $XSLNS">
4180
4443
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -4234,6 +4497,11 @@
4234
4497
  <xsl:call-template name="getLang"/>
4235
4498
  </xsl:variable>
4236
4499
 
4237
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4500
+ <xsl:choose>
4501
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
4502
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4503
+ </xsl:when>
4504
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
4505
+ </xsl:choose>
4238
4506
 
4239
4507
  </xsl:template></xsl:stylesheet>