metanorma-ribose 1.6.11 → 1.6.16

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: '09692ec54e7186049ced9245aa545eec4014cef2ed4870c3b2316ddb5baa9c26'
4
- data.tar.gz: 9bae1a6920887f47f736c29af7eb769a941a1874a70624e125951a23824481b3
3
+ metadata.gz: 15cc3c5ccba05fef79b07e6ccb7e83c61660ab0427c06e7a822d4cbca06a03bf
4
+ data.tar.gz: 30dcf9307e57ded58f56732c46928a1765e2178d21c2ecb61cd5d1bc9953e106
5
5
  SHA512:
6
- metadata.gz: 751876bd18696125f64ddff27d8965c752653d69cde5816278cc9f1939521eedf7b5d456a99b7beb25bc6b5846bcdbe72a99298a70196aec0a2a50fb816e17cf
7
- data.tar.gz: 1693d7cb5bd93863b3b685cbc25ee3209a0e60d545d78b3041eb3ad5f438e2fad7e314f879f89d12fb8637a2c326b60ebef7facf076eacf30140f9e0dc9e2989
6
+ metadata.gz: 48502a8f19547c1bf522e1a5d2700ef65cbecb383a2066cd4e54048f4943d975a078170675c02e6e793ad30a2c442837f2130d81ffd0e654ba736da90a39337d
7
+ data.tar.gz: cbe70e64b6aeceab8dac66dcb0c5f01678406abe61e92ac5aee38a950996bd86f2f6dd183764e7ca036d66ee47cae4d7c5873391854b551391f98c10a13ed389
@@ -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,52 +35,19 @@ jobs:
35
35
  - uses: ruby/setup-ruby@v1
36
36
  with:
37
37
  ruby-version: ${{ matrix.ruby }}
38
+ bundler-cache: true
38
39
 
39
- - if: matrix.os == 'macos-latest'
40
- run: brew install autoconf automake libtool
41
-
42
- - uses: actions/cache@v2
43
- with:
44
- path: vendor/bundle
45
- key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
46
- restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
47
-
48
- - run: bundle config set path 'vendor/bundle'
49
-
50
- - run: bundle install --jobs 4 --retry 3
51
-
52
- - name: install plantuml ubuntu
53
- if: matrix.os == 'ubuntu-latest'
54
- uses: nick-invision/retry@v1
55
- with:
56
- polling_interval_seconds: 5
57
- timeout_minutes: 5
58
- max_attempts: 3
59
- command: >
60
- sudo apt-get update -y && sudo bash -c
61
- "curl -L https://github.com/metanorma/plantuml-install/raw/master/ubuntu.sh | bash"
62
-
63
- - if: matrix.os == 'macos-latest'
64
- run: brew install plantuml
65
-
66
- - if: matrix.os == 'windows-latest'
67
- run: cinst -y plantuml
68
-
69
- - if: matrix.os == 'macos-latest'
70
- run: brew install autoconf automake libtool
40
+ - uses: metanorma/metanorma-build-scripts/plantuml-setup-action@master
71
41
 
72
42
  - run: bundle exec rake
73
43
 
74
44
  tests-passed:
75
45
  needs: rake
76
46
  runs-on: ubuntu-latest
77
- continue-on-error: true
78
47
  steps:
79
- - name: Trigger tests passed event
80
- uses: Sibz/github-status-action@v1
48
+ - uses: peter-evans/repository-dispatch@v1
81
49
  with:
82
- authToken: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
83
- context: 'tests-passed-successfully'
84
- description: 'Tests passed successfully'
85
- state: 'success'
86
- sha: ${{ github.event.pull_request.head.sha || github.sha }}
50
+ token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
51
+ repository: ${{ github.repository }}
52
+ event-type: notify
53
+ client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
data/.gitignore CHANGED
@@ -1 +1,3 @@
1
1
  .DS_Store
2
+
3
+ .rubocop-https--*
data/.rubocop.yml CHANGED
@@ -1,10 +1,14 @@
1
1
  # This project follows the Ribose OSS style guide.
2
2
  # https://github.com/riboseinc/oss-guides
3
3
  # All project-specific additions and overrides should be specified in this file.
4
-
5
4
  inherit_from:
6
5
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
6
+
7
+ # local repo-specific modifications
8
+
7
9
  AllCops:
8
- TargetRubyVersion: 2.3
10
+ DisplayCopNames: false
11
+ StyleGuideCopsOnly: false
12
+ TargetRubyVersion: 2.4
9
13
  Rails:
10
14
  Enabled: true
@@ -729,9 +729,11 @@
729
729
  </define>
730
730
  <define name="index">
731
731
  <element name="index">
732
- <attribute name="to">
733
- <data type="IDREF"/>
734
- </attribute>
732
+ <optional>
733
+ <attribute name="to">
734
+ <data type="IDREF"/>
735
+ </attribute>
736
+ </optional>
735
737
  <element name="primary">
736
738
  <oneOrMore>
737
739
  <ref name="PureTextElement"/>
@@ -124,7 +124,7 @@
124
124
  <value>application/tei+xml</value>
125
125
  <value>text/x-asciidoc</value>
126
126
  <value>text/markdown</value>
127
- <value>application/x-isodoc+xml</value>
127
+ <value>application/x-metanorma+xml</value>
128
128
  <text/>
129
129
  </choice>
130
130
  </attribute>
@@ -452,6 +452,7 @@
452
452
  <attribute name="type">
453
453
  <choice>
454
454
  <value>isni</value>
455
+ <value>orcid</value>
455
456
  <value>uri</value>
456
457
  </choice>
457
458
  </attribute>
@@ -461,10 +462,7 @@
461
462
  <define name="org-identifier">
462
463
  <element name="identifier">
463
464
  <attribute name="type">
464
- <choice>
465
- <value>orcid</value>
466
- <value>uri</value>
467
- </choice>
465
+ <data type="string" datatypeLibrary=""/>
468
466
  </attribute>
469
467
  <text/>
470
468
  </element>
@@ -1106,7 +1104,7 @@
1106
1104
  <value>complementOf</value>
1107
1105
  <value>obsoletes</value>
1108
1106
  <value>obsoletedBy</value>
1109
- <value>cited</value>
1107
+ <value>cites</value>
1110
1108
  <value>isCitedIn</value>
1111
1109
  </choice>
1112
1110
  </define>
@@ -102,7 +102,7 @@
102
102
  </attribute>
