metanorma-m3aawg 1.6.1 → 1.6.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f84f973356ac7c4ca74d8de8bf396e489138c21c99a834b51603cf023cab4e7
4
- data.tar.gz: 789266aa27ac878f84b2f2e4deb24e3a6b8f76c0c5b035f1833b6262f1289f03
3
+ metadata.gz: bcd3ba861b70713d5782bc66f4e12a8c6f4c327ab4eb16d43232121d01236dc4
4
+ data.tar.gz: 6546e0efcec8cd0680d673272fc0567e4a77c8adad1abfb0c2996ff7b43b64c4
5
5
  SHA512:
6
- metadata.gz: e6800596bc0ca96196cea33adf9e15a79aa0f1bdef3f25bbf49dc36cc2b6ec79ce885b05aa8287581d932ef0026dcf5f885680b2b0782a046af13d8bcea6fbaf
7
- data.tar.gz: e8e0ea2e46bfe48c00ec4fddd87b7fc52b4d7921ef358e45089e02a8f3979b1da94b61758d5d48ff28111ef718355f072f5b725f202d3bf46ea2e329142f0806
6
+ metadata.gz: 5e49aef4506a2c960771a0adf10c8be34722c24f195645e333e807529841ddbe3967ca608780bfb7edfa1d443177a96851c2964c86e348ac99d392c79b747418
7
+ data.tar.gz: e10a71799bad6095866ccf96f2a2544d761a2069572c577d3fbc999d6ff02f63e02d80a357028f8ad5576366082046411a364c7a8ef086b56d1deb4730254e52
@@ -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
data/.rubocop.yml CHANGED
@@ -4,7 +4,3 @@
4
4
 
5
5
  inherit_from:
6
6
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
- AllCops:
8
- TargetRubyVersion: 2.3
9
- Rails:
10
- Enabled: true
@@ -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>
@@ -218,55 +218,89 @@
218
218
  </xsl:call-template>
219
219
  </xsl:variable>
220
220
  <fo:block font-size="12pt" font-weight="bold" text-decoration="underline" margin-bottom="4pt"><xsl:value-of select="$title-toc"/></fo:block>
221
- <fo:table table-layout="fixed" width="100%" font-size="10pt">
222
- <fo:table-column column-width="25mm"/>
223
- <fo:table-column column-width="155mm"/>
224
- <fo:table-body>
225
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
226
- <fo:table-row height="6mm">
227
- <fo:table-cell>
228
- <fo:block font-weight="bold">
229
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
230
- <xsl:choose>
231
- <xsl:when test="@section = ''">
232
- <xsl:apply-templates select="title"/>
233
- </xsl:when>
234
- <xsl:when test="@type = 'references' and @section = ''">
235
- <xsl:apply-templates select="title"/>
236
- </xsl:when>
237
- <xsl:when test="@level = 1">
238
- <xsl:value-of select="@section"/>
239
- </xsl:when>
240
- <xsl:otherwise/>
241
- </xsl:choose>
242
- </fo:basic-link>
243
- </fo:block>
244
- </fo:table-cell>
245
- <fo:table-cell>
246
- <fo:block text-align-last="justify">
247
- <xsl:if test="@level = 1">
248
- <xsl:attribute name="font-weight">bold</xsl:attribute>
249
- </xsl:if>
250
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
251
- <xsl:choose>
252
- <xsl:when test="@section = ''"/>
253
- <xsl:when test="@type = 'references' and @section = ''"/>
254
- <xsl:otherwise>
255
- <xsl:apply-templates select="title"/>
256
- </xsl:otherwise>
257
- </xsl:choose>
258
-
259
- <fo:inline keep-together.within-line="always">
260
- <fo:leader font-weight="normal" leader-pattern="dots"/>
261
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
262
- </fo:inline>
263
- </fo:basic-link>
264
- </fo:block>
265
- </fo:table-cell>
266
- </fo:table-row>
267
- </xsl:for-each>
268
- </fo:table-body>
269
- </fo:table>
221
+ <fo:block font-size="10pt">
222
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
223
+ <xsl:choose>
224
+ <xsl:when test="@section = ''">
225
+ <fo:table table-layout="fixed" width="100%">
226
+ <fo:table-column column-width="180mm"/>
227
+ <fo:table-body>
228
+ <fo:table-row height="6mm">
229
+ <fo:table-cell>
230
+ <fo:block text-align-last="justify">
231
+ <xsl:if test="@level = 1">
232
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
233
+ </xsl:if>
234
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
235
+ <fo:inline font-weight="bold">
236
+ <xsl:apply-templates select="title"/><xsl:text> </xsl:text>
237
+ </fo:inline>
238
+ <fo:inline keep-together.within-line="always">
239
+ <fo:leader font-weight="normal" leader-pattern="dots"/>
240
+ <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
241
+ </fo:inline>
242
+ </fo:basic-link>
243
+ </fo:block>
244
+ </fo:table-cell>
245
+ </fo:table-row>
246
+ </fo:table-body>
247
+ </fo:table>
248
+ </xsl:when>
249
+ <xsl:otherwise>
250
+ <fo:table table-layout="fixed" width="100%">
251
+ <fo:table-column column-width="5mm"/> <!-- 25mm -->
252
+ <fo:table-column column-width="175mm"/> <!-- 155mm -->
253
+ <fo:table-body>
254
+ <fo:table-row height="6mm">
255
+ <fo:table-cell>
256
+ <fo:block font-weight="bold">
257
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
258
+ <xsl:choose>
259
+ <!-- <xsl:when test="@section = ''">
260
+ <xsl:apply-templates select="title"/>
261
+ </xsl:when> -->
262
+ <!-- <xsl:when test="@type = 'references' and @section = ''">
263
+ <xsl:apply-templates select="title"/>
264
+ </xsl:when> -->
265
+ <xsl:when test="@level = 1">
266
+ <xsl:value-of select="@section"/>
267
+ </xsl:when>
268
+ <xsl:otherwise/>
269
+ </xsl:choose>
270
+ </fo:basic-link>
271
+ </fo:block>
272
+ </fo:table-cell>
273
+ <fo:table-cell>
274
+ <fo:block text-align-last="justify">
275
+ <xsl:if test="@level = 1">
276
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
277
+ </xsl:if>
278
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
279
+ <!-- <xsl:choose>
280
+ <xsl:when test="@section = ''"></xsl:when>
281
+ <xsl:otherwise>
282
+ <xsl:apply-templates select="title"/>
283
+ </xsl:otherwise>
284
+ </xsl:choose> -->
285
+ <xsl:apply-templates select="title"/><xsl:text> </xsl:text>
286
+ <fo:inline keep-together.within-line="always">
287
+ <fo:leader font-weight="normal" leader-pattern="dots"/>
288
+ <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
289
+ </fo:inline>
290
+ </fo:basic-link>
291
+ </fo:block>
292
+ </fo:table-cell>
293
+ </fo:table-row>
294
+ </fo:table-body>
295
+ </fo:table>
296
+ </xsl:otherwise>
297
+
298
+ </xsl:choose>
299
+
300
+
301
+
302
+ </xsl:for-each>
303
+ </fo:block>
270
304
  </fo:block-container>
