metanorma-iho 0.2.9 → 0.2.14

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: 69c27cc6a8527a59360a770e49deea1fe9f0a6872066e78deabebb782340093d
4
- data.tar.gz: 9365b1d5ee9e87e3686b23578e23eddecd7753892d195ea2fafee9c8ae224112
3
+ metadata.gz: 5cb49ef6f699fcc7e7491d55b57ddbca5b3a8608d5d237ffd19f38bb986ecc9c
4
+ data.tar.gz: ddf0bc2624d07c74c7243b7b4b748a2be64f5f6dc98df690bd55fe8119834680
5
5
  SHA512:
6
- metadata.gz: 9de8fea2a2b6298a624936452844dbda153f0c1c28fe36a71350770dbdbafde7e1fbe47e289c95bf7e4bdca6ea3e98b920927af68d760e3c661c9a6fbc9cef9e
7
- data.tar.gz: 3c108832d1c736ba8b50ce07c1aa155e134ddffba55c19af31189ecb2ded9d5c5ae35c8b89661779b85d3f74b168da15f8d0a683060876107f20f6de3ee788cb
6
+ metadata.gz: cb70f5f8a5191c5a483631278bb81f030057eaa82db66a4bd323b2bc20243953286d5925a2ddc35cd4362bdefb5dabc704e2490b9a099ed01b6ce7035b8c0c9d
7
+ data.tar.gz: c1f204b5e3445b68bb43976992c2f67559cd0ea9f3d9fae317e69f20e2a752efd57bba048dbc215c6864adb79cd0734b05df3feac704ebdd1ee387461aa9ab49
@@ -4,7 +4,7 @@ name: rake
4
4
 
5
5
  on:
6
6
  push:
7
- branches: [ master, main ]
7
+ branches: [ master, main ]
8
8
  tags: [ v* ]
9
9
  pull_request:
10
10
 