103
103
  </optional>
104
104
  <oneOrMore>
105
- <ref name="li"/>
105
+ <ref name="ul_li"/>
106
106
  </oneOrMore>
107
107
  <zeroOrMore>
108
108
  <ref name="note"/>
@@ -789,6 +789,9 @@
789
789
  <attribute name="width"/>
790
790
  </element>
791
791
  </define>
792
+ <define name="BibItemType" combine="choice">
793
+ <value>internal</value>
794
+ </define>
792
795
  <define name="TextElement" combine="choice">
793
796
  <ref name="concept"/>
794
797
  </define>
@@ -809,6 +812,8 @@
809
812
  <ref name="requirement"/>
810
813
  <ref name="recommendation"/>
811
814
  <ref name="permission"/>
815
+ <ref name="imagemap"/>
816
+ <ref name="svgmap"/>
812
817
  </choice>
813
818
  </define>
814
819
  <define name="bibliography">
@@ -914,6 +919,9 @@
914
919
  </choice>
915
920
  </attribute>
916
921
  <ref name="bibdata"/>
922
+ <optional>
923
+ <ref name="misccontainer"/>
924
+ </optional>
917
925
  <optional>
918
926
  <ref name="boilerplate"/>
919
927
  </optional>
@@ -924,11 +932,21 @@
924
932
  <zeroOrMore>
925
933
  <ref name="annex"/>
926
934
  </zeroOrMore>
935
+ <optional>
936
+ <ref name="bibliography"/>
937
+ </optional>
927
938
  <zeroOrMore>
928
- <ref name="references"/>
939
+ <ref name="indexsect"/>
929
940
  </zeroOrMore>
930
941
  </element>
931
942
  </define>
943
+ <define name="misccontainer">
944
+ <element name="misc-container">
945
+ <oneOrMore>
946
+ <ref name="AnyElement"/>
947
+ </oneOrMore>
948
+ </element>
949
+ </define>
932
950
  <define name="preface">
933
951
  <element name="preface">
934
952
  <oneOrMore>
@@ -952,6 +970,11 @@
952
970
  <ref name="Content-Section"/>
953
971
  </element>
954
972
  </define>
973
+ <define name="indexsect">
974
+ <element name="indexsect">
975
+ <ref name="Content-Section"/>
976
+ </element>
977
+ </define>
955
978
  <define name="boilerplate">
956
979
  <element name="boilerplate">
957
980
  <optional>
@@ -1632,4 +1655,87 @@
1632
1655
  <text/>
1633
1656
  </element>
1634
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>
1719
+ <define name="ul_li">
1720
+ <element name="li">
1721
+ <optional>
1722
+ <attribute name="id">
1723
+ <data type="ID"/>
1724
+ </attribute>
1725
+ </optional>
1726
+ <optional>
1727
+ <attribute name="uncheckedcheckbox">
1728
+ <data type="boolean"/>
1729
+ </attribute>
1730
+ </optional>
1731
+ <optional>
1732
+ <attribute name="checkedcheckbox">
1733
+ <data type="boolean"/>
1734
+ </attribute>
1735
+ </optional>
1736
+ <oneOrMore>
1737
+ <ref name="BasicBlock"/>
1738
+ </oneOrMore>
1739
+ </element>
1740
+ </define>
1635
1741
  </grammar>
@@ -70,6 +70,9 @@
70
70
  <zeroOrMore>
71
71
  <ref name="termdocsource"/>
72
72
  </zeroOrMore>
73
+ <optional>
74
+ <ref name="misccontainer"/>
75
+ </optional>
73
76
  <optional>
74
77
  <ref name="boilerplate"/>
75
78
  </optional>
@@ -81,6 +84,9 @@
81
84
  <ref name="annex"/>
82
85
  </zeroOrMore>
83
86
  <ref name="bibliography"/>
87
+ <zeroOrMore>
88
+ <ref name="indexsect"/>
89
+ </zeroOrMore>
84
90
  </element>
85
91
  </define>
86
92
  </grammar>