271
305
 
272
306
  <fo:block break-after="page"/>
@@ -365,7 +399,7 @@
365
399
  <xsl:otherwise> <!-- for ordered lists -->
366
400
  <xsl:choose>
367
401
  <xsl:when test="../@type = 'arabic'">
368
- <xsl:number format="a)"/>
402
+ <xsl:number format="a)" lang="en"/>
369
403
  </xsl:when>
370
404
  <xsl:when test="../@type = 'alphabet'">
371
405
  <xsl:number format="1)"/>
@@ -1235,6 +1269,7 @@
1235
1269
 
1236
1270
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1237
1271
 
1272
+
1238
1273
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1239
1274
 
1240
1275
 
@@ -1246,6 +1281,7 @@
1246
1281
 
1247
1282
 
1248
1283
 
1284
+
1249
1285
  </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1250
1286
 
1251
1287
 
@@ -1380,177 +1416,229 @@
1380
1416
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1381
1417
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
1382
1418
  <xsl:call-template name="add-zero-spaces-java"/>
1383
- </xsl:template><xsl:template match="*[local-name()='table']">
1419
+ </xsl:template><xsl:template match="*[local-name()='table']" name="table">
1384
1420
 
1385
- <xsl:variable name="simple-table">
1386
- <xsl:call-template name="getSimpleTable"/>
1387
- </xsl:variable>
1421
+ <xsl:variable name="table">
1388
1422
 
1389
-
1390
-
1391
-
1392
-
1393
- <!-- <xsl:if test="$namespace = 'bipm'">
1394
- <fo:block>&#xA0;</fo:block>
1395
- </xsl:if> -->
1396
-
1397
- <!-- $namespace = 'iso' or -->
1398
-
1399
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1400
-
1401
-
1402
-
1403
- <xsl:call-template name="fn_name_display"/>
1423
+ <xsl:variable name="simple-table">
1424
+ <xsl:call-template name="getSimpleTable"/>
1425
+ </xsl:variable>
1404
1426
 
1405
1427
 
1406
-
1407
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1408
-
1409
- <!-- <xsl:variable name="cols-count">
1410
- <xsl:choose>
1411
- <xsl:when test="*[local-name()='thead']">
1412
- <xsl:call-template name="calculate-columns-numbers">
1413
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1414
- </xsl:call-template>
1415
- </xsl:when>
1416
- <xsl:otherwise>
1417
- <xsl:call-template name="calculate-columns-numbers">
1418
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1419
- </xsl:call-template>
1420
- </xsl:otherwise>
1421
- </xsl:choose>
1422
- </xsl:variable> -->
1423
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1424
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1425
-
1426
-
1427
-
1428
- <xsl:variable name="colwidths">
1429
- <xsl:call-template name="calculate-column-widths">
1430
- <xsl:with-param name="cols-count" select="$cols-count"/>
1431
- <xsl:with-param name="table" select="$simple-table"/>
1432
- </xsl:call-template>
1433
- </xsl:variable>
1434
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1435
-
1436
- <!-- <xsl:variable name="colwidths2">
1437
- <xsl:call-template name="calculate-column-widths">
1438
- <xsl:with-param name="cols-count" select="$cols-count"/>
1439
- </xsl:call-template>
1440
- </xsl:variable> -->
1441
-
1442
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1443
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
1444
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1445
-
1446
- <xsl:variable name="margin-left">
1447
- <xsl:choose>
1448
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1449
- <xsl:otherwise>0</xsl:otherwise>
1450
- </xsl:choose>
1451
- </xsl:variable>
1452
-
1453
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1454
1428
 