@@ -16,17 +16,17 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.6', '2.5', '2.4' ]
19
+ ruby: [ '2.7', '2.6', '2.5', '2.4' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
22
  include:
23
- - ruby: '2.7'
23
+ - ruby: '3.0'
24
24
  os: 'ubuntu-latest'
25
25
  experimental: true
26
- - ruby: '2.7'
26
+ - ruby: '3.0'
27
27
  os: 'windows-latest'
28
28
  experimental: true
29
- - ruby: '2.7'
29
+ - ruby: '3.0'
30
30
  os: 'macos-latest'
31
31
  experimental: true
32
32
  steps:
@@ -35,16 +35,7 @@ jobs:
35
35
  - uses: ruby/setup-ruby@v1
36
36
  with:
37
37
  ruby-version: ${{ matrix.ruby }}
38
-
39
- - uses: actions/cache@v2
40
- with:
41
- path: vendor/bundle
42
- key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
43
- restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
44
-
45
- - run: bundle config set path 'vendor/bundle'
46
-
47
- - run: bundle install --jobs 4 --retry 3
38
+ bundler-cache: true
48
39
 
49
40
  - name: install plantuml ubuntu
50
41
  if: matrix.os == 'ubuntu-latest'
@@ -64,3 +55,17 @@ jobs:
64
55
  run: cinst -y plantuml
65
56
 
66
57
  - run: bundle exec rake
58
+
59
+ tests-passed:
60
+ needs: rake
61
+ runs-on: ubuntu-latest
62
+ continue-on-error: true
63
+ steps:
64
+ - name: Trigger tests passed event
65
+ uses: Sibz/github-status-action@v1
66
+ with:
67
+ authToken: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
68
+ context: 'tests-passed-successfully'
69
+ description: 'Tests passed successfully'
70
+ state: 'success'
71
+ sha: ${{ github.event.pull_request.head.sha || github.sha }}
data/.rubocop.yml ADDED
@@ -0,0 +1,6 @@
1
+ # This project follows the Ribose OSS style guide.
2
+ # https://github.com/riboseinc/oss-guides
3
+ # All project-specific additions and overrides should be specified in this file.
4
+
5
+ inherit_from:
6
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
@@ -729,12 +729,29 @@
729
729
  </define>
730
730
  <define name="index">
731
731
  <element name="index">
732
- <attribute name="primary"/>
733
732
  <optional>
734
- <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>
735
748
  </optional>
736
749
  <optional>
737
- <attribute name="tertiary"/>
750
+ <element name="tertiary">
751
+ <oneOrMore>
752
+ <ref name="PureTextElement"/>
753
+ </oneOrMore>
754
+ </element>
738
755
  </optional>
739
756
  </element>
740
757
  </define>
@@ -159,6 +159,9 @@
159
159
  <zeroOrMore>
160
160
  <ref name="termdocsource"/>
161
161
  </zeroOrMore>
162
+ <optional>
163
+ <ref name="misccontainer"/>
164
+ </optional>
162
165
  <optional>
163
166
  <ref name="boilerplate"/>
164
167
  </optional>
@@ -170,6 +173,9 @@
170
173
  <ref name="annex"/>
171
174
  </zeroOrMore>
172
175
  <ref name="bibliography"/>
176
+ <zeroOrMore>
177
+ <ref name="indexsect"/>
178
+ </zeroOrMore>
173
179
  </element>
174
180
  </define>
175
181
  </grammar>
@@ -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,9 @@
246
253
  <data type="boolean"/>
247
254
  </attribute>
248
255
  </optional>
256
+ <optional>
257
+ <attribute name="width"/>
258
+ </optional>
249
259
  <optional>
250
260
  <ref name="colgroup"/>
251
261
  </optional>
@@ -779,6 +789,9 @@
779
789
  <attribute name="width"/>
780
790
  </element>
781
791
  </define>
792
+ <define name="BibItemType" combine="choice">
793
+ <value>internal</value>
794
+ </define>
782
795
  <define name="TextElement" combine="choice">
783
796
  <ref name="concept"/>
784
797
  </define>
@@ -799,6 +812,8 @@
799
812
  <ref name="requirement"/>
800
813
  <ref name="recommendation"/>
801
814
  <ref name="permission"/>
815
+ <ref name="imagemap"/>
816
+ <ref name="svgmap"/>
802
817
  </choice>
803
818
  </define>
804
819
  <define name="bibliography">
@@ -829,6 +844,9 @@
829
844
  <data type="boolean"/>
830
845
  </attribute>
831
846
  </optional>
847
+ <optional>
848
+ <attribute name="number"/>
849
+ </optional>
832
850
  <optional>
833
851
  <attribute name="obligation">
834
852
  <choice>
@@ -884,9 +902,11 @@
884
902
  <element name="code">
885
903
  <text/>
886
904
  </element>
887
- <element name="text">
888
- <text/>
889
- </element>
905
+ <optional>
906
+ <element name="text">
907
+ <text/>
908
+ </element>
909
+ </optional>
890
910
  </element>
891
911
  </define>
892
912
  <define name="standard-document">
@@ -899,6 +919,9 @@
899
919
  </choice>
900
920
  </attribute>
901
921
  <ref name="bibdata"/>
922
+ <optional>
923
+ <ref name="misccontainer"/>
924
+ </optional>
902
925
  <optional>
903
926
  <ref name="boilerplate"/>
904
927
  </optional>
@@ -909,11 +932,21 @@
909
932
  <zeroOrMore>
910
933
  <ref name="annex"/>
911
934
  </zeroOrMore>
935
+ <optional>
936
+ <ref name="bibliography"/>
937
+ </optional>
912
938
  <zeroOrMore>
913
- <ref name="references"/>
939
+ <ref name="indexsect"/>
914
940
  </zeroOrMore>
915
941
  </element>
916
942
  </define>
943
+ <define name="misccontainer">
944
+ <element name="misc-container">
945
+ <oneOrMore>
946
+ <ref name="AnyElement"/>
947
+ </oneOrMore>
948
+ </element>
949
+ </define>
917
950
  <define name="preface">
918
951
  <element name="preface">
919
952
  <oneOrMore>
@@ -937,6 +970,11 @@
937
970
  <ref name="Content-Section"/>
938
971
  </element>
939
972
  </define>
973
+ <define name="indexsect">
974
+ <element name="indexsect">
975
+ <ref name="Content-Section"/>
976
+ </element>
977
+ </define>
940
978
  <define name="boilerplate">
941
979
  <element name="boilerplate">
942
980
  <optional>
@@ -1056,6 +1094,9 @@
1056
1094
  </choice>
1057
1095
  </attribute>
1058
1096
  </optional>
1097
+ <optional>
1098
+ <attribute name="number"/>
1099
+ </optional>
1059
1100
  <optional>
1060
1101
  <attribute name="type"/>
1061
1102
  </optional>
@@ -1109,6 +1150,9 @@
1109
1150
  <optional>
1110
1151
  <attribute name="type"/>
1111
1152
  </optional>
1153
+ <optional>
1154
+ <attribute name="number"/>
1155
+ </optional>
1112
1156
  <optional>
1113
1157
  <ref name="section-title"/>
1114
1158
  </optional>
@@ -1211,6 +1255,9 @@
1211
1255
  <optional>
1212
1256
  <attribute name="type"/>
1213
1257
  </optional>
1258
+ <optional>
1259
+ <attribute name="number"/>
1260
+ </optional>
1214
1261
  <optional>
1215
1262
  <attribute name="obligation">
1216
1263
  <choice>
@@ -1539,6 +1586,7 @@
1539
1586
  <value>add</value>
1540
1587
  <value>modify</value>
1541
1588
  <value>delete</value>
1589
+ <value>replace</value>
1542
1590
  </choice>
1543
1591
  </attribute>
1544
1592
  <optional>
@@ -1569,6 +1617,11 @@
1569
1617
  </optional>
1570
1618
  <optional>
1571
1619
  <element name="newcontent">
1620
+ <optional>
1621
+ <attribute name="id">
1622
+ <data type="ID"/>
1623
+ </attribute>
1624
+ </optional>
1572
1625
  <zeroOrMore>
1573
1626
  <ref name="BasicBlock"/>
1574
1627
  </zeroOrMore>
@@ -1602,4 +1655,65 @@
1602
1655
  <text/>
1603
1656
  </element>
1604
1657
  </define>
1658
+ <define name="imagemap">
1659
+ <element name="imagemap">
1660
+ <ref name="figure"/>
1661
+ <zeroOrMore>
1662
+ <element name="area">
1663
+ <attribute name="type">
1664
+ <choice>
1665
+ <value>rect</value>
1666
+ <value>circle</value>
1667
+ <value>ellipse</value>
1668
+ <value>poly</value>
1669
+ </choice>
1670
+ </attribute>
1671
+ <choice>
1672
+ <ref name="xref"/>
1673
+ <ref name="hyperlink"/>
1674
+ <ref name="eref"/>
1675
+ </choice>
1676
+ <oneOrMore>
1677
+ <element name="coords">
1678
+ <attribute name="x">
1679
+ <data type="float"/>
1680
+ </attribute>
1681
+ <attribute name="y">
1682
+ <data type="float"/>
1683
+ </attribute>
1684
+ </element>
1685
+ </oneOrMore>
1686
+ <optional>
1687
+ <element name="radius">
1688
+ <attribute name="x">
1689
+ <data type="float"/>
1690
+ </attribute>
1691
+ <optional>
1692
+ <attribute name="y">
1693
+ <data type="float"/>
1694
+ </attribute>
1695
+ </optional>
1696
+ </element>
1697
+ </optional>
1698
+ </element>
1699
+ </zeroOrMore>
1700
+ </element>
1701
+ </define>
1702
+ <define name="svgmap">
1703
+ <element name="svgmap">
1704
+ <ref name="figure"/>
1705
+ <zeroOrMore>
1706
+ <element name="target">
1707
+ <attribute name="href">
1708
+ <data type="anyURI"/>
1709
+ </attribute>
1710
+ <choice>
1711
+ <ref name="xref"/>
1712
+ <ref name="hyperlink"/>
1713
+ <ref name="eref"/>
1714
+ </choice>
1715
+ </element>
1716
+ </zeroOrMore>
1717
+ </element>
1718
+ </define>
1605
1719
  </grammar>
@@ -1336,10 +1336,12 @@
1336
1336
 
1337
1337
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1338
1338
 
1339
+
1339
1340
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1340
1341
 
1341
1342
 
1342
1343
 
1344
+
1343
1345
 
1344
1346
  <xsl:attribute name="margin-left">12.5mm</xsl:attribute>
1345
1347
  <xsl:attribute name="margin-right">14mm</xsl:attribute>
@@ -1486,197 +1488,236 @@
1486
1488
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1487
1489
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
1488
1490
  <xsl:call-template name="add-zero-spaces-java"/>
1489
- </xsl:template><xsl:template match="*[local-name()='table']">
1491
+ </xsl:template><xsl:template match="*[local-name()='table']" name="table">
1490
1492
 
1491
- <xsl:variable name="simple-table">
1492
- <xsl:call-template name="getSimpleTable"/>
1493
- </xsl:variable>
1493
+ <xsl:variable name="table">
1494
1494
 
1495
-
1496
-
1497
-
1498
-
1499
- <!-- <xsl:if test="$namespace = 'bipm'">
1500
- <fo:block>&#xA0;</fo:block>
1501
- </xsl:if> -->
1502
-
1503
- <!-- $namespace = 'iso' or -->
1504
-
1505
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1506
-
1507
-
1508
-
1509
- <xsl:call-template name="fn_name_display"/>
1495
+ <xsl:variable name="simple-table">
1496
+ <xsl:call-template name="getSimpleTable"/>
1497
+ </xsl:variable>
1510
1498
 
1511
1499
 
1512
-
1513
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1514
-
1515
- <!-- <xsl:variable name="cols-count">
1516
- <xsl:choose>
1517
- <xsl:when test="*[local-name()='thead']">
1518
- <xsl:call-template name="calculate-columns-numbers">
1519
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1520
- </xsl:call-template>
1521
- </xsl:when>
1522
- <xsl:otherwise>
1523
- <xsl:call-template name="calculate-columns-numbers">
1524
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1525
- </xsl:call-template>
1526
- </xsl:otherwise>
1527
- </xsl:choose>
1528
- </xsl:variable> -->
1529
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1530
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1531
-
1532
-
1533
-
1534
- <xsl:variable name="colwidths">
1535
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1536
- <xsl:call-template name="calculate-column-widths">
1537
- <xsl:with-param name="cols-count" select="$cols-count"/>
1538
- <xsl:with-param name="table" select="$simple-table"/>
1539
- </xsl:call-template>
1540
- </xsl:if>
1541
- </xsl:variable>
1542
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1543
-
1544
- <!-- <xsl:variable name="colwidths2">
1545
- <xsl:call-template name="calculate-column-widths">
1546
- <xsl:with-param name="cols-count" select="$cols-count"/>
1547
- </xsl:call-template>
1548
- </xsl:variable> -->
1549
-
1550
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1551
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
1552
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1553
-
1554
- <xsl:variable name="margin-left">
1555
- <xsl:choose>
1556
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1557
- <xsl:otherwise>0</xsl:otherwise>
1558
- </xsl:choose>
1559
- </xsl:variable>
1560
-
1561
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1562
1500
 
1563
1501
 
1564
-
1565
-
1566
-
1567
1502
 
1503
+ <!-- <xsl:if test="$namespace = 'bipm'">
1504
+ <fo:block>&#xA0;</fo:block>
1505
+ </xsl:if> -->
1568
1506
 
1569
-
1507
+ <!-- $namespace = 'iso' or -->
1508
+
1509
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1510
+
1511
+
1512
+
1513
+ <xsl:call-template name="fn_name_display"/>
1514
+
1515
+
1516
+
1517
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1570
1518
 
1519
+ <!-- <xsl:variable name="cols-count">
1520
+ <xsl:choose>
1521
+ <xsl:when test="*[local-name()='thead']">
1522
+ <xsl:call-template name="calculate-columns-numbers">
1523
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1524
+ </xsl:call-template>
1525
+ </xsl:when>
1526
+ <xsl:otherwise>
1527
+ <xsl:call-template name="calculate-columns-numbers">
1528
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1529
+ </xsl:call-template>
1530
+ </xsl:otherwise>
1531
+ </xsl:choose>
1532
+ </xsl:variable> -->
1533
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1534
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1571
1535
 
1572
1536
 
1573
- <xsl:attribute name="space-after">18pt</xsl:attribute>
1574
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
1575
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
1576
1537
 
1538
+ <xsl:variable name="colwidths">
1539
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1540
+ <xsl:call-template name="calculate-column-widths">
1541
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1542
+ <xsl:with-param name="table" select="$simple-table"/>
1543
+ </xsl:call-template>
1544
+ </xsl:if>
1545
+ </xsl:variable>
1546
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1577
1547
 
1548
+ <!-- <xsl:variable name="colwidths2">
1549
+ <xsl:call-template name="calculate-column-widths">
1550
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1551
+ </xsl:call-template>
1552
+ </xsl:variable> -->
1578
1553
 
1554
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1555
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1556
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1579
1557
 
1558
+ <xsl:variable name="margin-left">
1559
+ <xsl:choose>
1560
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1561
+ <xsl:otherwise>0</xsl:otherwise>
1562
+ </xsl:choose>
1563
+ </xsl:variable>
1580
1564
 
1581
- <xsl:variable name="table_attributes">
1582
- <attribute name="table-layout">fixed</attribute>
1583
- <attribute name="width">100%</attribute>
1584
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1585
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1565
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1586
1566
 
1587
1567
 
1568
+
1569
+
1570
+
1588
1571
 
1589
1572
 
1590
-
1591
-
1592
-
1593
-
1594
- <attribute name="margin-left">0mm</attribute>
1595
- <attribute name="margin-right">0mm</attribute>
1573
+
1596
1574
 
1597
-
1598
1575
 
1599
- </xsl:variable>
1600
-
1601
-
1602
- <fo:table id="{@id}" table-omit-footer-at-break="true">
1603
1576
 
1604
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1605
- <xsl:attribute name="{@name}">
1606
- <xsl:value-of select="."/>
1607
- </xsl:attribute>
1608
- </xsl:for-each>
1577
+ <xsl:attribute name="space-after">18pt</xsl:attribute>
1578
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
1579
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
1609
1580
 
1610
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1611
- <xsl:if test="$isNoteOrFnExist = 'true'">
1612
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1613
- </xsl:if>
1614
1581
 
1615
- <xsl:choose>
1616
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1617
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1618
- <fo:table-column column-width="{@width}"/>
1619
- </xsl:for-each>
1620
- </xsl:when>
1621
- <xsl:otherwise>
1622
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1623
- <xsl:choose>
1624
- <xsl:when test=". = 1 or . = 0">
1625
- <fo:table-column column-width="proportional-column-width(2)"/>
1626
- </xsl:when>
1627
- <xsl:otherwise>
1628
- <fo:table-column column-width="proportional-column-width({.})"/>
1629
- </xsl:otherwise>
1630
- </xsl:choose>
1631
- </xsl:for-each>
1632
- </xsl:otherwise>
1633
- </xsl:choose>
1634
1582
 
1635
- <xsl:choose>
1636
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1637
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1638
- </xsl:when>
1639
- <xsl:otherwise>
1640
- <xsl:apply-templates/>
1641
- </xsl:otherwise>
1642
- </xsl:choose>
1643
1583
 
1644
- </fo:table>
1645
-
1646
- <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1647
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1648
- <xsl:call-template name="insertTableFooterInSeparateTable">
1649
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
1650
- <xsl:with-param name="colwidths" select="$colwidths"/>
1651
- <xsl:with-param name="colgroup" select="$colgroup"/>
1652
- </xsl:call-template>
1653
- </xsl:for-each>
1654
-
1655
- <!-- insert footer as table -->
1656
- <!-- <fo:table>
1657
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1658
- <xsl:attribute name="{@name}">
1659
- <xsl:value-of select="."/>
1660
- </xsl:attribute>
1661
- </xsl:for-each>
1584
+ <xsl:variable name="table_width">
1585
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1586
+ 100%
1587
+
1588
+
1589
+ </xsl:variable>
1590
+
1591
+ <xsl:variable name="table_attributes">
1592
+ <attribute name="table-layout">fixed</attribute>
1593
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
1594
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1595
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1596
+
1597
+
1598
+
1599
+
1600
+
1601
+
1602
+
1603
+
1604
+ <attribute name="margin-left">0mm</attribute>
1605
+ <attribute name="margin-right">0mm</attribute>
1606
+
1607
+
1608
+
1609
+ </xsl:variable>
1662
1610
 
1663
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1611
+
1612
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1613
+
1614
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1615
+ <xsl:attribute name="{@name}">
1616
+ <xsl:value-of select="."/>
1617
+ </xsl:attribute>
1618
+ </xsl:for-each>
1619
+
1620
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1621
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1622
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1623
+ </xsl:if>
1624
+
1664
1625
  <xsl:choose>
1665
- <xsl:when test=". = 1 or . = 0">
1666
- <fo:table-column column-width="proportional-column-width(2)"/>
1626
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1627
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1628
+ <fo:table-column column-width="{@width}"/>
1629
+ </xsl:for-each>
1667
1630
  </xsl:when>
1668
1631
  <xsl:otherwise>
1669
- <fo:table-column column-width="proportional-column-width({.})"/>
1632
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1633
+ <xsl:choose>
1634
+ <xsl:when test=". = 1 or . = 0">
1635
+ <fo:table-column column-width="proportional-column-width(2)"/>
1636
+ </xsl:when>
1637
+ <xsl:otherwise>
1638
+ <fo:table-column column-width="proportional-column-width({.})"/>
1639
+ </xsl:otherwise>
1640
+ </xsl:choose>
1641
+ </xsl:for-each>
1670
1642
  </xsl:otherwise>
1671
1643
  </xsl:choose>
1644
+
1645
+ <xsl:choose>
1646
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1647
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1648
+ </xsl:when>
1649
+ <xsl:otherwise>
1650
+ <xsl:apply-templates/>
1651
+ </xsl:otherwise>
1652
+ </xsl:choose>
1653
+
1654
+ </fo:table>
1655
+
1656
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1657
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1658
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1659
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1660
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1661
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1662
+ </xsl:call-template>
1672
1663
  </xsl:for-each>
1673
- </fo:table>-->
1674
-
1675
-
1676
-
1677
-
1678
-
1679
- </fo:block-container>
1664
+
1665
+ <!-- insert footer as table -->
1666
+ <!-- <fo:table>
1667
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1668
+ <xsl:attribute name="{@name}">
1669
+ <xsl:value-of select="."/>
1670
+ </xsl:attribute>
1671
+ </xsl:for-each>
1672
+
1673
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1674
+ <xsl:choose>
1675
+ <xsl:when test=". = 1 or . = 0">
1676
+ <fo:table-column column-width="proportional-column-width(2)"/>
1677
+ </xsl:when>
1678
+ <xsl:otherwise>
1679
+ <fo:table-column column-width="proportional-column-width({.})"/>
1680
+ </xsl:otherwise>
1681
+ </xsl:choose>
1682
+ </xsl:for-each>
1683
+ </fo:table>-->
1684
+
1685
+
1686
+
1687
+
1688
+
1689
+ </fo:block-container>
1690
+ </xsl:variable>
1691
+
1692
+
1693
+
1694
+ <xsl:choose>
1695
+ <xsl:when test="@width">
1696
+
1697
+ <!-- centered table when table name is centered (see table-name-style) -->
1698
+
1699
+ <fo:table table-layout="fixed" width="100%">
1700
+ <fo:table-column column-width="proportional-column-width(1)"/>
1701
+ <fo:table-column column-width="{@width}"/>
1702
+ <fo:table-column column-width="proportional-column-width(1)"/>
1703
+ <fo:table-body>
1704
+ <fo:table-row>
1705
+ <fo:table-cell column-number="2">
1706
+ <fo:block><xsl:copy-of select="$table"/></fo:block>
1707
+ </fo:table-cell>
1708
+ </fo:table-row>
1709
+ </fo:table-body>
1710
+ </fo:table>
1711
+
1712
+
1713
+
1714
+
1715
+ </xsl:when>
1716
+ <xsl:otherwise>
1717
+ <xsl:copy-of select="$table"/>
1718
+ </xsl:otherwise>
1719
+ </xsl:choose>
1720
+
1680
1721
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1681
1722
  <xsl:if test="normalize-space() != ''">
1682
1723
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -2362,7 +2403,9 @@
2362
2403
  </xsl:template><xsl:template match="*[local-name()='dl']">
2363
2404
  <fo:block-container>
2364
2405
 
2365
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2406
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2407
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2408
+ </xsl:if>
2366
2409
 
2367
2410
 
2368
2411
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -2377,6 +2420,7 @@
2377
2420
  <fo:block-container>
2378
2421
 
2379
2422
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2423
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2380
2424
 
2381
2425
 
2382
2426
  <xsl:variable name="parent" select="local-name(..)"/>
@@ -2497,7 +2541,7 @@
2497
2541
  <xsl:with-param name="table" select="$html-table"/>
2498
2542
  </xsl:call-template>
2499
2543
  </xsl:variable>
2500
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2544
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2501
2545
  <xsl:variable name="maxlength_dt">
2502
2546
  <xsl:call-template name="getMaxLength_dt"/>
2503
2547
  </xsl:variable>
@@ -2526,13 +2570,22 @@
2526
2570
  </xsl:when>
2527
2571
  <xsl:otherwise>
2528
2572
  <xsl:choose>
2573
+ <!-- to set width check most wide chars like `W` -->
2529
2574
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
2530
- <fo:table-column column-width="5%"/>
2531
- <fo:table-column column-width="95%"/>
2575
+ <fo:table-column column-width="7%"/>
2576
+ <fo:table-column column-width="93%"/>
2577
+ </xsl:when>
2578
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
2579
+ <fo:table-column column-width="15%"/>
2580
+ <fo:table-column column-width="85%"/>
2581
+ </xsl:when>
2582
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
2583
+ <fo:table-column column-width="20%"/>
2584
+ <fo:table-column column-width="80%"/>
2532
2585
  </xsl:when>
2533
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
2534
- <fo:table-column column-width="10%"/>
2535
- <fo:table-column column-width="90%"/>
2586
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
2587
+ <fo:table-column column-width="25%"/>
2588
+ <fo:table-column column-width="75%"/>
2536
2589
  </xsl:when>
2537
2590
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
2538
2591
  <fo:table-column column-width="60%"/>
@@ -2564,12 +2617,32 @@
2564
2617
  </xsl:otherwise>
2565
2618
  </xsl:choose>
2566
2619
  </xsl:template><xsl:template name="getMaxLength_dt">
2567
- <xsl:for-each select="*[local-name()='dt']">
2568
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2569
- <xsl:if test="position() = 1">
2570
- <xsl:value-of select="string-length(normalize-space(.))"/>
2571
- </xsl:if>
2572
- </xsl:for-each>
2620
+ <xsl:variable name="lengths">
2621
+ <xsl:for-each select="*[local-name()='dt']">
2622
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
2623
+ <xsl:variable name="attributes">
2624
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
2625
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
2626
+ </xsl:variable>
2627
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
2628
+ </xsl:for-each>
2629
+ </xsl:variable>
2630
+ <xsl:variable name="maxLength">
2631
+ <!-- <xsl:for-each select="*[local-name()='dt']">
2632
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2633
+ <xsl:if test="position() = 1">
2634
+ <xsl:value-of select="string-length(normalize-space(.))"/>
2635
+ </xsl:if>
2636
+ </xsl:for-each> -->
2637
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
2638
+ <xsl:sort select="." data-type="number" order="descending"/>
2639
+ <xsl:if test="position() = 1">
2640
+ <xsl:value-of select="."/>
2641
+ </xsl:if>
2642
+ </xsl:for-each>
2643
+ </xsl:variable>
2644
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
2645
+ <xsl:value-of select="$maxLength"/>
2573
2646
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2574
2647
  <xsl:param name="key_iso"/>
2575
2648
 
@@ -2711,6 +2784,7 @@
2711
2784
 
2712
2785
 
2713
2786
 
2787
+
2714
2788
 
2715
2789
  </xsl:variable>
2716
2790
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -2724,6 +2798,10 @@
2724
2798
  </xsl:if>
2725
2799
  <xsl:apply-templates/>
2726
2800
  </fo:inline>
2801
+ </xsl:template><xsl:template match="*[local-name()='underline']">
2802
+ <fo:inline text-decoration="underline">
2803
+ <xsl:apply-templates/>
2804
+ </fo:inline>
2727
2805
  </xsl:template><xsl:template match="*[local-name()='del']">
2728
2806
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2729
2807
  <xsl:apply-templates/>
@@ -2817,6 +2895,10 @@
2817
2895
  <xsl:param name="text" select="."/>
2818
2896
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2819
2897
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
2898
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
2899
+ <xsl:param name="text" select="."/>
2900
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2901
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
2820
2902
  </xsl:template><xsl:template name="add-zero-spaces">
2821
2903
  <xsl:param name="text" select="."/>
2822
2904
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -3077,6 +3159,11 @@
3077
3159
  <!-- replace start and end spaces to non-break space -->
3078
3160
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3079
3161
  </xsl:copy>
3162
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3163
+ <xsl:copy>
3164
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
3165
+ </xsl:copy>
3166
+ <mathml:mspace width="0.5ex"/>
3080
3167
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3081
3168
  <xsl:variable name="target">
3082
3169
  <xsl:choose>
@@ -3098,7 +3185,10 @@
3098
3185
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3099
3186
  <xsl:choose>
3100
3187
  <xsl:when test="normalize-space(.) = ''">
3101
- <xsl:value-of select="$target"/>
3188
+ <!-- <xsl:value-of select="$target"/> -->
3189
+ <xsl:call-template name="add-zero-spaces-link-java">
3190
+ <xsl:with-param name="text" select="$target"/>
3191
+ </xsl:call-template>
3102
3192
  </xsl:when>
3103
3193
  <xsl:otherwise>
3104
3194
  <xsl:apply-templates/>
@@ -3304,7 +3394,7 @@
3304
3394
  </xsl:if> -->
3305
3395
  </fo:inline>
3306
3396
  </xsl:if>
3307
- </xsl:template><xsl:template match="*[local-name() = 'figure']">
3397
+ </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
3308
3398
  <fo:block-container id="{@id}">
3309
3399
 
3310
3400
  <fo:block>
@@ -3373,6 +3463,8 @@
3373
3463
  <xsl:variable name="bookmark-title_">
3374
3464
  <xsl:call-template name="getLangVersion">
3375
3465
  <xsl:with-param name="lang" select="@lang"/>
3466
+ <xsl:with-param name="doctype" select="@doctype"/>
3467
+ <xsl:with-param name="title" select="@title-part"/>
3376
3468
  </xsl:call-template>
3377
3469
  </xsl:variable>
3378
3470
  <xsl:choose>
@@ -3390,13 +3482,34 @@
3390
3482
  </xsl:choose>
3391
3483
  </fo:bookmark-title>
3392
3484
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3485
+
3486
+ <xsl:call-template name="insertFigureBookmarks">
3487
+ <xsl:with-param name="contents" select="contents"/>
3488
+ </xsl:call-template>
3489
+
3490
+ <xsl:call-template name="insertTableBookmarks">
3491
+ <xsl:with-param name="contents" select="contents"/>
3492
+ <xsl:with-param name="lang" select="@lang"/>
3493
+ </xsl:call-template>
3494
+
3393
3495
  </fo:bookmark>
3394
3496
 
3395
3497
  </xsl:for-each>
3396
3498
  </xsl:when>
3397
3499
  <xsl:otherwise>
3398
3500
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3501
+
3399
3502
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3503
+
3504
+ <xsl:call-template name="insertFigureBookmarks">
3505
+ <xsl:with-param name="contents" select="contents"/>
3506
+ </xsl:call-template>
3507
+
3508
+ <xsl:call-template name="insertTableBookmarks">
3509
+ <xsl:with-param name="contents" select="contents"/>
3510
+ <xsl:with-param name="lang" select="@lang"/>
3511
+ </xsl:call-template>
3512
+
3400
3513
  </xsl:for-each>
3401
3514
  </xsl:otherwise>
3402
3515
  </xsl:choose>
@@ -3415,8 +3528,44 @@
3415
3528
 
3416
3529
  </fo:bookmark-tree>
3417
3530
  </xsl:if>
3531
+ </xsl:template><xsl:template name="insertFigureBookmarks">
3532
+ <xsl:param name="contents"/>
3533
+ <xsl:if test="xalan:nodeset($contents)/figure">
3534
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
3535
+ <fo:bookmark-title>Figures</fo:bookmark-title>
3536
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
3537
+ <fo:bookmark internal-destination="{@id}">
3538
+ <fo:bookmark-title>
3539
+ <xsl:value-of select="normalize-space(title)"/>
3540
+ </fo:bookmark-title>
3541
+ </fo:bookmark>
3542
+ </xsl:for-each>
3543
+ </fo:bookmark>
3544
+ </xsl:if>
3545
+ </xsl:template><xsl:template name="insertTableBookmarks">
3546
+ <xsl:param name="contents"/>
3547
+ <xsl:param name="lang"/>
3548
+ <xsl:if test="xalan:nodeset($contents)/table">
3549
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
3550
+ <fo:bookmark-title>
3551
+ <xsl:choose>
3552
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
3553
+ <xsl:otherwise>Tables</xsl:otherwise>
3554
+ </xsl:choose>
3555
+ </fo:bookmark-title>
3556
+ <xsl:for-each select="xalan:nodeset($contents)/table">
3557
+ <fo:bookmark internal-destination="{@id}">
3558
+ <fo:bookmark-title>
3559
+ <xsl:value-of select="normalize-space(title)"/>
3560
+ </fo:bookmark-title>
3561
+ </fo:bookmark>
3562
+ </xsl:for-each>
3563
+ </fo:bookmark>
3564
+ </xsl:if>
3418
3565
  </xsl:template><xsl:template name="getLangVersion">
3419
3566
  <xsl:param name="lang"/>
3567
+ <xsl:param name="doctype" select="''"/>
3568
+ <xsl:param name="title" select="''"/>
3420
3569
  <xsl:choose>
3421
3570
  <xsl:when test="$lang = 'en'">
3422
3571
 
@@ -3452,6 +3601,12 @@
3452
3601
  <!-- <xsl:text> </xsl:text> -->
3453
3602
  </xsl:template><xsl:template name="getSection">
3454
3603
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3604
+ <!--
3605
+ <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
3606
+ <xsl:value-of select="."/>
3607
+ </xsl:for-each>
3608
+ -->
3609
+
3455
3610
  </xsl:template><xsl:template name="getName">
3456
3611
  <xsl:choose>
3457
3612
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -3504,6 +3659,12 @@
3504
3659
  <xsl:copy>
3505
3660
  <xsl:apply-templates mode="contents_item"/>
3506
3661
  </xsl:copy>
3662
+ </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
3663
+ <xsl:copy>
3664
+ <xsl:apply-templates mode="contents_item"/>
3665
+ </xsl:copy>
3666
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
3667
+ <xsl:copy-of select="."/>
3507
3668
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3508
3669
  <xsl:text> </xsl:text>
3509
3670
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -3529,6 +3690,7 @@
3529
3690
  10
3530
3691
 
3531
3692
 
3693
+
3532
3694
 
3533
3695
 
3534
3696
 
@@ -3909,10 +4071,13 @@
3909
4071
  </xsl:if>
3910
4072
  </xsl:if>
3911
4073
 
4074
+
3912
4075
  <fo:block-container margin-left="0mm">
3913
4076
 
3914
4077
  <fo:block xsl:use-attribute-sets="quote-style">
3915
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
4078
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
4079
+
4080
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
3916
4081
  </fo:block>
3917
4082
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3918
4083
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -4067,6 +4232,7 @@
4067
4232
 
4068
4233
 
4069
4234
 
4235
+
4070
4236
 
4071
4237
 
4072
4238
 
@@ -4078,7 +4244,7 @@
4078
4244
 
4079
4245
 
4080
4246
 
4081
- </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
4247
+ </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
4082
4248
  <fo:block break-after="page"/>
4083
4249
  <fo:block>
4084
4250
  <xsl:call-template name="setId"/>
@@ -4086,7 +4252,8 @@
4086
4252
  </fo:block>
4087
4253
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
4088
4254
  <fo:block>
4089
- <xsl:call-template name="setId"/>
4255
+ <xsl:call-template name="setId"/>
4256
+
4090
4257
 
4091
4258
  <xsl:apply-templates/>
4092
4259
  </fo:block>
@@ -4331,6 +4498,8 @@
4331
4498
  <xsl:value-of select="translate(.,'. ','')"/>
4332
4499
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
4333
4500
  <xsl:value-of select="substring(.,1,1)"/>
4501
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
4502
+ <fo:inline><xsl:apply-templates/></fo:inline>
4334
4503
  </xsl:template><xsl:template name="convertDate">
4335
4504
  <xsl:param name="date"/>
4336
4505
  <xsl:param name="format" select="'short'"/>
@@ -4355,6 +4524,57 @@
4355
4524
  </xsl:variable>
4356
4525
  <xsl:variable name="result">
4357
4526
  <xsl:choose>
4527
+ <xsl:when test="$format = 'ddMMyyyy'">
4528
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4529
+ <xsl:text> </xsl:text>
4530
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4531
+ </xsl:when>
4532
+ <xsl:when test="$format = 'ddMM'">
4533
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4534
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4535
+ </xsl:when>
4536
+ <xsl:when test="$format = 'short' or $day = ''">
4537
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
4538
+ </xsl:when>
4539
+ <xsl:otherwise>
4540
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
4541
+ </xsl:otherwise>
4542
+ </xsl:choose>
4543
+ </xsl:variable>
4544
+ <xsl:value-of select="$result"/>
4545
+ </xsl:template><xsl:template name="convertDateLocalized">
4546
+ <xsl:param name="date"/>
4547
+ <xsl:param name="format" select="'short'"/>
4548
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
4549
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
4550
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
4551
+ <xsl:variable name="monthStr">
4552
+ <xsl:choose>
4553
+ <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>
4554
+ <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>
4555
+ <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>
4556
+ <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>
4557
+ <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>
4558
+ <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>
4559
+ <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>
4560
+ <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>
4561
+ <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>
4562
+ <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>
4563
+ <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>
4564
+ <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>
4565
+ </xsl:choose>
4566
+ </xsl:variable>
4567
+ <xsl:variable name="result">
4568
+ <xsl:choose>
4569
+ <xsl:when test="$format = 'ddMMyyyy'">
4570
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4571
+ <xsl:text> </xsl:text>
4572
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4573
+ </xsl:when>
4574
+ <xsl:when test="$format = 'ddMM'">
4575
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4576
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4577
+ </xsl:when>
4358
4578
  <xsl:when test="$format = 'short' or $day = ''">
4359
4579
  <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
4360
4580
  </xsl:when>
@@ -4370,7 +4590,7 @@
4370
4590
  <xsl:param name="charDelim" select="', '"/>
4371
4591
  <xsl:choose>
4372
4592
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
4373
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4593
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4374
4594
  <xsl:sort data-type="text" order="ascending"/>
4375
4595
  <xsl:call-template name="insertKeyword">
4376
4596
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -4379,7 +4599,7 @@
4379
4599
  </xsl:for-each>
4380
4600
  </xsl:when>
4381
4601
  <xsl:otherwise>
4382
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4602
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4383
4603
  <xsl:call-template name="insertKeyword">
4384
4604
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
4385
4605
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -4396,6 +4616,9 @@
4396
4616
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
4397
4617
  </xsl:choose>
4398
4618
  </xsl:template><xsl:template name="addPDFUAmeta">
4619
+ <xsl:variable name="lang">
4620
+ <xsl:call-template name="getLang"/>
4621
+ </xsl:variable>
4399
4622
  <fo:declarations>
4400
4623
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4401
4624
  <pdf:dictionary type="normal" key="ViewerPreferences">
@@ -4408,13 +4631,16 @@
4408
4631
  <!-- Dublin Core properties go here -->
4409
4632
  <dc:title>
4410
4633
  <xsl:variable name="title">
4411
-
4412
-
4413
-
4414
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/>
4415
-
4416
-
4417
-
4634
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4635
+
4636
+
4637
+
4638
+
4639
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
4640
+
4641
+
4642
+
4643
+ </xsl:for-each>
4418
4644
  </xsl:variable>
4419
4645
  <xsl:choose>
4420
4646
  <xsl:when test="normalize-space($title) != ''">
@@ -4426,19 +4652,21 @@
4426
4652
  </xsl:choose>
4427
4653
  </dc:title>
4428
4654
  <dc:creator>
4429
-
4430
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'organization']/*[local-name() = 'name']"/>
4431
-
4432
-
4433
-
4434
- </dc:creator>
4435
- <dc:description>
4436
- <xsl:variable name="abstract">
4655
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4437
4656
 
4438
- <xsl:copy-of select="/*/*[local-name() = 'bibliography']/*[local-name() = 'references']/*[local-name() = 'bibitem']/*[local-name() = 'abstract']//text()"/>
4657
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4658
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
4659
+ <xsl:if test="position() != last()">; </xsl:if>
4660
+ </xsl:for-each>
4439
4661
 
4440
4662
 
4441
4663
 
4664
+ </xsl:for-each>
4665
+ </dc:creator>
4666
+ <dc:description>
4667
+ <xsl:variable name="abstract">
4668
+
4669
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4442
4670
 
4443
4671
 
4444
4672
  </xsl:variable>
@@ -4551,6 +4779,7 @@
4551
4779
 
4552
4780
 
4553
4781
 
4782
+
4554
4783
  </xsl:variable>
4555
4784
  <xsl:if test="$documentNS != $XSLNS">
4556
4785
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -4610,6 +4839,11 @@
4610
4839
  <xsl:call-template name="getLang"/>
4611
4840
  </xsl:variable>
4612
4841
 
4613
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4842
+ <xsl:choose>
4843
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
4844
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4845
+ </xsl:when>
4846
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
4847
+ </xsl:choose>
4614
4848
 
4615
4849
  </xsl:template></xsl:stylesheet>