@@ -505,7 +505,7 @@ h3 {
505
505
  mso-list: l1 level3 lfo6;
506
506
  mso-hyphenate: none;
507
507
  tab-stops: list 36.0pt left 44.0pt;
508
- font-size: {{smallerfontsize}};
508
+ font-size: {{normalfontsize}};
509
509
  font-family: {{headerfont}};
510
510
  font-weight: normal;
511
511
  color: #0E1A85;
@@ -533,7 +533,7 @@ h4 {
533
533
  mso-list: l1 level4 lfo6;
534
534
  mso-hyphenate: none;
535
535
  tab-stops: 51.05pt 57.0pt 68.0pt;
536
- font-size: {{smallerfontsize}};
536
+ font-size: {{normalfontsize}};
537
537
  font-family: {{headerfont}};
538
538
  font-weight: normal;
539
539
  color: #0E1A85;
@@ -561,7 +561,7 @@ h5 {
561
561
  mso-list: l1 level5 lfo6;
562
562
  mso-hyphenate: none;
563
563
  tab-stops: 51.05pt list 54.0pt;
564
- font-size: {{smallerfontsize}};
564
+ font-size: {{normalfontsize}};
565
565
  font-family: {{headerfont}};
566
566
  font-weight: normal;
567
567
  mso-fareast-font-family: {{headerfont}};
@@ -589,7 +589,7 @@ h6 {
589
589
  mso-list: l1 level6 lfo6;
590
590
  mso-hyphenate: none;
591
591
  tab-stops: 51.05pt list 72.0pt;
592
- font-size: {{smallerfontsize}};
592
+ font-size: {{normalfontsize}};
593
593
  font-family: {{headerfont}};
594
594
  font-weight: normal;
595
595
  color: #0E1A85;
@@ -471,7 +471,7 @@ h3
471
471
  mso-list:l1 level3 lfo6;
472
472
  mso-hyphenate:none;
473
473
  tab-stops:list 36.0pt left 44.0pt;
474
- font-size:$smallerfontsize;
474
+ font-size:$normalfontsize;
475
475
  font-family:$headerfont;
476
476
  font-weight:normal;
477
477
  color:#0E1A85;
@@ -498,7 +498,7 @@ h4
498
498
  mso-list:l1 level4 lfo6;
499
499
  mso-hyphenate:none;
500
500
  tab-stops:51.05pt 57.0pt 68.0pt;
501
- font-size:$smallerfontsize;
501
+ font-size:$normalfontsize;
502
502
  font-family:$headerfont;
503
503
  font-weight:normal;
504
504
  color:#0E1A85;
@@ -525,7 +525,7 @@ h5
525
525
  mso-list:l1 level5 lfo6;
526
526
  mso-hyphenate:none;
527
527
  tab-stops:51.05pt list 54.0pt;
528
- font-size:$smallerfontsize;
528
+ font-size:$normalfontsize;
529
529
  font-family:$headerfont;
530
530
  font-weight:normal;
531
531
  mso-fareast-font-family:$headerfont;
@@ -552,7 +552,7 @@ h6
552
552
  mso-list:l1 level6 lfo6;
553
553
  mso-hyphenate:none;
554
554
  tab-stops:51.05pt list 72.0pt;
555
- font-size:$smallerfontsize;
555
+ font-size:$normalfontsize;
556
556
  font-family:$headerfont;
557
557
  font-weight:normal;
558
558
  color:#0E1A85;
@@ -4,16 +4,15 @@ module IsoDoc
4
4
  module Ribose
5
5
  # A {Converter} implementation that generates PDF HTML output, and a
6
6
  # document schema encapsulation of the document for validation
7
- class PdfConvert < IsoDoc::XslfoPdfConvert
7
+ class PdfConvert < IsoDoc::XslfoPdfConvert
8
8
  def initialize(options)
9
9
  @libdir = File.dirname(__FILE__)
10
10
  super
11
11
  end
12
12
 
13
- def pdf_stylesheet(docxml)
14
- "rsd.standard.xsl"
13
+ def pdf_stylesheet(_docxml)
14
+ "ribose.standard.xsl"
15
15
  end
16
16
  end
17
17
  end
18
18
  end
19
-
@@ -3,6 +3,7 @@
3
3
  <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
5
  <xsl:param name="svg_images"/>
6
+ <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
6
7
  <xsl:variable name="images" select="document($svg_images)"/>
7
8
 
8
9
  <xsl:variable name="pageWidth" select="'210mm'"/>
@@ -89,7 +90,9 @@
89
90
  </fo:page-sequence-master>
90
91
  </fo:layout-master-set>
91
92
 
92
- <xsl:call-template name="addPDFUAmeta"/>
93
+ <fo:declarations>
94
+ <xsl:call-template name="addPDFUAmeta"/>
95
+ </fo:declarations>
93
96
 
94
97
  <xsl:call-template name="addBookmarks">
95
98
  <xsl:with-param name="contents" select="$contents"/>
@@ -1161,6 +1164,7 @@
1161
1164
 
1162
1165
 
1163
1166
 
1167
+
1164
1168
 
1165
1169
  <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
1166
1170
 
@@ -1297,6 +1301,7 @@
1297
1301
 
1298
1302
 
1299
1303
 
1304
+
1300
1305
  </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1301
1306
 
1302
1307
  <xsl:attribute name="text-align">right</xsl:attribute>
@@ -1440,193 +1445,227 @@
1440
1445
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1441
1446
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
1442
1447
  <xsl:call-template name="add-zero-spaces-java"/>
1443
- </xsl:template><xsl:template match="*[local-name()='table']">
1448
+ </xsl:template><xsl:template match="*[local-name()='table']" name="table">
1444
1449
 
1445
- <xsl:variable name="simple-table">
1446
- <xsl:call-template name="getSimpleTable"/>
1447
- </xsl:variable>
1450
+ <xsl:variable name="table">
1448
1451
 
1449
-
1450
-
1451
-
1452
-
1453
- <!-- <xsl:if test="$namespace = 'bipm'">
1454
- <fo:block>&#xA0;</fo:block>
1455
- </xsl:if> -->
1456
-
1457
- <!-- $namespace = 'iso' or -->
1458
-
1459
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1460
-
1461
-
1452
+ <xsl:variable name="simple-table">
1453
+ <xsl:call-template name="getSimpleTable"/>
1454
+ </xsl:variable>
1462
1455
 
1463
1456
 
1464
-
1465
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1466
-
1467
- <!-- <xsl:variable name="cols-count">
1468
- <xsl:choose>
1469
- <xsl:when test="*[local-name()='thead']">
1470
- <xsl:call-template name="calculate-columns-numbers">
1471
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1472
- </xsl:call-template>
1473
- </xsl:when>
1474
- <xsl:otherwise>
1475
- <xsl:call-template name="calculate-columns-numbers">
1476
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1477
- </xsl:call-template>
1478
- </xsl:otherwise>
1479
- </xsl:choose>
1480
- </xsl:variable> -->
1481
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1482
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1483
-
1484
-
1485
-
1486
- <xsl:variable name="colwidths">
1487
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1488
- <xsl:call-template name="calculate-column-widths">
1489
- <xsl:with-param name="cols-count" select="$cols-count"/>
1490
- <xsl:with-param name="table" select="$simple-table"/>
1491
- </xsl:call-template>
1492
- </xsl:if>
1493
- </xsl:variable>
1494
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1495
-
1496
- <!-- <xsl:variable name="colwidths2">
1497
- <xsl:call-template name="calculate-column-widths">
1498
- <xsl:with-param name="cols-count" select="$cols-count"/>
1499
- </xsl:call-template>
1500
- </xsl:variable> -->
1501
-
1502
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1503
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
1504
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1505
-
1506
- <xsl:variable name="margin-left">
1507
- <xsl:choose>
1508
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1509
- <xsl:otherwise>0</xsl:otherwise>
1510
- </xsl:choose>
1511
- </xsl:variable>
1512
-
1513
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1514
1457
 
1515
1458
 
1516
-
1517
-
1518
-
1519
1459
 
1460
+ <!-- <xsl:if test="$namespace = 'bipm'">
1461
+ <fo:block>&#xA0;</fo:block>
1462
+ </xsl:if> -->
1520
1463
 
1521
-
1464
+ <!-- $namespace = 'iso' or -->
1522
1465
 
1466
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1523
1467
 
1468
+
1524
1469
 
1470
+
1525
1471
 
1472
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1526
1473
 
1474
+ <!-- <xsl:variable name="cols-count">
1475
+ <xsl:choose>
1476
+ <xsl:when test="*[local-name()='thead']">
1477
+ <xsl:call-template name="calculate-columns-numbers">
1478
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1479
+ </xsl:call-template>
1480
+ </xsl:when>
1481
+ <xsl:otherwise>
1482
+ <xsl:call-template name="calculate-columns-numbers">
1483
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1484
+ </xsl:call-template>
1485
+ </xsl:otherwise>
1486
+ </xsl:choose>
1487
+ </xsl:variable> -->
1488
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1489
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1527
1490
 
1528
1491
 
1529
- <xsl:variable name="table_attributes">
1530
- <attribute name="table-layout">fixed</attribute>
1531
- <attribute name="width">
1532
- <xsl:choose>
1533
- <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
1534
- <xsl:otherwise>100%</xsl:otherwise>
1535
- </xsl:choose>
1536
- </attribute>
1537
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1538
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1492
+
1493
+ <xsl:variable name="colwidths">
1494
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1495
+ <xsl:call-template name="calculate-column-widths">
1496
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1497
+ <xsl:with-param name="table" select="$simple-table"/>
1498
+ </xsl:call-template>
1499
+ </xsl:if>
1500
+ </xsl:variable>
1501
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1502
+
1503
+ <!-- <xsl:variable name="colwidths2">
1504
+ <xsl:call-template name="calculate-column-widths">
1505
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1506
+ </xsl:call-template>
1507
+ </xsl:variable> -->
1508
+
1509
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1510
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1511
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1512
+
1513
+ <xsl:variable name="margin-left">
1514
+ <xsl:choose>
1515
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1516
+ <xsl:otherwise>0</xsl:otherwise>
1517
+ </xsl:choose>
1518
+ </xsl:variable>
1519
+
1520
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1539
1521
 
1540
1522
 
1523
+
1524
+
1525
+
1541
1526
 
1542
1527
 
1543
-
1544
-
1545
-
1528
+
1546
1529
 
1547
-
1548
1530
 
1549
- </xsl:variable>
1550
-
1551
-
1552
- <fo:table id="{@id}" table-omit-footer-at-break="true">
1553
1531
 
1554
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1555
- <xsl:attribute name="{@name}">
1556
- <xsl:value-of select="."/>
1557
- </xsl:attribute>
1558
- </xsl:for-each>
1559
1532
 
1560
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1561
- <xsl:if test="$isNoteOrFnExist = 'true'">
1562
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1563
- </xsl:if>
1564
1533
 
1565
- <xsl:choose>
1566
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1567
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1568
- <fo:table-column column-width="{@width}"/>
1569
- </xsl:for-each>
1570
- </xsl:when>
1571
- <xsl:otherwise>
1572
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1573
- <xsl:choose>
1574
- <xsl:when test=". = 1 or . = 0">
1575
- <fo:table-column column-width="proportional-column-width(2)"/>
1576
- </xsl:when>
1577
- <xsl:otherwise>
1578
- <fo:table-column column-width="proportional-column-width({.})"/>
1579
- </xsl:otherwise>
1580
- </xsl:choose>
1581
- </xsl:for-each>
1582
- </xsl:otherwise>
1583
- </xsl:choose>
1584
1534
 
1585
- <xsl:choose>
1586
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1587
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1588
- </xsl:when>
1589
- <xsl:otherwise>
1590
- <xsl:apply-templates/>
1591
- </xsl:otherwise>
1592
- </xsl:choose>
1535
+ <xsl:variable name="table_width">
1536
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1537
+ 100%
1538
+
1539
+
1540
+ </xsl:variable>
1541
+
1542
+ <xsl:variable name="table_attributes">
1543
+ <attribute name="table-layout">fixed</attribute>
1544
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
1545
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1546
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1547
+
1548
+
1549
+
1550
+
1551
+
1552
+
1553
+
1554
+
1555
+
1556
+
1557
+ </xsl:variable>
1593
1558
 
1594
- </fo:table>
1595
-
1596
- <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1597
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1598
- <xsl:call-template name="insertTableFooterInSeparateTable">
1599
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
1600
- <xsl:with-param name="colwidths" select="$colwidths"/>
1601
- <xsl:with-param name="colgroup" select="$colgroup"/>
1602
- </xsl:call-template>
1603
- </xsl:for-each>
1604
-
1605
- <!-- insert footer as table -->
1606
- <!-- <fo:table>
1607
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1608
- <xsl:attribute name="{@name}">
1609
- <xsl:value-of select="."/>
1610
- </xsl:attribute>
1611
- </xsl:for-each>
1612
1559
 
1613
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1560
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1561
+
1562
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1563
+ <xsl:attribute name="{@name}">
1564
+ <xsl:value-of select="."/>
1565
+ </xsl:attribute>
1566
+ </xsl:for-each>
1567
+
1568
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1569
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1570
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1571
+ </xsl:if>
1572
+
1614
1573
  <xsl:choose>
1615
- <xsl:when test=". = 1 or . = 0">
1616
- <fo:table-column column-width="proportional-column-width(2)"/>
1574
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1575
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
1576
+ <fo:table-column column-width="{@width}"/>
1577
+ </xsl:for-each>
1617
1578
  </xsl:when>
1618
1579
  <xsl:otherwise>
1619
- <fo:table-column column-width="proportional-column-width({.})"/>
1580
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1581
+ <xsl:choose>
1582
+ <xsl:when test=". = 1 or . = 0">
1583
+ <fo:table-column column-width="proportional-column-width(2)"/>
1584
+ </xsl:when>
1585
+ <xsl:otherwise>
1586
+ <fo:table-column column-width="proportional-column-width({.})"/>
1587
+ </xsl:otherwise>
1588
+ </xsl:choose>
1589
+ </xsl:for-each>
1620
1590
  </xsl:otherwise>
1621
1591
  </xsl:choose>
1592
+
1593
+ <xsl:choose>
1594
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1595
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1596
+ </xsl:when>
1597
+ <xsl:otherwise>
1598
+ <xsl:apply-templates/>
1599
+ </xsl:otherwise>
1600
+ </xsl:choose>
1601
+
1602
+ </fo:table>
1603
+
1604
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
1605
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1606
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1607
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1608
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1609
+ <xsl:with-param name="colgroup" select="$colgroup"/>
1610
+ </xsl:call-template>
1622
1611
  </xsl:for-each>
1623
- </fo:table>-->
1624
-
1625
-
1626
-
1627
-
1628
-
1629
- </fo:block-container>
1612
+
1613
+ <!-- insert footer as table -->
1614
+ <!-- <fo:table>
1615
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1616
+ <xsl:attribute name="{@name}">
1617
+ <xsl:value-of select="."/>
1618
+ </xsl:attribute>
1619
+ </xsl:for-each>
1620
+
1621
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1622
+ <xsl:choose>
1623
+ <xsl:when test=". = 1 or . = 0">
1624
+ <fo:table-column column-width="proportional-column-width(2)"/>
1625
+ </xsl:when>
1626
+ <xsl:otherwise>
1627
+ <fo:table-column column-width="proportional-column-width({.})"/>
1628
+ </xsl:otherwise>
1629
+ </xsl:choose>
1630
+ </xsl:for-each>
1631
+ </fo:table>-->
1632
+
1633
+
1634
+
1635
+
1636
+
1637
+ </fo:block-container>
1638
+ </xsl:variable>
1639
+
1640
+
1641
+
1642
+ <xsl:choose>
1643
+ <xsl:when test="@width">
1644
+
1645
+ <!-- centered table when table name is centered (see table-name-style) -->
1646
+
1647
+ <fo:table table-layout="fixed" width="100%">
1648
+ <fo:table-column column-width="proportional-column-width(1)"/>
1649
+ <fo:table-column column-width="{@width}"/>
1650
+ <fo:table-column column-width="proportional-column-width(1)"/>
1651
+ <fo:table-body>
1652
+ <fo:table-row>
1653
+ <fo:table-cell column-number="2">
1654
+ <fo:block><xsl:copy-of select="$table"/></fo:block>
1655
+ </fo:table-cell>
1656
+ </fo:table-row>
1657
+ </fo:table-body>
1658
+ </fo:table>
1659
+
1660
+
1661
+
1662
+
1663
+ </xsl:when>
1664
+ <xsl:otherwise>
1665
+ <xsl:copy-of select="$table"/>
1666
+ </xsl:otherwise>
1667
+ </xsl:choose>
1668
+
1630
1669
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1631
1670
  <xsl:if test="normalize-space() != ''">
1632
1671
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -1754,7 +1793,15 @@
1754
1793
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1755
1794
  <xsl:value-of select="@target"/>
1756
1795
  </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1757
- <xsl:variable name="math_text" select="normalize-space(.)"/>
1796
+ <xsl:variable name="mathml">
1797
+ <xsl:for-each select="*">
1798
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
1799
+ <xsl:copy-of select="."/>
1800
+ </xsl:if>
1801
+ </xsl:for-each>
1802
+ </xsl:variable>
1803
+
1804
+ <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
1758
1805
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1759
1806
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1760
1807
  <xsl:param name="cols-count"/>
@@ -2437,7 +2484,7 @@
2437
2484
  <xsl:with-param name="table" select="$html-table"/>
2438
2485
  </xsl:call-template>
2439
2486
  </xsl:variable>
2440
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2487
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2441
2488
  <xsl:variable name="maxlength_dt">
2442
2489
  <xsl:call-template name="getMaxLength_dt"/>
2443
2490
  </xsl:variable>
@@ -2466,13 +2513,22 @@
2466
2513
  </xsl:when>
2467
2514
  <xsl:otherwise>
2468
2515
  <xsl:choose>
2516
+ <!-- to set width check most wide chars like `W` -->
2469
2517
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
2470
- <fo:table-column column-width="5%"/>
2471
- <fo:table-column column-width="95%"/>
2518
+ <fo:table-column column-width="7%"/>
2519
+ <fo:table-column column-width="93%"/>
2472
2520
  </xsl:when>
2473
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
2474
- <fo:table-column column-width="10%"/>
2475
- <fo:table-column column-width="90%"/>
2521
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
2522
+ <fo:table-column column-width="15%"/>
2523
+ <fo:table-column column-width="85%"/>
2524
+ </xsl:when>
2525
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
2526
+ <fo:table-column column-width="20%"/>
2527
+ <fo:table-column column-width="80%"/>
2528
+ </xsl:when>
2529
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
2530
+ <fo:table-column column-width="25%"/>
2531
+ <fo:table-column column-width="75%"/>
2476
2532
  </xsl:when>
2477
2533
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
2478
2534
  <fo:table-column column-width="60%"/>
@@ -2669,6 +2725,7 @@
2669
2725
 
2670
2726
 
2671
2727
 
2728
+
2672
2729
  10
2673
2730
 
2674
2731
  </xsl:variable>
@@ -2691,6 +2748,10 @@
2691
2748
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
2692
2749
  <xsl:apply-templates/>
2693
2750
  </fo:inline>
2751
+ </xsl:template><xsl:template match="*[local-name()='hi']">
2752
+ <fo:inline background-color="yellow">
2753
+ <xsl:apply-templates/>
2754
+ </fo:inline>
2694
2755
  </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
2695
2756
  <xsl:variable name="text" select="normalize-space(.)"/>
2696
2757
  <fo:inline font-size="75%">
@@ -2780,6 +2841,10 @@
2780
2841
  <xsl:param name="text" select="."/>
2781
2842
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2782
2843
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
2844
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
2845
+ <xsl:param name="text" select="."/>
2846
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
2847
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
2783
2848
  </xsl:template><xsl:template name="add-zero-spaces">
2784
2849
  <xsl:param name="text" select="."/>
2785
2850
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -3027,6 +3092,7 @@
3027
3092
  <xsl:apply-templates select="." mode="mathml"/>
3028
3093
  </xsl:variable>
3029
3094
  <fo:instream-foreign-object fox:alt-text="Math">
3095
+
3030
3096
  <!-- <xsl:copy-of select="."/> -->
3031
3097
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3032
3098
  </fo:instream-foreign-object>
@@ -3040,7 +3106,12 @@
3040
3106
  <!-- replace start and end spaces to non-break space -->
3041
3107
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3042
3108
  </xsl:copy>
3043
- </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3109
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
3110
+ <xsl:copy>
3111
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
3112
+ </xsl:copy>
3113
+ <mathml:mspace width="0.5ex"/>
3114
+ </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3044
3115
  <xsl:variable name="target">
3045
3116
  <xsl:choose>
3046
3117
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -3061,7 +3132,10 @@
3061
3132
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3062
3133
  <xsl:choose>
3063
3134
  <xsl:when test="normalize-space(.) = ''">
3064
- <xsl:value-of select="$target"/>
3135
+ <!-- <xsl:value-of select="$target"/> -->
3136
+ <xsl:call-template name="add-zero-spaces-link-java">
3137
+ <xsl:with-param name="text" select="$target"/>
3138
+ </xsl:call-template>
3065
3139
  </xsl:when>
3066
3140
  <xsl:otherwise>
3067
3141
  <xsl:apply-templates/>
@@ -3071,8 +3145,6 @@
3071
3145
  </xsl:otherwise>
3072
3146
  </xsl:choose>
3073
3147
  </fo:inline>
3074
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
3075
- <fo:inline id="{@id}"/>
3076
3148
  </xsl:template><xsl:template match="*[local-name()='appendix']">
3077
3149
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3078
3150
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
@@ -3271,7 +3343,7 @@
3271
3343
  </xsl:if> -->
3272
3344
  </fo:inline>
3273
3345
  </xsl:if>
3274
- </xsl:template><xsl:template match="*[local-name() = 'figure']">
3346
+ </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
3275
3347
  <fo:block-container id="{@id}">
3276
3348
 
3277
3349
  <fo:block>
@@ -3287,6 +3359,7 @@
3287
3359
  <fo:block id="{@id}">
3288
3360
  <xsl:apply-templates/>
3289
3361
  </fo:block>
3362
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3290
3363
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
3291
3364
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
3292
3365
  <xsl:apply-templates/>
@@ -3478,6 +3551,12 @@
3478
3551
  <!-- <xsl:text> </xsl:text> -->
3479
3552
  </xsl:template><xsl:template name="getSection">
3480
3553
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3554
+ <!--
3555
+ <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
3556
+ <xsl:value-of select="."/>
3557
+ </xsl:for-each>
3558
+ -->
3559
+
3481
3560
  </xsl:template><xsl:template name="getName">
3482
3561
  <xsl:choose>
3483
3562
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -3530,6 +3609,12 @@
3530
3609
  <xsl:copy>
3531
3610
  <xsl:apply-templates mode="contents_item"/>
3532
3611
  </xsl:copy>
3612
+ </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
3613
+ <xsl:copy>
3614
+ <xsl:apply-templates mode="contents_item"/>
3615
+ </xsl:copy>
3616
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
3617
+ <xsl:copy-of select="."/>
3533
3618
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3534
3619
  <xsl:text> </xsl:text>
3535
3620
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -3555,6 +3640,7 @@
3555
3640
 
3556
3641
 
3557
3642
 
3643
+
3558
3644
 
3559
3645
 
3560
3646
 
@@ -3857,10 +3943,11 @@
3857
3943
  </xsl:choose>
3858
3944
 
3859
3945
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3860
-
3946
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
3861
3947
  <xsl:variable name="element">
3862
3948
  block
3863
3949
 
3950
+
3864
3951
  </xsl:variable>
3865
3952
  <xsl:choose>
3866
3953
  <xsl:when test="normalize-space($element) = 'block'">
@@ -3935,11 +4022,13 @@
3935
4022
  </xsl:if>
3936
4023
  </xsl:if>
3937
4024
 
4025
+
3938
4026
  <fo:block-container margin-left="0mm">
3939
4027
 
3940
4028
  <fo:block xsl:use-attribute-sets="quote-style">
3941
4029
  <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
3942
- <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
4030
+
4031
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
3943
4032
  </fo:block>
3944
4033
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3945
4034
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -3962,29 +4051,47 @@
3962
4051
  <xsl:text>— </xsl:text>
3963
4052
  <xsl:apply-templates/>
3964
4053
  </xsl:template><xsl:template match="*[local-name() = 'eref']">
3965
- <fo:inline xsl:use-attribute-sets="eref-style">
3966
- <xsl:if test="@type = 'footnote'">
3967
-
3968
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
3969
- <xsl:attribute name="font-size">80%</xsl:attribute>
3970
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3971
- <xsl:attribute name="vertical-align">super</xsl:attribute>
3972
-
3973
-
3974
- </xsl:if>
3975
-
3976
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3977
-
3978
- <xsl:if test="@type = 'inline'">
3979
-
3980
-
3981
-
3982
- </xsl:if>
3983
-
3984
-
3985
- <xsl:apply-templates/>
3986
- </fo:basic-link>
3987
- </fo:inline>
4054
+
4055
+ <xsl:variable name="bibitemid">
4056
+ <xsl:choose>
4057
+ <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
4058
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
4059
+ <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
4060
+ </xsl:choose>
4061
+ </xsl:variable>
4062
+
4063
+ <xsl:choose>
4064
+ <xsl:when test="normalize-space($bibitemid) != ''">
4065
+ <fo:inline xsl:use-attribute-sets="eref-style">
4066
+ <xsl:if test="@type = 'footnote'">
4067
+
4068
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4069
+ <xsl:attribute name="font-size">80%</xsl:attribute>
4070
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4071
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
4072
+
4073
+
4074
+ </xsl:if>
4075
+
4076
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4077
+ <xsl:if test="normalize-space(@citeas) = ''">
4078
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
4079
+ </xsl:if>
4080
+ <xsl:if test="@type = 'inline'">
4081
+
4082
+
4083
+
4084
+ </xsl:if>
4085
+
4086
+ <xsl:apply-templates/>
4087
+ </fo:basic-link>
4088
+
4089
+ </fo:inline>
4090
+ </xsl:when>
4091
+ <xsl:otherwise>
4092
+ <fo:inline><xsl:apply-templates/></fo:inline>
4093
+ </xsl:otherwise>
4094
+ </xsl:choose>
3988
4095
  </xsl:template><xsl:template match="*[local-name() = 'tab']">
3989
4096
  <!-- zero-space char -->
3990
4097
  <xsl:variable name="depth">
@@ -4085,6 +4192,7 @@
4085
4192
 
4086
4193
 
4087
4194
 
4195
+
4088
4196
 
4089
4197
 
4090
4198
  <xsl:variable name="pos"><xsl:number count="rsd:sections/rsd:clause[not(@type='scope') and not(@type='conformance')]"/></xsl:variable> <!-- | rsd:sections/rsd:terms -->
@@ -4101,7 +4209,7 @@
4101
4209
 
4102
4210
 
4103
4211
 
4104
- </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
4212
+ </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
4105
4213
  <fo:block break-after="page"/>
4106
4214
  <fo:block>
4107
4215
  <xsl:call-template name="setId"/>
@@ -4109,7 +4217,8 @@
4109
4217
  </fo:block>
4110
4218
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
4111
4219
  <fo:block>
4112
- <xsl:call-template name="setId"/>
4220
+ <xsl:call-template name="setId"/>
4221
+
4113
4222
 
4114
4223
  <xsl:apply-templates/>
4115
4224
  </fo:block>
@@ -4160,6 +4269,153 @@
4160
4269
  </fo:block>
4161
4270
  </xsl:otherwise>
4162
4271
  </xsl:choose>
4272
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
4273
+ <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
4274
+ <bookmark><xsl:value-of select="@id"/></bookmark>
4275
+ </xsl:for-each>
4276
+ </xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
4277
+ <xsl:copy>
4278
+ <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
4279
+ </xsl:copy>
4280
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
4281
+ <xsl:variable name="id">
4282
+ <xsl:call-template name="generateIndexXrefId"/>
4283
+ </xsl:variable>
4284
+ <xsl:copy> <!-- add id to xref -->
4285
+ <xsl:apply-templates select="@*" mode="index_add_id"/>
4286
+ <xsl:attribute name="id">
4287
+ <xsl:value-of select="$id"/>
4288
+ </xsl:attribute>
4289
+ <xsl:apply-templates mode="index_add_id"/>
4290
+ </xsl:copy>
4291
+ <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
4292
+ <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
4293
+ <xsl:if test="@to">
4294
+ <xsl:value-of select="$dash"/>
4295
+ <xsl:copy>
4296
+ <xsl:copy-of select="@*"/>
4297
+ <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
4298
+ <xsl:attribute name="id">
4299
+ <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
4300
+ </xsl:attribute>
4301
+ <xsl:apply-templates mode="index_add_id"/>
4302
+ </xsl:copy>
4303
+ </xsl:if>
4304
+ </xsl:template><xsl:template match="@*|node()" mode="index_update">
4305
+ <xsl:copy>
4306
+ <xsl:apply-templates select="@*|node()" mode="index_update"/>
4307
+ </xsl:copy>
4308
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
4309
+ <xsl:copy>
4310
+ <xsl:apply-templates select="@*" mode="index_update"/>
4311
+ <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
4312
+ </xsl:copy>
4313
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
4314
+ <xsl:param name="element"/>
4315
+ <xsl:param name="remove" select="'false'"/>
4316
+ <xsl:param name="target"/>
4317
+ <!-- <node></node> -->
4318
+ <xsl:choose>
4319
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
4320
+ <!-- skip text (i.e. remove it) and process next element -->
4321
+ <!-- [removed_<xsl:value-of select="."/>] -->
4322
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4323
+ <xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
4324
+ </xsl:apply-templates>
4325
+ </xsl:when>
4326
+ <xsl:when test="self::text()">
4327
+ <xsl:value-of select="."/>
4328
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4329
+ </xsl:when>
4330
+ <xsl:when test="self::* and local-name(.) = 'xref'">
4331
+ <xsl:variable name="id" select="@id"/>
4332
+ <xsl:variable name="page" select="$index//item[@id = $id]"/>
4333
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
4334
+ <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
4335
+
4336
+ <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
4337
+ <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
4338
+
4339
+ <xsl:choose>
4340
+ <!-- 2nd pass -->
4341
+ <!-- if page is equal to page for next and page is not the end of range -->
4342
+ <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
4343
+ <!-- skip element (i.e. remove it) and remove next text ',' -->
4344
+ <!-- [removed_xref] -->
4345
+
4346
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4347
+ <xsl:with-param name="remove">true</xsl:with-param>
4348
+ <xsl:with-param name="target">
4349
+ <xsl:choose>
4350
+ <xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
4351
+ <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
4352
+ </xsl:choose>
4353
+ </xsl:with-param>
4354
+ </xsl:apply-templates>
4355
+ </xsl:when>
4356
+
4357
+ <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
4358
+ <!-- remove xref -->
4359
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
4360
+ <xsl:with-param name="remove">true</xsl:with-param>
4361
+ </xsl:apply-templates>
4362
+ </xsl:when>
4363
+
4364
+ <xsl:otherwise>
4365
+ <xsl:apply-templates select="." mode="xref_copy">
4366
+ <xsl:with-param name="target" select="$target"/>
4367
+ </xsl:apply-templates>
4368
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4369
+ </xsl:otherwise>
4370
+ </xsl:choose>
4371
+ </xsl:when>
4372
+ <xsl:when test="self::* and local-name(.) = 'ul'">
4373
+ <!-- ul -->
4374
+ <xsl:apply-templates select="." mode="index_update"/>
4375
+ </xsl:when>
4376
+ <xsl:otherwise>
4377
+ <xsl:apply-templates select="." mode="xref_copy">
4378
+ <xsl:with-param name="target" select="$target"/>
4379
+ </xsl:apply-templates>
4380
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
4381
+ </xsl:otherwise>
4382
+ </xsl:choose>
4383
+ </xsl:template><xsl:template match="@*|node()" mode="xref_copy">
4384
+ <xsl:param name="target"/>
4385
+ <xsl:copy>
4386
+ <xsl:apply-templates select="@*" mode="xref_copy"/>
4387
+ <xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
4388
+ <xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
4389
+ </xsl:if>
4390
+ <xsl:apply-templates select="node()" mode="xref_copy"/>
4391
+ </xsl:copy>
4392
+ </xsl:template><xsl:template name="generateIndexXrefId">
4393
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
4394
+
4395
+ <xsl:variable name="docid">
4396
+ <xsl:call-template name="getDocumentId"/>
4397
+ </xsl:variable>
4398
+ <xsl:variable name="item_number">
4399
+ <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
4400
+ </xsl:variable>
4401
+ <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
4402
+ <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
4403
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
4404
+ <xsl:apply-templates/>
4405
+ <fo:block>
4406
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
4407
+ <fo:block> </fo:block>
4408
+ </xsl:if>
4409
+ </fo:block>
4410
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
4411
+ <xsl:apply-templates/>
4412
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
4413
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
4414
+ <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
4415
+ <xsl:apply-templates/>
4416
+ </fo:block>
4417
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
4418
+ <fo:inline id="{@id}" font-size="1pt"/>
4163
4419
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
4164
4420
  <!-- <row>
4165
4421
  <date>05-07-2013</date>
@@ -4281,6 +4537,57 @@
4281
4537
  </xsl:variable>
4282
4538
  <xsl:variable name="result">
4283
4539
  <xsl:choose>
4540
+ <xsl:when test="$format = 'ddMMyyyy'">
4541
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4542
+ <xsl:text> </xsl:text>
4543
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4544
+ </xsl:when>
4545
+ <xsl:when test="$format = 'ddMM'">
4546
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4547
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4548
+ </xsl:when>
4549
+ <xsl:when test="$format = 'short' or $day = ''">
4550
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
4551
+ </xsl:when>
4552
+ <xsl:otherwise>
4553
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
4554
+ </xsl:otherwise>
4555
+ </xsl:choose>
4556
+ </xsl:variable>
4557
+ <xsl:value-of select="$result"/>
4558
+ </xsl:template><xsl:template name="convertDateLocalized">
4559
+ <xsl:param name="date"/>
4560
+ <xsl:param name="format" select="'short'"/>
4561
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
4562
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
4563
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
4564
+ <xsl:variable name="monthStr">
4565
+ <xsl:choose>
4566
+ <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>
4567
+ <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>
4568
+ <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>
4569
+ <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>
4570
+ <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>
4571
+ <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>
4572
+ <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>
4573
+ <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>
4574
+ <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>
4575
+ <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>
4576
+ <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>
4577
+ <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>
4578
+ </xsl:choose>
4579
+ </xsl:variable>
4580
+ <xsl:variable name="result">
4581
+ <xsl:choose>
4582
+ <xsl:when test="$format = 'ddMMyyyy'">
4583
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4584
+ <xsl:text> </xsl:text>
4585
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
4586
+ </xsl:when>
4587
+ <xsl:when test="$format = 'ddMM'">
4588
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
4589
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
4590
+ </xsl:when>
4284
4591
  <xsl:when test="$format = 'short' or $day = ''">
4285
4592
  <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
4286
4593
  </xsl:when>
@@ -4296,7 +4603,7 @@
4296
4603
  <xsl:param name="charDelim" select="', '"/>
4297
4604
  <xsl:choose>
4298
4605
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
4299
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4606
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4300
4607
  <xsl:sort data-type="text" order="ascending"/>
4301
4608
  <xsl:call-template name="insertKeyword">
4302
4609
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -4305,7 +4612,7 @@
4305
4612
  </xsl:for-each>
4306
4613
  </xsl:when>
4307
4614
  <xsl:otherwise>
4308
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4615
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
4309
4616
  <xsl:call-template name="insertKeyword">
4310
4617
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
4311
4618
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -4322,63 +4629,71 @@
4322
4629
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
4323
4630
  </xsl:choose>
4324
4631
  </xsl:template><xsl:template name="addPDFUAmeta">
4325
- <fo:declarations>
4326
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4327
- <pdf:dictionary type="normal" key="ViewerPreferences">
4328
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4329
- </pdf:dictionary>
4330
- </pdf:catalog>
4331
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
4332
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4333
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4334
- <!-- Dublin Core properties go here -->
4335
- <dc:title>
4336
- <xsl:variable name="title">
4632
+ <xsl:variable name="lang">
4633
+ <xsl:call-template name="getLang"/>
4634
+ </xsl:variable>
4635
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
4636
+ <pdf:dictionary type="normal" key="ViewerPreferences">
4637
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
4638
+ </pdf:dictionary>
4639
+ </pdf:catalog>
4640
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
4641
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
4642
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
4643
+ <!-- Dublin Core properties go here -->
4644
+ <dc:title>
4645
+ <xsl:variable name="title">
4646
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4647
+
4337
4648
 
4338
4649
 
4339
4650
 
4340
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/>
4651
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
4341
4652
 
4342
4653
 
4343
4654
 
4344
- </xsl:variable>
4345
- <xsl:choose>
4346
- <xsl:when test="normalize-space($title) != ''">
4347
- <xsl:value-of select="$title"/>
4348
- </xsl:when>
4349
- <xsl:otherwise>
4350
- <xsl:text> </xsl:text>
4351
- </xsl:otherwise>
4352
- </xsl:choose>
4353
- </dc:title>
4354
- <dc:creator>
4655
+ </xsl:for-each>
4656
+ </xsl:variable>
4657
+ <xsl:choose>
4658
+ <xsl:when test="normalize-space($title) != ''">
4659
+ <xsl:value-of select="$title"/>
4660
+ </xsl:when>
4661
+ <xsl:otherwise>
4662
+ <xsl:text> </xsl:text>
4663
+ </xsl:otherwise>
4664
+ </xsl:choose>
4665
+ </dc:title>
4666
+ <dc:creator>
4667
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
4355
4668
 
4669
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4670
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
4671
+ <xsl:if test="position() != last()">; </xsl:if>
4672
+ </xsl:for-each>
4356
4673
 
4357
4674
 
4358
- </dc:creator>
4359
- <dc:description>
4360
- <xsl:variable name="abstract">
4361
-
4362
-
4363
-
4364
-
4365
- <xsl:copy-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'abstract']//text()"/>
4366
-
4367
-
4368
- </xsl:variable>
4369
- <xsl:value-of select="normalize-space($abstract)"/>
4370
- </dc:description>
4371
- <pdf:Keywords>
4372
- <xsl:call-template name="insertKeywords"/>
4373
- </pdf:Keywords>
4374
- </rdf:Description>
4375
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
4376
- <!-- XMP properties go here -->
4377
- <xmp:CreatorTool/>
4378
- </rdf:Description>
4379
- </rdf:RDF>
4380
- </x:xmpmeta>
4381
- </fo:declarations>
4675
+
4676
+ </xsl:for-each>
4677
+ </dc:creator>
4678
+ <dc:description>
4679
+ <xsl:variable name="abstract">
4680
+
4681
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
4682
+
4683
+
4684
+ </xsl:variable>
4685
+ <xsl:value-of select="normalize-space($abstract)"/>
4686
+ </dc:description>
4687
+ <pdf:Keywords>
4688
+ <xsl:call-template name="insertKeywords"/>
4689
+ </pdf:Keywords>
4690
+ </rdf:Description>
4691
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
4692
+ <!-- XMP properties go here -->
4693
+ <xmp:CreatorTool/>
4694
+ </rdf:Description>
4695
+ </rdf:RDF>
4696
+ </x:xmpmeta>
4382
4697
  </xsl:template><xsl:template name="getId">
4383
4698
  <xsl:choose>
4384
4699
  <xsl:when test="../@id">
@@ -4475,6 +4790,7 @@
4475
4790
 
4476
4791
 
4477
4792
 
4793
+
4478
4794
  </xsl:variable>
4479
4795
  <xsl:if test="$documentNS != $XSLNS">
4480
4796
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>