1455
1429
 
1456
-
1457
-
1458
-
1459
1430
 
1431
+ <!-- <xsl:if test="$namespace = 'bipm'">
1432
+ <fo:block>&#xA0;</fo:block>
1433
+ </xsl:if> -->
1460
1434
 
1461
-
1435
+ <!-- $namespace = 'iso' or -->
1462
1436
 
1437
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1463
1438
 
1439
+
1464
1440
 
1441
+ <xsl:call-template name="fn_name_display"/>
1465
1442
 
1443
+
1466
1444
 
1445
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1467
1446
 
1447
+ <!-- <xsl:variable name="cols-count">
1448
+ <xsl:choose>
1449
+ <xsl:when test="*[local-name()='thead']">
1450
+ <xsl:call-template name="calculate-columns-numbers">
1451
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1452
+ </xsl:call-template>
1453
+ </xsl:when>
1454
+ <xsl:otherwise>
1455
+ <xsl:call-template name="calculate-columns-numbers">
1456
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1457
+ </xsl:call-template>
1458
+ </xsl:otherwise>
1459
+ </xsl:choose>
1460
+ </xsl:variable> -->
1461
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1462
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1463
+
1464
+
1465
+
1466
+ <xsl:variable name="colwidths">
1467
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1468
+ <xsl:call-template name="calculate-column-widths">
1469
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1470
+ <xsl:with-param name="table" select="$simple-table"/>
1471
+ </xsl:call-template>
1472
+ </xsl:if>
1473
+ </xsl:variable>
1474
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1475
+
1476
+ <!-- <xsl:variable name="colwidths2">
1477
+ <xsl:call-template name="calculate-column-widths">
1478
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1479
+ </xsl:call-template>
1480
+ </xsl:variable> -->
1481
+
1482
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1483
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1484
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1485
+
1486
+ <xsl:variable name="margin-left">
1487
+ <xsl:choose>
1488
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1489
+ <xsl:otherwise>0</xsl:otherwise>
1490
+ </xsl:choose>
1491
+ </xsl:variable>
1468
1492
 
1469
- <xsl:variable name="table_attributes">
1470
- <attribute name="table-layout">fixed</attribute>
1471
- <attribute name="width">100%</attribute>
1472
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1473
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1493
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1474
1494
 
1475
1495
 
1496
+
1497
+
1498
+
1476
1499
 
1477
1500
 
1478
-
1479
-
1480
-
1501
+
1502
+
1481
1503
 
1482
-
1483
1504
 
1484
- </xsl:variable>
1485
-
1486
-
1487
- <fo:table id="{@id}" table-omit-footer-at-break="true">
1488
1505
 
1489
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1490
- <xsl:attribute name="{@name}">
1491
- <xsl:value-of select="."/>
1492
- </xsl:attribute>
1493
- </xsl:for-each>
1494
1506
 
1495
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1496
- <xsl:if test="$isNoteOrFnExist = 'true'">
1497
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1498
- </xsl:if>
1499
1507
 
1500
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1508
+ <xsl:variable name="table_width">
1509
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1510
+ 100%
1511
+
1512
+
1513
+ </xsl:variable>
1514
+
1515
+ <xsl:variable name="table_attributes">
1516
+ <attribute name="table-layout">fixed</attribute>
1517
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
1518
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1519
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1520
+
1521
+
1522
+
1523
+
1524
+
1525
+
1526
+
1527
+
1528
+
1529
+
1530
+ </xsl:variable>
1531
+
1532
+
1533
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1534
+
1535
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1536
+ <xsl:attribute name="{@name}">
1537
+ <xsl:value-of select="."/>
1538
+ </xsl:attribute>
1539
+ </xsl:for-each>
1540
+
1541
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1542
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1543
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1544
+ </xsl:if>
1545
+
1501
1546
  <xsl:choose>
1502
- <xsl:when test=". = 1 or . = 0">
1503
- <fo:table-column column-width="proportional-column-width(2)"/>
1547
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1548
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1549
+ <fo:table-column column-width="{@width}"/>
1550
+ </xsl:for-each>
1504
1551
  </xsl:when>
1505
1552
  <xsl:otherwise>
1506
- <fo:table-column column-width="proportional-column-width({.})"/>
1553
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1554
+ <xsl:choose>
1555
+ <xsl:when test=". = 1 or . = 0">
1556
+ <fo:table-column column-width="proportional-column-width(2)"/>
1557
+ </xsl:when>
1558
+ <xsl:otherwise>
1559
+ <fo:table-column column-width="proportional-column-width({.})"/>
1560
+ </xsl:otherwise>
1561
+ </xsl:choose>
1562
+ </xsl:for-each>
1507
1563
  </xsl:otherwise>
1508
1564
  </xsl:choose>
1509
- </xsl:for-each>
1510
-
1511
- <xsl:choose>
1512
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1513
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1514
- </xsl:when>
1515
- <xsl:otherwise>
1516
- <xsl:apply-templates/>
1517
- </xsl:otherwise>
1518
- </xsl:choose>
1519
-
1520
- </fo:table>
1521
-
1522
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1523
- <xsl:call-template name="insertTableFooterInSeparateTable">
1524
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
1525
- <xsl:with-param name="colwidths" select="$colwidths"/>
1526
- </xsl:call-template>
1527
- </xsl:for-each>
1528
-
1529
- <!-- insert footer as table -->
1530
- <!-- <fo:table>
1531
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1532
- <xsl:attribute name="{@name}">
1533
- <xsl:value-of select="."/>
1534
- </xsl:attribute>
1535
- </xsl:for-each>
1536
-
1537
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1565
+
1538
1566
  <xsl:choose>
1539
- <xsl:when test=". = 1 or . = 0">
1540
- <fo:table-column column-width="proportional-column-width(2)"/>
1567
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1568
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1541
1569
  </xsl:when>
1542
1570
  <xsl:otherwise>
1543
- <fo:table-column column-width="proportional-column-width({.})"/>
1571
+ <xsl:apply-templates/>
1544
1572
  </xsl:otherwise>
1545
1573
  </xsl:choose>
1574
+
1575
+ </fo:table>
1576
+
1577
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1578
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1579
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1580
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1581
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1582
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1583
+ </xsl:call-template>
1546
1584
  </xsl:for-each>
1547
- </fo:table>-->
1548
-
1549
-
1550
-
1551
-
1552
-
1553
- </fo:block-container>
1585
+
1586
+ <!-- insert footer as table -->
1587
+ <!-- <fo:table>
1588
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1589
+ <xsl:attribute name="{@name}">
1590
+ <xsl:value-of select="."/>
1591
+ </xsl:attribute>
1592
+ </xsl:for-each>
1593
+
1594
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1595
+ <xsl:choose>
1596
+ <xsl:when test=". = 1 or . = 0">
1597
+ <fo:table-column column-width="proportional-column-width(2)"/>
1598
+ </xsl:when>
1599
+ <xsl:otherwise>
1600
+ <fo:table-column column-width="proportional-column-width({.})"/>
1601
+ </xsl:otherwise>
1602
+ </xsl:choose>
1603
+ </xsl:for-each>
1604
+ </fo:table>-->
1605
+
1606
+
1607
+
1608
+
1609
+
1610
+ </fo:block-container>
1611
+ </xsl:variable>
1612
+
1613
+
1614
+
1615
+ <xsl:choose>
1616
+ <xsl:when test="@width">
1617
+
1618
+ <!-- centered table when table name is centered (see table-name-style) -->
1619
+
1620
+ <fo:table table-layout="fixed" width="100%">
1621
+ <fo:table-column column-width="proportional-column-width(1)"/>
1622
+ <fo:table-column column-width="{@width}"/>
1623
+ <fo:table-column column-width="proportional-column-width(1)"/>
1624
+ <fo:table-body>
1625
+ <fo:table-row>
1626
+ <fo:table-cell column-number="2">
1627
+ <fo:block><xsl:copy-of select="$table"/></fo:block>
1628
+ </fo:table-cell>
1629
+ </fo:table-row>
1630
+ </fo:table-body>
1631
+ </fo:table>
1632
+
1633
+
1634
+
1635
+
1636
+ </xsl:when>
1637
+ <xsl:otherwise>
1638
+ <xsl:copy-of select="$table"/>
1639
+ </xsl:otherwise>
1640
+ </xsl:choose>
1641
+
1554
1642
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1555
1643
  <xsl:if test="normalize-space() != ''">
1556
1644
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -1776,12 +1864,22 @@
1776
1864
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1777
1865
  <xsl:param name="table_attributes"/>
1778
1866
  <xsl:param name="colwidths"/>
1867
+ <xsl:param name="colgroup"/>
1779
1868
 
1780
1869
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1781
1870
 
1782
1871
  <xsl:if test="$isNoteOrFnExist = 'true'">
1783
1872
 
1784
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1873
+ <xsl:variable name="cols-count">
1874
+ <xsl:choose>
1875
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1876
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
1877
+ </xsl:when>
1878
+ <xsl:otherwise>
1879
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
1880
+ </xsl:otherwise>
1881
+ </xsl:choose>
1882
+ </xsl:variable>
1785
1883
 
1786
1884
  <fo:table keep-with-previous="always">
1787
1885
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -1799,16 +1897,25 @@
1799
1897
  </xsl:choose>
1800
1898
  </xsl:for-each>
1801
1899
 
1802
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1803
- <xsl:choose>
1804
- <xsl:when test=". = 1 or . = 0">
1805
- <fo:table-column column-width="proportional-column-width(2)"/>
1806
- </xsl:when>
1807
- <xsl:otherwise>
1808
- <fo:table-column column-width="proportional-column-width({.})"/>
1809
- </xsl:otherwise>
1810
- </xsl:choose>
1811
- </xsl:for-each>
1900
+ <xsl:choose>
1901
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1902
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
1903
+ <fo:table-column column-width="{@width}"/>
1904
+ </xsl:for-each>
1905
+ </xsl:when>
1906
+ <xsl:otherwise>
1907
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1908
+ <xsl:choose>
1909
+ <xsl:when test=". = 1 or . = 0">
1910
+ <fo:table-column column-width="proportional-column-width(2)"/>
1911
+ </xsl:when>
1912
+ <xsl:otherwise>
1913
+ <fo:table-column column-width="proportional-column-width({.})"/>
1914
+ </xsl:otherwise>
1915
+ </xsl:choose>
1916
+ </xsl:for-each>
1917
+ </xsl:otherwise>
1918
+ </xsl:choose>
1812
1919
 
1813
1920
  <fo:table-body>
1814
1921
  <fo:table-row>
@@ -2210,7 +2317,9 @@
2210
2317
  </xsl:template><xsl:template match="*[local-name()='dl']">
2211
2318
  <fo:block-container>
2212
2319
 
2213
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2320
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2321
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2322
+ </xsl:if>
2214
2323
 
2215
2324
 
2216
2325
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -2225,6 +2334,7 @@
2225
2334
  <fo:block-container>
2226
2335
 
2227
2336
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2337
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2228
2338
 
2229
2339
 
2230
2340
  <xsl:variable name="parent" select="local-name(..)"/>
@@ -2341,7 +2451,7 @@
2341
2451
  <xsl:with-param name="table" select="$html-table"/>
2342
2452
  </xsl:call-template>
2343
2453
  </xsl:variable>
2344
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2454
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2345
2455
  <xsl:variable name="maxlength_dt">
2346
2456
  <xsl:call-template name="getMaxLength_dt"/>
2347
2457
  </xsl:variable>
@@ -2370,13 +2480,22 @@
2370
2480
  </xsl:when>
2371
2481
  <xsl:otherwise>
2372
2482
  <xsl:choose>
2483
+ <!-- to set width check most wide chars like `W` -->
2373
2484
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
2374
- <fo:table-column column-width="5%"/>
2375
- <fo:table-column column-width="95%"/>
2485
+ <fo:table-column column-width="7%"/>
2486
+ <fo:table-column column-width="93%"/>
2487
+ </xsl:when>
2488
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
2489
+ <fo:table-column column-width="15%"/>
2490
+ <fo:table-column column-width="85%"/>
2376
2491
  </xsl:when>
2377
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
2378
- <fo:table-column column-width="10%"/>
2379
- <fo:table-column column-width="90%"/>
2492
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
2493
+ <fo:table-column column-width="20%"/>
2494
+ <fo:table-column column-width="80%"/>
2495
+ </xsl:when>
2496
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
2497
+ <fo:table-column column-width="25%"/>
2498
+ <fo:table-column column-width="75%"/>
2380
2499
  </xsl:when>
2381
2500
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
2382
2501
  <fo:table-column column-width="60%"/>
@@ -2408,12 +2527,32 @@
2408
2527
  </xsl:otherwise>
2409
2528
  </xsl:choose>
2410
2529
  </xsl:template><xsl:template name="getMaxLength_dt">
2411
- <xsl:for-each select="*[local-name()='dt']">
2412
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2413
- <xsl:if test="position() = 1">
2414
- <xsl:value-of select="string-length(normalize-space(.))"/>
2415
- </xsl:if>
2416
- </xsl:for-each>
2530
+ <xsl:variable name="lengths">
2531
+ <xsl:for-each select="*[local-name()='dt']">
2532
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
2533
+ <xsl:variable name="attributes">
2534
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
2535
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
2536
+ </xsl:variable>
2537
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
2538
+ </xsl:for-each>
2539
+ </xsl:variable>
2540
+ <xsl:variable name="maxLength">
2541
+ <!-- <xsl:for-each select="*[local-name()='dt']">
2542
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2543
+ <xsl:if test="position() = 1">
2544
+ <xsl:value-of select="string-length(normalize-space(.))"/>
2545
+ </xsl:if>
2546
+ </xsl:for-each> -->
2547
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
2548
+ <xsl:sort select="." data-type="number" order="descending"/>
2549
+ <xsl:if test="position() = 1">
2550
+ <xsl:value-of select="."/>
2551
+ </xsl:if>
2552
+ </xsl:for-each>
2553
+ </xsl:variable>
2554
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
2555
+ <xsl:value-of select="$maxLength"/>
2417
2556
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2418
2557
  <xsl:param name="key_iso"/>
2419
2558
 
@@ -2547,6 +2686,7 @@
2547
2686
 
2548
2687
 
2549
2688
 
2689
+
2550
2690
  <xsl:choose>
2551
2691
  <xsl:when test="not(ancestor::*[local-name()='note'])">10</xsl:when>
2552
2692
  <xsl:otherwise>11</xsl:otherwise>
@@ -2570,6 +2710,10 @@
2570
2710
  </xsl:if>
2571
2711
  <xsl:apply-templates/>
2572
2712
  </fo:inline>
2713
+ </xsl:template><xsl:template match="*[local-name()='underline']">
2714
+ <fo:inline text-decoration="underline">
2715
+ <xsl:apply-templates/>
2716
+ </fo:inline>
2573
2717
  </xsl:template><xsl:template match="*[local-name()='del']">
2574
2718
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2575
2719
  <xsl:apply-templates/>
@@ -2663,6 +2807,10 @@
2663
2807
  <xsl:param name="text" select="."/>
2664
2808
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2665
2809
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
2810
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
2811
+ <xsl:param name="text" select="."/>
2812
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2813
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
2666
2814
  </xsl:template><xsl:template name="add-zero-spaces">
2667
2815
  <xsl:param name="text" select="."/>
2668
2816
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -2923,6 +3071,11 @@
2923
3071
  <!-- replace start and end spaces to non-break space -->
2924
3072
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
2925
3073
  </xsl:copy>
3074
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3075
+ <xsl:copy>
3076
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
3077
+ </xsl:copy>
3078
+ <mathml:mspace width="0.5ex"/>
2926
3079
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2927
3080
  <xsl:variable name="target">
2928
3081
  <xsl:choose>
@@ -2944,7 +3097,10 @@
2944
3097
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
2945
3098
  <xsl:choose>
2946
3099
  <xsl:when test="normalize-space(.) = ''">
2947
- <xsl:value-of select="$target"/>
3100
+ <!-- <xsl:value-of select="$target"/> -->
3101
+ <xsl:call-template name="add-zero-spaces-link-java">
3102
+ <xsl:with-param name="text" select="$target"/>
3103
+ </xsl:call-template>
2948
3104
  </xsl:when>
2949
3105
  <xsl:otherwise>
2950
3106
  <xsl:apply-templates/>
@@ -3152,7 +3308,7 @@
3152
3308
  </xsl:if> -->
3153
3309
  </fo:inline>
3154
3310
  </xsl:if>
3155
- </xsl:template><xsl:template match="*[local-name() = 'figure']">
3311
+ </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
3156
3312
  <fo:block-container id="{@id}">
3157
3313
 
3158
3314
  <fo:block>
@@ -3221,6 +3377,8 @@
3221
3377
  <xsl:variable name="bookmark-title_">
3222
3378
  <xsl:call-template name="getLangVersion">
3223
3379
  <xsl:with-param name="lang" select="@lang"/>
3380
+ <xsl:with-param name="doctype" select="@doctype"/>
3381
+ <xsl:with-param name="title" select="@title-part"/>
3224
3382
  </xsl:call-template>
3225
3383
  </xsl:variable>
3226
3384
  <xsl:choose>
@@ -3238,13 +3396,34 @@
3238
3396
  </xsl:choose>
3239
3397
  </fo:bookmark-title>
3240
3398
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3399
+
3400
+ <xsl:call-template name="insertFigureBookmarks">
3401
+ <xsl:with-param name="contents" select="contents"/>
3402
+ </xsl:call-template>
3403
+
3404
+ <xsl:call-template name="insertTableBookmarks">
3405
+ <xsl:with-param name="contents" select="contents"/>
3406
+ <xsl:with-param name="lang" select="@lang"/>
3407
+ </xsl:call-template>
3408
+
3241
3409
  </fo:bookmark>
3242
3410
 
3243
3411
  </xsl:for-each>
3244
3412
  </xsl:when>
3245
3413
  <xsl:otherwise>
3246
3414
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3415
+
3247
3416
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3417
+
3418
+ <xsl:call-template name="insertFigureBookmarks">
3419
+ <xsl:with-param name="contents" select="contents"/>
3420
+ </xsl:call-template>
3421
+
3422
+ <xsl:call-template name="insertTableBookmarks">
3423
+ <xsl:with-param name="contents" select="contents"/>
3424
+ <xsl:with-param name="lang" select="@lang"/>
3425
+ </xsl:call-template>
3426
+
3248
3427
  </xsl:for-each>
3249
3428
  </xsl:otherwise>
3250
3429
  </xsl:choose>
@@ -3263,8 +3442,44 @@
3263
3442
 
3264
3443
  </fo:bookmark-tree>
3265
3444
  </xsl:if>
3445
+ </xsl:template><xsl:template name="insertFigureBookmarks">
3446
+ <xsl:param name="contents"/>
3447
+ <xsl:if test="xalan:nodeset($contents)/figure">
3448
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
3449
+ <fo:bookmark-title>Figures</fo:bookmark-title>
3450
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
3451
+ <fo:bookmark internal-destination="{@id}">
3452
+ <fo:bookmark-title>
3453
+ <xsl:value-of select="normalize-space(title)"/>
3454
+ </fo:bookmark-title>
3455
+ </fo:bookmark>
3456
+ </xsl:for-each>
3457
+ </fo:bookmark>
3458
+ </xsl:if>
3459
+ </xsl:template><xsl:template name="insertTableBookmarks">
3460
+ <xsl:param name="contents"/>
3461
+ <xsl:param name="lang"/>
3462
+ <xsl:if test="xalan:nodeset($contents)/table">
3463
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
3464
+ <fo:bookmark-title>
3465
+ <xsl:choose>
3466
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
3467
+ <xsl:otherwise>Tables</xsl:otherwise>
3468
+ </xsl:choose>
3469
+ </fo:bookmark-title>
3470
+ <xsl:for-each select="xalan:nodeset($contents)/table">
3471
+ <fo:bookmark internal-destination="{@id}">
3472
+ <fo:bookmark-title>
3473
+ <xsl:value-of select="normalize-space(title)"/>
3474
+ </fo:bookmark-title>
3475
+ </fo:bookmark>
3476
+ </xsl:for-each>
3477
+ </fo:bookmark>
3478
+ </xsl:if>
3266
3479
  </xsl:template><xsl:template name="getLangVersion">
3267
3480
  <xsl:param name="lang"/>
3481
+ <xsl:param name="doctype" select="''"/>
3482
+ <xsl:param name="title" select="''"/>
3268
3483
  <xsl:choose>
3269
3484
  <xsl:when test="$lang = 'en'">
3270
3485
 
@@ -3300,6 +3515,12 @@
3300
3515
  <!-- <xsl:text> </xsl:text> -->
3301
3516
  </xsl:template><xsl:template name="getSection">
3302
3517
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3518
+ <!--
3519
+ <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
3520
+ <xsl:value-of select="."/>
3521
+ </xsl:for-each>
3522
+ -->
3523
+
3303
3524
  </xsl:template><xsl:template name="getName">
3304
3525
  <xsl:choose>
3305
3526
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -3352,6 +3573,12 @@
3352
3573
  <xsl:copy>
3353
3574
  <xsl:apply-templates mode="contents_item"/>
3354
3575
  </xsl:copy>
3576
+ </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
3577
+ <xsl:copy>
3578
+ <xsl:apply-templates mode="contents_item"/>
3579
+ </xsl:copy>
3580
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
3581
+ <xsl:copy-of select="."/>
3355
3582
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3356
3583
  <xsl:text> </xsl:text>
3357
3584
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -3377,6 +3604,7 @@
3377
3604
 
3378
3605
 
3379
3606
 
3607
+
3380
3608
 
3381
3609
 
3382
3610
 
@@ -3744,10 +3972,13 @@
3744
3972
  </xsl:if>
3745
3973
  </xsl:if>
3746
3974
 
3975
+
3747
3976
  <fo:block-container margin-left="0mm">
3748
3977
 
3749
3978
  <fo:block xsl:use-attribute-sets="quote-style">
3750
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3979
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
3980
+
3981
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
3751
3982
  </fo:block>
3752
3983
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3753
3984
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -3904,6 +4135,7 @@
3904
4135
 
3905
4136
 
3906
4137
 
4138
+
3907
4139
  <xsl:variable name="pos"><xsl:number count="m3d:sections/m3d:clause | m3d:sections/m3d:terms"/></xsl:variable>
3908
4140
  <xsl:if test="$pos &gt;= 2">
3909
4141
  <xsl:attribute name="space-before">18pt</xsl:attribute>
@@ -3919,7 +4151,7 @@
3919
4151
 
3920
4152
 
3921
4153
 
3922
- </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
4154
+ </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
3923
4155
  <fo:block break-after="page"/>
3924
4156
  <fo:block>
3925
4157
  <xsl:call-template name="setId"/>
@@ -3927,7 +4159,8 @@
3927
4159
  </fo:block>
3928
4160
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3929
4161
  <fo:block>
3930
- <xsl:call-template name="setId"/>
4162
+ <xsl:call-template name="setId"/>
4163
+
3931
4164
 
3932
4165
  <xsl:apply-templates/>
3933
4166
  </fo:block>
@@ -3992,7 +4225,8 @@
3992
4225
  <fo:table-column column-width="107mm"/>
3993
4226
  <fo:table-column column-width="15mm"/>
3994
4227
  <fo:table-body>
3995
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
4228
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
4229
+
3996
4230
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
3997
4231
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
3998
4232
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -4010,6 +4244,10 @@
4010
4244
  <fo:block><xsl:apply-templates/></fo:block>
4011
4245
  </fo:table-cell>
4012
4246
  </xsl:template><xsl:template name="processBibitem">
4247
+
4248
+
4249
+ <!-- end BIPM bibitem processing-->
4250
+
4013
4251
 
4014
4252
 
4015
4253
 
@@ -4068,6 +4306,8 @@
4068
4306
  <xsl:value-of select="translate(.,'. ','')"/>
4069
4307
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
4070
4308
  <xsl:value-of select="substring(.,1,1)"/>
4309
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
4310
+ <fo:inline><xsl:apply-templates/></fo:inline>
4071
4311
  </xsl:template><xsl:template name="convertDate">
4072
4312
  <xsl:param name="date"/>
4073
4313
  <xsl:param name="format" select="'short'"/>
@@ -4092,6 +4332,57 @@
4092
4332
  </xsl:variable>
4093
4333
  <xsl:variable name="result">
4094
4334
  <xsl:choose>
4335
+ <xsl:when test="$format = 'ddMMyyyy'">
4336
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4337
+ <xsl:text> </xsl:text>
4338
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4339
+ </xsl:when>
4340
+ <xsl:when test="$format = 'ddMM'">
4341
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4342
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4343
+ </xsl:when>
4344
+ <xsl:when test="$format = 'short' or $day = ''">
4345
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
4346
+ </xsl:when>
4347
+ <xsl:otherwise>
4348
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
4349
+ </xsl:otherwise>
4350
+ </xsl:choose>
4351
+ </xsl:variable>
4352
+ <xsl:value-of select="$result"/>
4353
+ </xsl:template><xsl:template name="convertDateLocalized">
4354
+ <xsl:param name="date"/>
4355
+ <xsl:param name="format" select="'short'"/>
4356
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
4357
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
4358
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
4359
+ <xsl:variable name="monthStr">
4360
+ <xsl:choose>
4361
+ <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>
4362
+ <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>
4363
+ <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>
4364
+ <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>
4365
+ <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>
4366
+ <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>
4367
+ <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>
4368
+ <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>
4369
+ <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>
4370
+ <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>
4371
+ <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>
4372
+ <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>
4373
+ </xsl:choose>
4374
+ </xsl:variable>
4375
+ <xsl:variable name="result">
4376
+ <xsl:choose>
4377
+ <xsl:when test="$format = 'ddMMyyyy'">
4378
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4379
+ <xsl:text> </xsl:text>
4380
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4381
+ </xsl:when>
4382
+ <xsl:when test="$format = 'ddMM'">
4383
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4384
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4385
+ </xsl:when>
4095
4386
  <xsl:when test="$format = 'short' or $day = ''">
4096
4387
  <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
4097
4388
  </xsl:when>
@@ -4107,7 +4398,7 @@
4107
4398
  <xsl:param name="charDelim" select="', '"/>
4108
4399
  <xsl:choose>
4109
4400
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
4110
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4401
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4111
4402
  <xsl:sort data-type="text" order="ascending"/>
4112
4403
  <xsl:call-template name="insertKeyword">
4113
4404
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -4116,7 +4407,7 @@
4116
4407
  </xsl:for-each>
4117
4408
  </xsl:when>
4118
4409
  <xsl:otherwise>
4119
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4410
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4120
4411
  <xsl:call-template name="insertKeyword">
4121
4412
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
4122
4413
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -4133,6 +4424,9 @@
4133
4424
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
4134
4425
  </xsl:choose>
4135
4426
  </xsl:template><xsl:template name="addPDFUAmeta">
4427
+ <xsl:variable name="lang">
4428
+ <xsl:call-template name="getLang"/>
4429
+ </xsl:variable>
4136
4430
  <fo:declarations>
4137
4431
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4138
4432
  <pdf:dictionary type="normal" key="ViewerPreferences">
@@ -4145,13 +4439,16 @@
4145
4439
  <!-- Dublin Core properties go here -->
4146
4440
  <dc:title>
4147
4441
  <xsl:variable name="title">
4148
-
4149
-
4150
-
4151
-
4152
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title']"/>
4153
-
4154
-
4442
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4443
+
4444
+
4445
+
4446
+
4447
+
4448
+ <xsl:value-of select="*[local-name() = 'title']"/>
4449
+
4450
+
4451
+ </xsl:for-each>
4155
4452
  </xsl:variable>
4156
4453
  <xsl:choose>
4157
4454
  <xsl:when test="normalize-space($title) != ''">
@@ -4163,17 +4460,21 @@
4163
4460
  </xsl:choose>
4164
4461
  </dc:title>
4165
4462
  <dc:creator>
4166
-
4167
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'organization']/*[local-name() = 'name']"/>
4168
-
4169
-
4170
-
4463
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4464
+
4465
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4466
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
4467
+ <xsl:if test="position() != last()">; </xsl:if>
4468
+ </xsl:for-each>
4469
+
4470
+
4471
+
4472
+ </xsl:for-each>
4171
4473
  </dc:creator>
4172
4474
  <dc:description>
4173
4475
  <xsl:variable name="abstract">
4174
4476
 
4175
-
4176
-
4477
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4177
4478
 
4178
4479
 
4179
4480
  </xsl:variable>
@@ -4286,6 +4587,7 @@
4286
4587
 
4287
4588
 
4288
4589
 
4590
+
4289
4591
  </xsl:variable>
4290
4592
  <xsl:if test="$documentNS != $XSLNS">
4291
4593
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -4345,6 +4647,11 @@
4345
4647
  <xsl:call-template name="getLang"/>
4346
4648
  </xsl:variable>
4347
4649
 
4348
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4650
+ <xsl:choose>
4651
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
4652
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4653
+ </xsl:when>
4654
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
4655
+ </xsl:choose>
4349
4656
 
4350
4657
  </xsl:template></xsl:stylesheet>