metanorma-bipm 1.0.1 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3acf341b606e1c45ba970fa51074d7ff9cb2cfb424a0a4439821af1b5f76f6bf
4
- data.tar.gz: 15d7d12f963aee720825f1a4481670efde7430dd02aaca56cebecdb1d7190999
3
+ metadata.gz: 64a23fe1ec38fdd6edc912843f0a71d26426842674e27859c968e3973cff519b
4
+ data.tar.gz: a9b8f00c4ebaff5fd36d32390e0edbe7aed2fc63a31aaec9af7b949c82656d03
5
5
  SHA512:
6
- metadata.gz: cb967276a656a03fde3b69145a43ce1b01805bac6123ca205127317943c89d3154276a4cffd526dde879cc561bc7cf97eba895cd2f9d5b8b8390ddd3041b0e05
7
- data.tar.gz: 3d8075a9b34a50e72009eb55498ec16fdab6b075a63af4638dcb95e2c61408bc20199fac99115449c4234c4d8afe3050d3040883a1bd3f2933fd43fb6cb8dc84
6
+ metadata.gz: 6e3d8a6280a0cfebaba1b33c7bbc3e02dfe011d4a0545738b519e52d0b6211d2c0a3e2a087588cb7acbcbb095d69c8830685a498e170c3a3d584f156cea17df3
7
+ data.tar.gz: fc3870e78f57d64b19214f1b4b444ae83b49b7d46d42cc17f2d0df344972fc8bc2c94b9190a5b2bc3c23095f2c49bd1683da006cf9c3dc90c6de9d513d882e7d
@@ -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,47 +16,27 @@ 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:
33
- - uses: actions/checkout@master
33
+ - uses: actions/checkout@v2
34
+ with:
35
+ submodules: true
34
36
 
35
37
  - uses: ruby/setup-ruby@v1
36
38
  with:
37
39
  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
40
+ bundler-cache: true
48
41
 
49
42
  - run: bundle exec rake
50
-
51
- tests-passed:
52
- needs: rake
53
- runs-on: ubuntu-latest
54
- steps:
55
- - name: Trigger tests passed event
56
- uses: Sibz/github-status-action@v1
57
- with:
58
- authToken: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
59
- context: 'tests-passed-successfully'
60
- description: 'Tests passed successfully'
61
- state: 'success'
62
- sha: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -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"/>
@@ -340,6 +340,9 @@
340
340
  <zeroOrMore>
341
341
  <ref name="termdocsource"/>
342
342
  </zeroOrMore>
343
+ <optional>
344
+ <ref name="misccontainer"/>
345
+ </optional>
343
346
  <optional>
344
347
  <ref name="boilerplate"/>
345
348
  </optional>
@@ -355,6 +358,9 @@
355
358
  <optional>
356
359
  <ref name="bibliography"/>
357
360
  </optional>
361
+ <zeroOrMore>
362
+ <ref name="indexsect"/>
363
+ </zeroOrMore>
358
364
  </element>
359
365
  </define>
360
366
  </grammar>
@@ -0,0 +1,37 @@
1
+ <boilerplate>
2
+ <copyright-statement>
3
+ <clause>
4
+ <p> © JCGM {{ docyear }} </p>
5
+ <p>Copyright of this JCGM guidance document is shared jointly by the JCGM member organizations (BIPM, IEC,
6
+ IFCC, ILAC, ISO, IUPAC, IUPAP and OIML).</p>
7
+ </clause>
8
+ </copyright-statement>
9
+ <license-statement>
10
+ <clause>
11
+ <title>Copyright</title>
12
+ <p>Even if electronic versions are available free of charge on the website of one or more of the JCGM member organizations, economic and moral copyrights related to all JCGM publications are internationally protected. The JCGM does not, without its written authorisation, permit third parties to rewrite or re-brand issues, to sell copies to the public, or to broadcast or use on-line its publications. Equally, the JCGM also objects to distortion, augmentation or mutilation of its publications, including its titles, slogans and logos, and those of its member organizations.</p>
13
+ </clause>
14
+ <clause>
15
+ <title>Official versions and translations</title>
16
+ <p>The only official versions of documents are those published by the JCGM, in their original languages.</p>
17
+
18
+ <p>The JCGM’s publications may be translated into languages other than those in which the documents were originally published by the JCGM. Permission must be obtained from the JCGM before a translation can be made. All translations should respect the original and official format of the formulae and units (without any conversion to other formulae or units), and contain the following statement (to be translated into the chosen language):</p>
19
+
20
+ <quote>All JCGM’s products are internationally protected by copyright. This translation of the original JCGM document has been produced with the permission of the JCGM. The JCGM retains full internationally protected copyright on the design and content of this document and on the JCGM’s titles, slogan and logos. The member organizations of the JCGM also retain full internationally protected right on their titles, slogans and logos included in the JCGM’s publications. The only official version is the document published by the JCGM, in the original languages.</quote>
21
+
22
+ <p>The JCGM does not accept any liability for the relevance, accuracy, completeness or quality of the information and materials offered in any translation. A copy of the translation shall be provided to the JCGM at the time of publication.</p>
23
+ </clause>
24
+ <clause>
25
+ <title>Reproduction</title>
26
+ <p>The JCGM’s publications may be reproduced, provided written permission has been granted by the JCGM. A sample of any reproduced document shall be provided to the JCGM at the time of reproduction and contain the following statement:</p>
27
+ <quote>This document is reproduced with the permission of the JCGM, which retains full internationally protected copyright on the design and content of this document and on the JCGM’s titles, slogans and logos. The member organizations of the JCGM also retain full internationally protected right on their titles, slogans and logos included in the JCGM’s publications. The only official versions are the original versions of the documents published by the JCGM.</quote>
28
+ </clause>
29
+ </license-statement>
30
+ <legal-statement>
31
+ <clause>
32
+ <title>Disclaimer</title>
33
+ <p>The JCGM and its member organizations have published this document to enhance access to information about metrology. They endeavor to update it on a regular basis, but cannot guarantee the accuracy at all times and shall not be responsible for any direct or indirect damage that may result from its use. Any reference to commercial products of any kind (including but not restricted to any software, data or hardware) or links to websites, over which the JCGM and its member organizations have no control and for which they assume no responsibility, does not imply any approval, endorsement or recommendation by the JCGM and its member organizations.</p>
34
+ </clause>
35
+ </legal-statement>
36
+ </boilerplate>
37
+
@@ -104,13 +104,11 @@ module Asciidoctor
104
104
  ["en", "fr"].each do |lang|
105
105
  at = { language: lang, format: "text/plain" }
106
106
  xml.title **attr_code(at.merge(type: "main")) do |t1|
107
- t1 << Asciidoctor::Standoc::Utils::asciidoc_sub(
108
- node.attr("title-#{lang}"))
107
+ t1 << Metanorma::Utils::asciidoc_sub(node.attr("title-#{lang}"))
108
+ end
109
+ %w(cover appendix annex part subpart).each do |w|
110
+ typed_title(node, xml, lang, w)
109
111
  end
110
- typed_title(node, xml, lang, "cover")
111
- typed_title(node, xml, lang, "appendix")
112
- typed_title(node, xml, lang, "part")
113
- typed_title(node, xml, lang, "subpart")
114
112
  end
115
113
  end
116
114
 
@@ -118,7 +116,7 @@ module Asciidoctor
118
116
  at = { language: lang, format: "text/plain" }
119
117
  return unless title = node.attr("title-#{type}-#{lang}")
120
118
  xml.title **attr_code(at.merge(type: type)) do |t1|
121
- t1 << Asciidoctor::Standoc::Utils::asciidoc_sub(title)
119
+ t1 << Metanorma::Utils::asciidoc_sub(title)
122
120
  end
123
121
  end
124
122
 
@@ -174,6 +172,11 @@ module Asciidoctor
174
172
  end
175
173
  end
176
174
 
175
+ def boilerplate_file(xmldoc)
176
+ return super unless xmldoc&.at("//bibdata/ext/editorialgroup/committee/@acronym")&.value == "JCGM"
177
+ File.join(File.dirname(__FILE__), "boilerplate-jcgm-en.xml")
178
+ end
179
+
177
180
  def mathml_mi_italics
178
181
  { uppergreek: false, upperroman: false,
179
182
  lowergreek: false, lowerroman: true }
@@ -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"/>
@@ -253,6 +253,9 @@
253
253
  <data type="boolean"/>
254
254
  </attribute>
255
255
  </optional>
256
+ <optional>
257
+ <attribute name="width"/>
258
+ </optional>
256
259
  <optional>
257
260
  <ref name="colgroup"/>
258
261
  </optional>
@@ -786,6 +789,9 @@
786
789
  <attribute name="width"/>
787
790
  </element>
788
791
  </define>
792
+ <define name="BibItemType" combine="choice">
793
+ <value>internal</value>
794
+ </define>
789
795
  <define name="TextElement" combine="choice">
790
796
  <ref name="concept"/>
791
797
  </define>
@@ -806,6 +812,8 @@
806
812
  <ref name="requirement"/>
807
813
  <ref name="recommendation"/>
808
814
  <ref name="permission"/>
815
+ <ref name="imagemap"/>
816
+ <ref name="svgmap"/>
809
817
  </choice>
810
818
  </define>
811
819
  <define name="bibliography">
@@ -836,6 +844,9 @@
836
844
  <data type="boolean"/>
837
845
  </attribute>
838
846
  </optional>
847
+ <optional>
848
+ <attribute name="number"/>
849
+ </optional>
839
850
  <optional>
840
851
  <attribute name="obligation">
841
852
  <choice>
@@ -891,9 +902,11 @@
891
902
  <element name="code">
892
903
  <text/>
893
904
  </element>
894
- <element name="text">
895
- <text/>
896
- </element>
905
+ <optional>
906
+ <element name="text">
907
+ <text/>
908
+ </element>
909
+ </optional>
897
910
  </element>
898
911
  </define>
899
912
  <define name="standard-document">
@@ -906,6 +919,9 @@
906
919
  </choice>
907
920
  </attribute>
908
921
  <ref name="bibdata"/>
922
+ <optional>
923
+ <ref name="misccontainer"/>
924
+ </optional>
909
925
  <optional>
910
926
  <ref name="boilerplate"/>
911
927
  </optional>
@@ -916,11 +932,21 @@
916
932
  <zeroOrMore>
917
933
  <ref name="annex"/>
918
934
  </zeroOrMore>
935
+ <optional>
936
+ <ref name="bibliography"/>
937
+ </optional>
919
938
  <zeroOrMore>
920
- <ref name="references"/>
939
+ <ref name="indexsect"/>
921
940
  </zeroOrMore>
922
941
  </element>
923
942
  </define>
943
+ <define name="misccontainer">
944
+ <element name="misc-container">
945
+ <oneOrMore>
946
+ <ref name="AnyElement"/>
947
+ </oneOrMore>
948
+ </element>
949
+ </define>
924
950
  <define name="preface">
925
951
  <element name="preface">
926
952
  <oneOrMore>
@@ -944,6 +970,11 @@
944
970
  <ref name="Content-Section"/>
945
971
  </element>
946
972
  </define>
973
+ <define name="indexsect">
974
+ <element name="indexsect">
975
+ <ref name="Content-Section"/>
976
+ </element>
977
+ </define>
947
978
  <define name="boilerplate">
948
979
  <element name="boilerplate">
949
980
  <optional>
@@ -1063,6 +1094,9 @@
1063
1094
  </choice>
1064
1095
  </attribute>
1065
1096
  </optional>
1097
+ <optional>
1098
+ <attribute name="number"/>
1099
+ </optional>
1066
1100
  <optional>
1067
1101
  <attribute name="type"/>
1068
1102
  </optional>
@@ -1116,6 +1150,9 @@
1116
1150
  <optional>
1117
1151
  <attribute name="type"/>
1118
1152
  </optional>
1153
+ <optional>
1154
+ <attribute name="number"/>
1155
+ </optional>
1119
1156
  <optional>
1120
1157
  <ref name="section-title"/>
1121
1158
  </optional>
@@ -1218,6 +1255,9 @@
1218
1255
  <optional>
1219
1256
  <attribute name="type"/>
1220
1257
  </optional>
1258
+ <optional>
1259
+ <attribute name="number"/>
1260
+ </optional>
1221
1261
  <optional>
1222
1262
  <attribute name="obligation">
1223
1263
  <choice>
@@ -1546,6 +1586,7 @@
1546
1586
  <value>add</value>
1547
1587
  <value>modify</value>
1548
1588
  <value>delete</value>
1589
+ <value>replace</value>
1549
1590
  </choice>
1550
1591
  </attribute>
1551
1592
  <optional>
@@ -1576,6 +1617,11 @@
1576
1617
  </optional>
1577
1618
  <optional>
1578
1619
  <element name="newcontent">
1620
+ <optional>
1621
+ <attribute name="id">
1622
+ <data type="ID"/>
1623
+ </attribute>
1624
+ </optional>
1579
1625
  <zeroOrMore>
1580
1626
  <ref name="BasicBlock"/>
1581
1627
  </zeroOrMore>
@@ -1609,4 +1655,87 @@
1609
1655
  <text/>
1610
1656
  </element>
1611
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>
1612
1741
  </grammar>
@@ -16,7 +16,7 @@ module IsoDoc
16
16
  if @jcgm
17
17
  super
18
18
  else
19
- middle_title(out)
19
+ middle_title(isoxml, out)
20
20
  middle_admonitions(isoxml, out)
21
21
  clause isoxml, out
22
22
  annex isoxml, out
@@ -11,7 +11,6 @@
11
11
  <!-- <item id="#">N_page</item> -->
12
12
  <!-- param for second pass -->
13
13
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
14
- <xsl:variable name="index" select="document($external_index)"/>
15
14
 
16
15
  <xsl:variable name="first_pass" select="count($index//item) = 0"/>
17
16
 
@@ -114,7 +113,8 @@
114
113
 
115
114
  <!-- add id to xref and split xref with @to into two xref -->
116
115
  <xsl:variable name="current_document_index_id">
117
- <xsl:apply-templates select=".//bipm:clause[@type = 'index']" mode="index_add_id"/>
116
+ <!-- <xsl:apply-templates select=".//bipm:clause[@type = 'index']" mode="index_add_id"/> -->
117
+ <xsl:apply-templates select=".//bipm:indexsect" mode="index_add_id"/>
118
118
  </xsl:variable>
119
119
 
120
120
  <xsl:variable name="current_document_index">
@@ -145,7 +145,8 @@
145
145
  </xsl:variable>
146
146
 
147
147
  <xsl:variable name="current_document_index_id">
148
- <xsl:apply-templates select=".//bipm:clause[@type = 'index']" mode="index_add_id"/>
148
+ <!-- <xsl:apply-templates select=".//bipm:clause[@type = 'index']" mode="index_add_id"/> -->
149
+ <xsl:apply-templates select=".//bipm:indexsect" mode="index_add_id"/>
149
150
  </xsl:variable>
150
151
 
151
152
  <xsl:variable name="current_document_index">
@@ -165,8 +166,7 @@
165
166
  </xsl:choose>
166
167
  </xsl:variable>
167
168
 
168
- <xsl:variable name="dash" select="'–'"/>
169
-
169
+
170
170
  <xsl:variable name="ids">
171
171
  <xsl:for-each select="//*[@id]">
172
172
  <id><xsl:value-of select="@id"/></id>
@@ -194,7 +194,8 @@
194
194
  <xsl:apply-templates select="/*/bipm:bibliography/bipm:references[not(@normative='true')]" mode="contents"/>
195
195
 
196
196
  <!-- Index -->
197
- <xsl:apply-templates select="//bipm:clause[@type = 'index']" mode="contents"/>
197
+ <!-- <xsl:apply-templates select="//bipm:clause[@type = 'index']" mode="contents"/> -->
198
+ <xsl:apply-templates select="//bipm:indexsect" mode="contents"/>
198
199
 
199
200
  </contents>
200
201
  </xsl:template>
@@ -278,8 +279,9 @@
278
279
 
279
280
  </fo:layout-master-set>
280
281
 
281
-
282
- <xsl:call-template name="addPDFUAmeta"/>
282
+ <fo:declarations>
283
+ <xsl:call-template name="addPDFUAmeta"/>
284
+ </fo:declarations>
283
285
 
284
286
  <xsl:call-template name="addBookmarks">
285
287
  <xsl:with-param name="contents" select="$contents"/>
@@ -830,7 +832,8 @@
830
832
  </xsl:choose>
831
833
  </xsl:template>
832
834
 
833
- <xsl:template match="bipm:clause[@type = 'index']" mode="flatxml"/>
835
+ <!-- <xsl:template match="bipm:clause[@type = 'index']" mode="flatxml"/> -->
836
+ <xsl:template match="bipm:indexsect" mode="flatxml"/>
834
837
  <!-- <xsl:template match="bipm:clause[@type = 'index']" mode="flatxml">
835
838
  <xsl:copy>
836
839
  <xsl:apply-templates select="@*" mode="flatxml_index"/>
@@ -1083,7 +1086,8 @@
1083
1086
  <xsl:apply-templates select="bipm:bibliography/bipm:references[not(@normative='true')]" mode="sections"/>
1084
1087
 
1085
1088
  <!-- Index -->
1086
- <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//bipm:clause[@type = 'index']" mode="index"/>
1089
+ <!-- <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//bipm:clause[@type = 'index']" mode="index" /> -->
1090
+ <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//bipm:indexsect" mode="index"/>
1087
1091
 
1088
1092
  <!-- End Document Pages -->
1089
1093
 
@@ -1127,18 +1131,22 @@
1127
1131
  <fo:block-container font-size="18pt" font-weight="bold" text-align="center">
1128
1132
  <fo:block>
1129
1133
 
1130
- <xsl:variable name="title">
1131
- <xsl:choose>
1132
- <xsl:when test="$independentAppendix != ''">
1133
- <xsl:value-of select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='appendix']"/>
1134
- </xsl:when>
1135
- <xsl:otherwise> <!-- doctype = 'guide' -->
1136
- <xsl:value-of select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='main']"/>
1137
- </xsl:otherwise>
1138
- </xsl:choose>
1139
- </xsl:variable>
1134
+ <!-- <xsl:variable name="title"> -->
1135
+ <xsl:choose>
1136
+ <xsl:when test="$independentAppendix != ''">
1137
+ <xsl:apply-templates select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='appendix']" mode="title"/>
1138
+ <fo:block>
1139
+ <xsl:apply-templates select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='annex']" mode="title"/>
1140
+ </fo:block>
1141
+ </xsl:when>
1142
+ <xsl:otherwise> <!-- doctype = 'guide' -->
1143
+ <xsl:apply-templates select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='main']" mode="title"/>
1144
+ </xsl:otherwise>
1145
+ </xsl:choose>
1146
+ <!-- </xsl:variable> -->
1140
1147
 
1141
- <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1148
+
1149
+ <!-- <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1142
1150
 
1143
1151
  <xsl:choose>
1144
1152
  <xsl:when test="$curr_lang = 'en' and contains($title, $mep_text)">
@@ -1149,7 +1157,7 @@
1149
1157
  <xsl:otherwise>
1150
1158
  <xsl:value-of select="$title"/>
1151
1159
  </xsl:otherwise>
1152
- </xsl:choose>
1160
+ </xsl:choose> -->
1153
1161
 
1154
1162
  </fo:block>
1155
1163
 
@@ -1161,7 +1169,7 @@
1161
1169
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang=$curr_lang]),'#',$part_num)"/>
1162
1170
  </xsl:if>
1163
1171
  <xsl:text>: </xsl:text>
1164
- <xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part']"/>
1172
+ <xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part']" mode="title"/>
1165
1173
  </fo:block>
1166
1174
  </xsl:if>
1167
1175
  <xsl:variable name="subpart_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:subpart)"/>
@@ -1171,7 +1179,7 @@
1171
1179
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang=$curr_lang]),'#',$subpart_num)"/>
1172
1180
  </xsl:if>
1173
1181
  <xsl:text>: </xsl:text>
1174
- <xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart']"/>
1182
+ <xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart']" mode="title"/>
1175
1183
  </fo:block>
1176
1184
  </xsl:if>
1177
1185
 
@@ -1243,7 +1251,8 @@
1243
1251
  <xsl:apply-templates select="bipm:bibliography/bipm:references[not(@normative='true')]" mode="sections"/>
1244
1252
 
1245
1253
  <!-- Index -->
1246
- <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//bipm:clause[@type = 'index']" mode="index"/>
1254
+ <!-- <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//bipm:clause[@type = 'index']" mode="index" /> -->
1255
+ <xsl:apply-templates select="xalan:nodeset($indexes)/doc[@id = $docid]//bipm:indexsect" mode="index"/>
1247
1256
 
1248
1257
  </xsl:otherwise>
1249
1258
  </xsl:choose>
@@ -1354,71 +1363,143 @@
1354
1363
  <fo:block font-size="14pt" font-weight="{$weight-bold}" margin-top="4mm"><xsl:value-of select="concat((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:edition, ' ', $edition_str, ' ', $copyrightYear)"/></fo:block>
1355
1364
  </fo:block-container>
1356
1365
 
1357
- <fo:block-container height="98%" display-align="center">
1366
+ <!-- <fo:block-container height="98%" display-align="center"> -->
1367
+ <fo:block-container absolute-position="fixed" left="12.5mm" top="92mm" height="170mm" width="144mm" display-align="center">
1358
1368
  <fo:block>
1369
+
1370
+ <xsl:variable name="title_appendix_fr">
1371
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'appendix']" mode="title"/>
1372
+ </xsl:variable>
1373
+ <xsl:variable name="title_appendix_en">
1374
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'appendix']" mode="title"/>
1375
+ </xsl:variable>
1376
+ <xsl:variable name="title_annex_fr">
1377
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'annex']" mode="title"/>
1378
+ </xsl:variable>
1379
+ <xsl:variable name="title_annex_en">
1380
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'annex']" mode="title"/>
1381
+ </xsl:variable>
1382
+ <xsl:variable name="title_part_fr">
1383
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'part']" mode="title"/>
1384
+ </xsl:variable>
1385
+ <xsl:variable name="title_part_en">
1386
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'part']" mode="title"/>
1387
+ </xsl:variable>
1388
+ <xsl:variable name="title_subpart_fr">
1389
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'subpart']" mode="title"/>
1390
+ </xsl:variable>
1391
+ <xsl:variable name="title_subpart_en">
1392
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'subpart']" mode="title"/>
1393
+ </xsl:variable>
1394
+
1395
+ <xsl:variable name="titles_length" select="string-length($title_appendix_fr) + string-length($title_appendix_en) + string-length($title_annex_fr) + string-length($title_annex_en) + string-length($title_part_fr) + string-length($title_part_en) + string-length($title_subpart_fr) + string-length($title_subpart_fr)"/>
1396
+
1397
+ <!-- <xsl:variable name="font-size-number-factor">
1398
+ <xsl:choose>
1399
+ <xsl:when test="$titles_length &gt; 350">0.7</xsl:when>
1400
+ <xsl:when test="$titles_length &gt; 250">0.85</xsl:when>
1401
+ <xsl:when test="$titles_length &gt; 130">0.9</xsl:when>
1402
+ <xsl:otherwise>1</xsl:otherwise>
1403
+ </xsl:choose>
1404
+ </xsl:variable> -->
1405
+
1406
+ <xsl:variable name="space-factor">
1407
+ <xsl:choose>
1408
+ <xsl:when test="$titles_length &gt; 250">0.3</xsl:when>
1409
+ <xsl:when test="$titles_length &gt; 200">0.5</xsl:when>
1410
+ <xsl:when test="$titles_length &gt; 150">0.7</xsl:when>
1411
+ <xsl:otherwise>1</xsl:otherwise>
1412
+ </xsl:choose>
1413
+ </xsl:variable>
1414
+
1415
+ <xsl:variable name="font-size-factor">
1416
+ <xsl:choose>
1417
+ <xsl:when test="$titles_length &gt; 350">0.5</xsl:when>
1418
+ <xsl:when test="$titles_length &gt; 250">0.55</xsl:when>
1419
+ <xsl:when test="$titles_length &gt; 180">0.65</xsl:when>
1420
+ <xsl:when test="$titles_length &gt; 130">0.8</xsl:when>
1421
+ <xsl:otherwise>1</xsl:otherwise>
1422
+ </xsl:choose>
1423
+ </xsl:variable>
1424
+
1425
+ <xsl:variable name="font-size-number-factor">
1426
+ <xsl:choose>
1427
+ <xsl:when test="$font-size-factor &lt; 1"><xsl:value-of select="$font-size-factor *1.3"/></xsl:when>
1428
+ <xsl:otherwise>1</xsl:otherwise>
1429
+ </xsl:choose>
1430
+ </xsl:variable>
1431
+
1432
+ <!-- <fo:block font-size="6pt">DEBUG font-size-factor=<xsl:value-of select="$font-size-factor"/>, titles_length=<xsl:value-of select="$titles_length"/></fo:block> -->
1359
1433
  <!-- Appendix titles processing -->
1360
1434
  <xsl:variable name="appendix_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix)"/>
1361
1435
  <xsl:if test="$appendix_num != ''">
1362
- <fo:block font-size="17pt" font-weight="{$weight-normal}">Annexe <xsl:value-of select="$appendix_num"/></fo:block>
1363
- <fo:block font-size="17pt" font-weight="{$weight-bold}">Appendix <xsl:value-of select="$appendix_num"/></fo:block>
1436
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-normal}">Annexe <xsl:value-of select="$appendix_num"/></fo:block>
1437
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-bold}">Appendix <xsl:value-of select="$appendix_num"/></fo:block>
1364
1438
  </xsl:if>
1365
-
1439
+
1440
+
1366
1441
  <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'appendix']">
1367
- <fo:block font-size="30.4pt">
1368
- <fo:block> </fo:block>
1369
- <fo:block font-weight="{$weight-normal}"><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'appendix']"/></fo:block>
1370
- <fo:block> </fo:block>
1442
+ <fo:block font-size="{$font-size-factor * 30.4}pt">
1443
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1444
+ <fo:block font-weight="{$weight-normal}"><xsl:copy-of select="$title_appendix_fr"/></fo:block>
1445
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1371
1446
  <fo:block font-weight="{$weight-bold}">
1372
- <xsl:variable name="title_en" select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'appendix']"/>
1373
- <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1374
- <xsl:choose>
1375
- <xsl:when test="contains($title_en, $mep_text)">
1376
- <xsl:value-of select="substring-before($title_en, $mep_text)"/>
1377
- <xsl:text> </xsl:text><fo:inline font-style="italic"><xsl:value-of select="$mep_text"/></fo:inline><xsl:text> </xsl:text>
1378
- <xsl:value-of select="substring-after($title_en, $mep_text)"/>
1379
- </xsl:when>
1380
- <xsl:otherwise>
1381
- <xsl:value-of select="$title_en"/>
1382
- </xsl:otherwise>
1383
- </xsl:choose>
1447
+ <xsl:copy-of select="$title_appendix_en"/>
1384
1448
  </fo:block>
1385
1449
  </fo:block>
1386
1450
  </xsl:if>
1387
1451
  <!-- End Appendix titles processing -->
1388
1452
 
1453
+ <!-- Annex title processing -->
1454
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'annex']">
1455
+ <xsl:variable name="annex_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:annexid)"/>
1456
+ <xsl:if test="$annex_num != ''">
1457
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1458
+ <!-- Annexe -->
1459
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-normal}">Annexe <xsl:value-of select="$annex_num"/></fo:block>
1460
+ <!-- Annex -->
1461
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-bold}">Annex <xsl:value-of select="$annex_num"/></fo:block>
1462
+ </xsl:if>
1463
+
1464
+ <fo:block font-size="{$font-size-factor * 30.4}pt">
1465
+
1466
+ <xsl:if test="normalize-space($title_annex_fr) != ''">
1467
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1468
+ <fo:block font-weight="{$weight-normal}"><xsl:copy-of select="$title_annex_fr"/></fo:block>
1469
+ </xsl:if>
1470
+
1471
+ <xsl:if test="normalize-space($title_annex_en) != ''">
1472
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1473
+ <fo:block font-weight="{$weight-bold}">
1474
+ <xsl:copy-of select="$title_annex_en"/>
1475
+ </fo:block>
1476
+ </xsl:if>
1477
+ </fo:block>
1478
+ </xsl:if>
1479
+ <!-- End Annex titles processing -->
1389
1480
 
1390
- <!-- Part titles processing -->
1481
+ <!-- Part titles processing -->
1391
1482
  <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'part']">
1392
1483
  <xsl:variable name="part_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:part)"/>
1393
1484
  <xsl:if test="$part_num != ''">
1485
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1394
1486
  <!-- Part -->
1395
- <fo:block font-size="17pt" font-weight="{$weight-normal}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='fr']),'#',$part_num)"/></fo:block>
1487
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-normal}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='fr']),'#',$part_num)"/></fo:block>
1396
1488
  <!-- Partie -->
1397
- <fo:block font-size="17pt" font-weight="{$weight-bold}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='en']),'#',$part_num)"/></fo:block>
1489
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-bold}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='en']),'#',$part_num)"/></fo:block>
1398
1490
  </xsl:if>
1399
1491
 
1400
- <fo:block font-size="30.4pt">
1492
+ <fo:block font-size="{$font-size-factor * 30.4}pt">
1401
1493
 
1402
- <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'part']">
1403
- <fo:block> </fo:block>
1404
- <fo:block font-weight="{$weight-normal}"><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'part']"/></fo:block>
1494
+ <xsl:if test="normalize-space($title_part_fr) != ''">
1495
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1496
+ <fo:block font-weight="{$weight-normal}"><xsl:copy-of select="$title_part_fr"/></fo:block>
1405
1497
  </xsl:if>
1406
1498
 
1407
- <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'part']">
1408
- <fo:block> </fo:block>
1499
+ <xsl:if test="normalize-space($title_part_en) != ''">
1500
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1409
1501
  <fo:block font-weight="{$weight-bold}">
1410
- <xsl:variable name="title_en" select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'part']"/>
1411
- <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1412
- <xsl:choose>
1413
- <xsl:when test="contains($title_en, $mep_text)">
1414
- <xsl:value-of select="substring-before($title_en, $mep_text)"/>
1415
- <xsl:text> </xsl:text><fo:inline font-style="italic"><xsl:value-of select="$mep_text"/></fo:inline><xsl:text> </xsl:text>
1416
- <xsl:value-of select="substring-after($title_en, $mep_text)"/>
1417
- </xsl:when>
1418
- <xsl:otherwise>
1419
- <xsl:value-of select="$title_en"/>
1420
- </xsl:otherwise>
1421
- </xsl:choose>
1502
+ <xsl:copy-of select="$title_part_en"/>
1422
1503
  </fo:block>
1423
1504
  </xsl:if>
1424
1505
  </fo:block>
@@ -1429,34 +1510,25 @@
1429
1510
  <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'subpart']">
1430
1511
  <xsl:variable name="subpart_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:subpart)"/>
1431
1512
  <xsl:if test="$subpart_num != ''">
1513
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1432
1514
  <!-- Sub-part -->
1433
- <fo:block font-size="17pt" font-weight="{$weight-normal}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang='fr']),'#',$subpart_num)"/> <xsl:value-of select="$subpart_num"/></fo:block>
1515
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-normal}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang='fr']),'#',$subpart_num)"/> <xsl:value-of select="$subpart_num"/></fo:block>
1434
1516
  <!-- Partie de sub -->
1435
- <fo:block font-size="17pt" font-weight="{$weight-bold}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang='en']),'#',$subpart_num)"/> <xsl:value-of select="$subpart_num"/></fo:block>
1517
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-bold}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang='en']),'#',$subpart_num)"/> <xsl:value-of select="$subpart_num"/></fo:block>
1436
1518
  </xsl:if>
1437
1519
 
1438
- <fo:block font-size="30.4pt">
1520
+ <fo:block font-size="{$font-size-factor * 30.4}pt">
1439
1521
 
1440
- <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'subpart']">
1441
- <fo:block> </fo:block>
1442
- <fo:block font-weight="{$weight-normal}"><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'subpart']"/></fo:block>
1522
+ <xsl:if test="normalize-space($title_subpart_fr) != ''">
1523
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1524
+ <fo:block font-weight="{$weight-normal}"><xsl:copy-of select="$title_subpart_fr"/></fo:block>
1443
1525
  </xsl:if>
1444
1526
 
1445
- <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'subpart']">
1446
- <fo:block> </fo:block>
1527
+ <xsl:if test="normalize-space($title_subpart_en) != ''">
1528
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1447
1529
  <fo:block font-weight="{$weight-bold}">
1448
- <xsl:variable name="title_en" select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'subpart']"/>
1449
- <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1450
- <xsl:choose>
1451
- <xsl:when test="contains($title_en, $mep_text)">
1452
- <xsl:value-of select="substring-before($title_en, $mep_text)"/>
1453
- <xsl:text> </xsl:text><fo:inline font-style="italic"><xsl:value-of select="$mep_text"/></fo:inline><xsl:text> </xsl:text>
1454
- <xsl:value-of select="substring-after($title_en, $mep_text)"/>
1455
- </xsl:when>
1456
- <xsl:otherwise>
1457
- <xsl:value-of select="$title_en"/>
1458
- </xsl:otherwise>
1459
- </xsl:choose>
1530
+ <xsl:copy-of select="$title_subpart_en"/>
1531
+
1460
1532
  </fo:block>
1461
1533
  </xsl:if>
1462
1534
  </fo:block>
@@ -1619,6 +1691,24 @@
1619
1691
  </xsl:template>
1620
1692
  <!-- End Cover Pages -->
1621
1693
 
1694
+
1695
+ <xsl:template match="bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'en']/text()" priority="3">
1696
+ <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1697
+ <xsl:choose>
1698
+ <xsl:when test="contains(., $mep_text)">
1699
+ <xsl:value-of select="substring-before(., $mep_text)"/>
1700
+ <xsl:text> </xsl:text><fo:inline font-style="italic"><xsl:value-of select="$mep_text"/></fo:inline><xsl:text> </xsl:text>
1701
+ <xsl:value-of select="substring-after(., $mep_text)"/>
1702
+ </xsl:when>
1703
+ <xsl:otherwise>
1704
+ <xsl:value-of select="."/>
1705
+ </xsl:otherwise>
1706
+ </xsl:choose>
1707
+ </xsl:template>
1708
+
1709
+
1710
+
1711
+
1622
1712
  <xsl:template name="insertSeparatorPage">
1623
1713
  <!-- 3 Pages with BIPM Metro logo -->
1624
1714
  <fo:page-sequence master-reference="document" force-page-count="no-force">
@@ -1759,11 +1849,12 @@
1759
1849
  <xsl:if test="@level &gt;= 3">
1760
1850
  <fo:inline padding-right="2mm"><xsl:value-of select="@section"/></fo:inline>
1761
1851
  </xsl:if>
1762
- <xsl:variable name="sectionTitle">
1852
+ <!-- <xsl:variable name="sectionTitle">
1763
1853
  <xsl:apply-templates select="title"/>
1764
- </xsl:variable>
1854
+ </xsl:variable> -->
1765
1855
  <fo:inline>
1766
- <xsl:value-of select="$sectionTitle"/>
1856
+ <!-- <xsl:value-of select="$sectionTitle"/> -->
1857
+ <xsl:apply-templates select="title"/>
1767
1858
  </fo:inline>
1768
1859
  <!-- <xsl:text> </xsl:text> -->
1769
1860
  <!-- keep-together.within-line="always" -->
@@ -1841,6 +1932,7 @@
1841
1932
  <xsl:variable name="type">
1842
1933
  <xsl:choose>
1843
1934
  <xsl:when test="@type = 'index'">index</xsl:when>
1935
+ <xsl:when test="local-name() = 'indexsect'">index</xsl:when>
1844
1936
  <xsl:otherwise><xsl:value-of select="local-name()"/></xsl:otherwise>
1845
1937
  </xsl:choose>
1846
1938
  </xsl:variable>
@@ -1859,6 +1951,12 @@
1859
1951
  </xsl:if>
1860
1952
  </xsl:template>
1861
1953
 
1954
+ <xsl:template match="*[local-name() = 'strong']" mode="contents_item" priority="2">
1955
+ <!-- <xsl:copy> -->
1956
+ <xsl:apply-templates mode="contents_item"/>
1957
+ <!-- </xsl:copy> -->
1958
+ </xsl:template>
1959
+
1862
1960
  <!-- ============================= -->
1863
1961
  <!-- ============================= -->
1864
1962
 
@@ -2968,6 +3066,18 @@
2968
3066
  </fo:block>
2969
3067
  </xsl:template>
2970
3068
 
3069
+ <xsl:template match="bipm:preferred">
3070
+ <fo:block font-weight="bold" keep-with-next="always" space-before="8pt" margin-bottom="6pt">
3071
+ <xsl:if test="ancestor::bipm:term/bipm:name">
3072
+ <fo:inline>
3073
+ <xsl:attribute name="padding-right">2mm</xsl:attribute>
3074
+ <xsl:apply-templates select="ancestor::bipm:term/bipm:name" mode="presentation"/>
3075
+ </fo:inline>
3076
+ </xsl:if>
3077
+ <xsl:apply-templates/>
3078
+ </fo:block>
3079
+ </xsl:template>
3080
+
2971
3081
  <xsl:template match="bipm:bibitem">
2972
3082
  <fo:block id="{@id}" margin-bottom="12pt" start-indent="25mm" text-indent="-25mm" line-height="115%">
2973
3083
  <xsl:if test=".//bipm:fn">
@@ -3211,6 +3321,51 @@
3211
3321
  </mathml:mstyle>
3212
3322
  </xsl:template>
3213
3323
 
3324
+ <!-- Decrease space between ()
3325
+ from:
3326
+ <mfenced open="(" close=")">
3327
+ <mrow>
3328
+ <mtext>Cu</mtext>
3329
+ </mrow>
3330
+ </mfenced>
3331
+ to:
3332
+ <mrow>
3333
+ <mtext>(Cu)</mtext>
3334
+ </mrow> -->
3335
+ <xsl:template match="mathml:mfenced[count(*) = 1 and *[count(*) = 1] and */*[count(*) = 0]] | mathml:mfenced[count(*) = 1 and *[count(*) = 1] and */*[count(*) = 1] and */*/*[count(*) = 0]]" mode="mathml" priority="2">
3336
+ <xsl:apply-templates mode="mathml"/>
3337
+ </xsl:template>
3338
+
3339
+ <xsl:template match="mathml:mfenced[count(*) = 1]/*[count(*) = 1]/*[count(*) = 0] | mathml:mfenced[count(*) = 1]/*[count(*) = 1]/*[count(*) = 1]/*[count(*) = 0]" mode="mathml" priority="2"> <!-- [not(following-sibling::*) and not(preceding-sibling::*)] -->
3340
+ <xsl:copy>
3341
+ <xsl:apply-templates select="@*" mode="mathml"/>
3342
+ <xsl:value-of select="ancestor::mathml:mfenced[1]/@open"/>
3343
+ <xsl:value-of select="."/>
3344
+ <xsl:value-of select="ancestor::mathml:mfenced[1]/@close"/>
3345
+ </xsl:copy>
3346
+ </xsl:template>
3347
+
3348
+ <!-- Decrease height of / and | -->
3349
+ <xsl:template match="mathml:mo[normalize-space(text()) = '/' or normalize-space(text()) = '|']" mode="mathml">
3350
+ <xsl:copy>
3351
+ <xsl:apply-templates select="@*" mode="mathml"/>
3352
+ <xsl:if test="not(@stretchy) and not(preceding-sibling::*[1][local-name() = 'mfrac'] and following-sibling::*[1][local-name() = 'mfrac'])">
3353
+ <xsl:attribute name="stretchy">false</xsl:attribute>
3354
+ </xsl:if>
3355
+ <xsl:apply-templates mode="mathml"/>
3356
+ </xsl:copy>
3357
+ </xsl:template>
3358
+
3359
+ <xsl:template match="mathml:mi[string-length(normalize-space()) &gt; 1]" mode="mathml" priority="2">
3360
+ <xsl:if test="preceding-sibling::* and preceding-sibling::*[1][not(local-name() = 'mfenced' or local-name() = 'mo')]">
3361
+ <mathml:mspace width="0.3em"/>
3362
+ </xsl:if>
3363
+ <xsl:copy-of select="."/>
3364
+ <xsl:if test="following-sibling::* and following-sibling::*[1][not(local-name() = 'mfenced' or local-name() = 'mo')]">
3365
+ <mathml:mspace width="0.3em"/>
3366
+ </xsl:if>
3367
+ </xsl:template>
3368
+
3214
3369
  <xsl:template name="insertHeaderFooter">
3215
3370
  <xsl:param name="header-title"/>
3216
3371
  <fo:static-content flow-name="header-odd">
@@ -3337,7 +3492,12 @@
3337
3492
  <xsl:value-of select="concat($day, ' ', $monthStr, ' ', $year)"/>
3338
3493
  </xsl:when>
3339
3494
  <xsl:otherwise>
3340
- <xsl:value-of select="concat($monthStr, ' ', $day, ', ', $year)"/>
3495
+ <!-- <xsl:value-of select="concat($monthStr, ' ', $day, ', ', $year)"/> -->
3496
+ <xsl:value-of select="$monthStr"/>
3497
+ <xsl:text> </xsl:text>
3498
+ <xsl:value-of select="$day"/>
3499
+ <xsl:if test="$day != '' and $year != ''"><xsl:text>, </xsl:text></xsl:if>
3500
+ <xsl:value-of select="$year"/>
3341
3501
  </xsl:otherwise>
3342
3502
  </xsl:choose>
3343
3503
 
@@ -3382,127 +3542,10 @@
3382
3542
  <!-- Index processing -->
3383
3543
  <!-- =================== -->
3384
3544
 
3385
- <xsl:template match="@*|node()" mode="index_add_id">
3386
- <xsl:copy>
3387
- <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
3388
- </xsl:copy>
3389
- </xsl:template>
3390
-
3391
- <xsl:template match="bipm:xref" mode="index_add_id">
3392
- <xsl:variable name="id">
3393
- <xsl:call-template name="generateIndexXrefId"/>
3394
- </xsl:variable>
3395
- <xsl:copy> <!-- add id to xref -->
3396
- <xsl:apply-templates select="@*" mode="index_add_id"/>
3397
- <xsl:attribute name="id">
3398
- <xsl:value-of select="$id"/>
3399
- </xsl:attribute>
3400
- <xsl:apply-templates mode="index_add_id"/>
3401
- </xsl:copy>
3402
- <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
3403
- <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
3404
- <xsl:if test="@to">
3405
- <xsl:value-of select="$dash"/>
3406
- <xsl:copy>
3407
- <xsl:copy-of select="@*"/>
3408
- <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
3409
- <xsl:attribute name="id">
3410
- <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
3411
- </xsl:attribute>
3412
- <xsl:apply-templates mode="index_add_id"/>
3413
- </xsl:copy>
3414
- </xsl:if>
3415
- </xsl:template>
3416
-
3417
- <xsl:template match="@*|node()" mode="index_update">
3418
- <xsl:copy>
3419
- <xsl:apply-templates select="@*|node()" mode="index_update"/>
3420
- </xsl:copy>
3421
- </xsl:template>
3422
-
3423
- <xsl:template match="bipm:clause[@type = 'index']//bipm:li" mode="index_update">
3424
- <xsl:copy>
3425
- <xsl:apply-templates select="@*" mode="index_update"/>
3426
- <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
3427
- </xsl:copy>
3428
- </xsl:template>
3429
-
3430
- <xsl:template match="bipm:clause[@type = 'index']//bipm:li/node()" mode="process_li_element" priority="2">
3431
- <xsl:param name="element"/>
3432
- <xsl:param name="remove" select="'false'"/>
3433
- <!-- <node></node> -->
3434
- <xsl:choose>
3435
- <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
3436
- <!-- skip text (i.e. remove it) and process next element -->
3437
- <!-- [removed_<xsl:value-of select="."/>] -->
3438
- <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
3439
- </xsl:when>
3440
- <xsl:when test="self::text()">
3441
- <xsl:value-of select="."/>
3442
- <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
3443
- </xsl:when>
3444
- <xsl:when test="self::* and local-name(.) = 'xref'">
3445
- <xsl:variable name="id" select="@id"/>
3446
- <xsl:variable name="page" select="$index//item[@id = $id]"/>
3447
- <xsl:variable name="id_next" select="following-sibling::bipm:xref[1]/@id"/>
3448
- <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
3449
-
3450
- <xsl:variable name="id_prev" select="preceding-sibling::bipm:xref[1]/@id"/>
3451
- <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
3452
-
3453
- <xsl:choose>
3454
- <!-- 2nd pass -->
3455
- <!-- if page is equal to page for next and page is not the end of range -->
3456
- <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
3457
- <!-- skip element (i.e. remove it) and remove next text ',' -->
3458
- <!-- [removed_xref] -->
3459
-
3460
- <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
3461
- <xsl:with-param name="remove">true</xsl:with-param>
3462
- </xsl:apply-templates>
3463
- </xsl:when>
3464
-
3465
- <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
3466
- <!-- remove xref -->
3467
- <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
3468
- <xsl:with-param name="remove">true</xsl:with-param>
3469
- </xsl:apply-templates>
3470
- </xsl:when>
3471
-
3472
- <xsl:otherwise>
3473
- <xsl:copy-of select="."/>
3474
- <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
3475
- </xsl:otherwise>
3476
- </xsl:choose>
3477
- </xsl:when>
3478
- <xsl:when test="self::* and local-name(.) = 'ul'">
3479
- <!-- ul -->
3480
- <xsl:apply-templates select="." mode="index_update"/>
3481
- </xsl:when>
3482
- <xsl:otherwise>
3483
- <xsl:copy-of select="."/>
3484
- <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
3485
- </xsl:otherwise>
3486
- </xsl:choose>
3487
- </xsl:template>
3488
-
3489
-
3490
- <xsl:template name="generateIndexXrefId">
3491
- <xsl:variable name="level" select="count(ancestor::bipm:ul)"/>
3492
- <!-- <xsl:variable name="parent_ul_id" select="generate-id(ancestor::bipm:ul[1])"/>
3493
- <xsl:variable name="item_number" select="count(ancestor::bipm:li[ancestor::bipm:ul[generate-id() = $parent_ul_id]])"/> -->
3494
- <xsl:variable name="docid">
3495
- <xsl:call-template name="getDocumentId"/>
3496
- </xsl:variable>
3497
- <xsl:variable name="item_number">
3498
- <xsl:number count="bipm:li[ancestor::bipm:clause[@type = 'index']]" level="any"/>
3499
- </xsl:variable>
3500
- <xsl:variable name="xref_number"><xsl:number count="bipm:xref"/></xsl:variable>
3501
- <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
3502
- </xsl:template>
3503
-
3504
- <xsl:template match="bipm:clause[@type = 'index']"/>
3505
- <xsl:template match="bipm:clause[@type = 'index']" mode="index">
3545
+ <!-- <xsl:template match="bipm:clause[@type = 'index']" /> -->
3546
+ <!-- <xsl:template match="bipm:clause[@type = 'index']" mode="index"> -->
3547
+ <xsl:template match="bipm:indexsect"/>
3548
+ <xsl:template match="bipm:indexsect" mode="index">
3506
3549
 
3507
3550
  <fo:page-sequence master-reference="index" force-page-count="no-force">
3508
3551
  <xsl:variable name="header-title">
@@ -3520,8 +3563,11 @@
3520
3563
  </xsl:call-template>
3521
3564
 
3522
3565
  <fo:flow flow-name="xsl-region-body">
3523
- <fo:block id="{@id}">
3524
- <xsl:apply-templates/>
3566
+ <fo:block id="{@id}" span="all">
3567
+ <xsl:apply-templates select="bipm:title"/>
3568
+ </fo:block>
3569
+ <fo:block>
3570
+ <xsl:apply-templates select="*[not(local-name() = 'title')]"/>
3525
3571
 
3526
3572
  <!-- TEST <xsl:variable name="alphabet" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
3527
3573
  <xsl:for-each select="(document('')//node())[position() &lt; 26]">
@@ -3544,42 +3590,25 @@
3544
3590
  </fo:page-sequence>
3545
3591
  </xsl:template>
3546
3592
 
3547
- <xsl:template match="bipm:clause[@type = 'index']/bipm:title" priority="4">
3548
- <fo:block font-size="16pt" font-weight="bold" margin-bottom="84pt" margin-left="-18mm" span="all">
3593
+ <!-- <xsl:template match="bipm:clause[@type = 'index']/bipm:title" priority="4"> -->
3594
+ <xsl:template match="bipm:indexsect/bipm:title" priority="4">
3595
+ <fo:block font-size="16pt" font-weight="bold" margin-bottom="84pt" margin-left="-18mm">
3549
3596
  <!-- Index -->
3550
3597
  <xsl:apply-templates/>
3551
3598
  </fo:block>
3552
3599
  </xsl:template>
3553
-
3554
- <xsl:template match="bipm:clause[@type = 'index']/bipm:clause" priority="4">
3555
- <xsl:apply-templates/>
3556
- <fo:block>
3557
- <xsl:if test="following-sibling::bipm:clause">
3558
- <fo:block> </fo:block>
3559
- </xsl:if>
3560
- </fo:block>
3561
- </xsl:template>
3562
-
3563
- <xsl:template match="bipm:clause[@type = 'index']/bipm:clause/bipm:title" priority="4">
3600
+
3601
+ <!-- <xsl:template match="bipm:clause[@type = 'index']/bipm:clause/bipm:title" priority="4"> -->
3602
+ <xsl:template match="bipm:indexsect/bipm:clause/bipm:title" priority="4">
3564
3603
  <!-- Letter A, B, C, ... -->
3565
3604
  <fo:block font-size="10pt" font-weight="bold" margin-bottom="3pt" keep-with-next="always">
3566
3605
  <xsl:apply-templates/>
3567
3606
  </fo:block>
3568
3607
  </xsl:template>
3569
3608
 
3570
- <xsl:template match="bipm:clause[@type = 'index']//bipm:ul" priority="4">
3571
- <xsl:apply-templates/>
3572
- </xsl:template>
3573
-
3574
- <xsl:template match="bipm:clause[@type = 'index']//bipm:li" priority="4">
3575
- <xsl:variable name="level" select="count(ancestor::bipm:ul)"/>
3576
- <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
3577
- <xsl:apply-templates/>
3578
- </fo:block>
3579
- </xsl:template>
3580
-
3581
- <xsl:template match="bipm:bookmark">
3582
- <fo:inline id="{@id}"/>
3609
+
3610
+ <xsl:template match="*[local-name() = 'stem']/text()">
3611
+ <xsl:value-of select="normalize-space()"/>
3583
3612
  </xsl:template>
3584
3613
 
3585
3614
  <!-- =================== -->
@@ -4243,6 +4272,7 @@
4243
4272
 
4244
4273
 
4245
4274
 
4275
+
4246
4276
  </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
4247
4277
 
4248
4278
 
@@ -4350,6 +4380,7 @@
4350
4380
 
4351
4381
 
4352
4382
 
4383
+
4353
4384
  </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
4354
4385
 
4355
4386
 
@@ -4476,209 +4507,242 @@
4476
4507
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
4477
4508
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
4478
4509
  <xsl:call-template name="add-zero-spaces-java"/>
4479
- </xsl:template><xsl:template match="*[local-name()='table']">
4510
+ </xsl:template><xsl:template match="*[local-name()='table']" name="table">
4480
4511
 
4481
- <xsl:variable name="simple-table">
4482
- <xsl:call-template name="getSimpleTable"/>
4483
- </xsl:variable>
4512
+ <xsl:variable name="table">
4484
4513
 
4485
-
4486
-
4487
-
4488
-
4489
- <!-- <xsl:if test="$namespace = 'bipm'">
4490
- <fo:block>&#xA0;</fo:block>
4491
- </xsl:if> -->
4492
-
4493
- <!-- $namespace = 'iso' or -->
4494
-
4495
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4496
-
4497
-
4498
-
4499
- <xsl:call-template name="fn_name_display"/>
4514
+ <xsl:variable name="simple-table">
4515
+ <xsl:call-template name="getSimpleTable"/>
4516
+ </xsl:variable>
4500
4517
 
4501
4518
 
4502
-
4503
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
4504
-
4505
- <!-- <xsl:variable name="cols-count">
4506
- <xsl:choose>
4507
- <xsl:when test="*[local-name()='thead']">
4508
- <xsl:call-template name="calculate-columns-numbers">
4509
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
4510
- </xsl:call-template>
4511
- </xsl:when>
4512
- <xsl:otherwise>
4513
- <xsl:call-template name="calculate-columns-numbers">
4514
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
4515
- </xsl:call-template>
4516
- </xsl:otherwise>
4517
- </xsl:choose>
4518
- </xsl:variable> -->
4519
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
4520
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
4521
-
4522
-
4523
-
4524
- <xsl:variable name="colwidths">
4525
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
4526
- <xsl:call-template name="calculate-column-widths">
4527
- <xsl:with-param name="cols-count" select="$cols-count"/>
4528
- <xsl:with-param name="table" select="$simple-table"/>
4529
- </xsl:call-template>
4530
- </xsl:if>
4531
- </xsl:variable>
4532
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
4533
-
4534
- <!-- <xsl:variable name="colwidths2">
4535
- <xsl:call-template name="calculate-column-widths">
4536
- <xsl:with-param name="cols-count" select="$cols-count"/>
4537
- </xsl:call-template>
4538
- </xsl:variable> -->
4539
-
4540
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
4541
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
4542
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
4543
-
4544
- <xsl:variable name="margin-left">
4545
- <xsl:choose>
4546
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
4547
- <xsl:otherwise>0</xsl:otherwise>
4548
- </xsl:choose>
4549
- </xsl:variable>
4550
-
4551
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
4552
4519
 
4553
4520
 
4554
-
4555
-
4556
-
4557
4521
 
4522
+ <!-- <xsl:if test="$namespace = 'bipm'">
4523
+ <fo:block>&#xA0;</fo:block>
4524
+ </xsl:if> -->
4558
4525
 
4559
-
4526
+ <!-- $namespace = 'iso' or -->
4527
+
4528
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4560
4529
 
4530
+
4561
4531
 
4532
+ <xsl:call-template name="fn_name_display"/>
4562
4533
 
4534
+
4563
4535
 
4536
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
4564
4537
 
4565
- <xsl:attribute name="space-after">12pt</xsl:attribute>
4566
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
4567
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
4568
- <xsl:if test="not(ancestor::*[local-name()='note_side'])">
4569
- <xsl:attribute name="font-size">10pt</xsl:attribute>
4570
- </xsl:if>
4571
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
4572
- <xsl:if test="@parent-type = 'quote'">
4573
- <xsl:attribute name="font-family">Arial</xsl:attribute>
4574
- <xsl:attribute name="font-size">9pt</xsl:attribute>
4538
+ <!-- <xsl:variable name="cols-count">
4539
+ <xsl:choose>
4540
+ <xsl:when test="*[local-name()='thead']">
4541
+ <xsl:call-template name="calculate-columns-numbers">
4542
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
4543
+ </xsl:call-template>
4544
+ </xsl:when>
4545
+ <xsl:otherwise>
4546
+ <xsl:call-template name="calculate-columns-numbers">
4547
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
4548
+ </xsl:call-template>
4549
+ </xsl:otherwise>
4550
+ </xsl:choose>
4551
+ </xsl:variable> -->
4552
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
4553
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
4554
+
4555
+
4556
+
4557
+ <xsl:variable name="colwidths">
4558
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
4559
+ <xsl:call-template name="calculate-column-widths">
4560
+ <xsl:with-param name="cols-count" select="$cols-count"/>
4561
+ <xsl:with-param name="table" select="$simple-table"/>
4562
+ </xsl:call-template>
4575
4563
  </xsl:if>
4564
+ </xsl:variable>
4565
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
4576
4566
 
4567
+ <!-- <xsl:variable name="colwidths2">
4568
+ <xsl:call-template name="calculate-column-widths">
4569
+ <xsl:with-param name="cols-count" select="$cols-count"/>
4570
+ </xsl:call-template>
4571
+ </xsl:variable> -->
4577
4572
 
4573
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
4574
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
4575
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
4578
4576
 
4579
- <xsl:variable name="table_attributes">
4580
- <attribute name="table-layout">fixed</attribute>
4581
- <attribute name="width">100%</attribute>
4582
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
4583
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
4577
+ <xsl:variable name="margin-left">
4578
+ <xsl:choose>
4579
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
4580
+ <xsl:otherwise>0</xsl:otherwise>
4581
+ </xsl:choose>
4582
+ </xsl:variable>
4583
+
4584
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
4584
4585
 
4585
4586
 
4587
+
4588
+
4589
+
4586
4590
 
4587
4591
 
4588
-
4589
-
4590
-
4592
+
4591
4593
 
4592
-
4593
-
4594
- <xsl:if test="not(ancestor::*[local-name()='preface']) and not(ancestor::*[local-name()='note_side']) and not(ancestor::*[local-name() = 'annex'] and .//*[local-name() = 'xref'][@pagenumber])">
4595
- <attribute name="border-top">0.5pt solid black</attribute>
4596
- <attribute name="border-bottom">0.5pt solid black</attribute>
4597
- </xsl:if>
4598
- <attribute name="margin-left">0mm</attribute>
4599
- <attribute name="margin-right">0mm</attribute>
4600
4594
 
4601
- </xsl:variable>
4602
-
4603
-
4604
- <fo:table id="{@id}" table-omit-footer-at-break="true">
4605
4595
 
4606
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
4607
- <xsl:attribute name="{@name}">
4608
- <xsl:value-of select="."/>
4609
- </xsl:attribute>
4610
- </xsl:for-each>
4611
4596
 
4612
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
4613
- <xsl:if test="$isNoteOrFnExist = 'true'">
4614
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
4615
- </xsl:if>
4616
4597
 
4617
- <xsl:choose>
4618
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
4619
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
4620
- <fo:table-column column-width="{@width}"/>
4621
- </xsl:for-each>
4622
- </xsl:when>
4623
- <xsl:otherwise>
4624
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
4625
- <xsl:choose>
4626
- <xsl:when test=". = 1 or . = 0">
4627
- <fo:table-column column-width="proportional-column-width(2)"/>
4628
- </xsl:when>
4629
- <xsl:otherwise>
4630
- <fo:table-column column-width="proportional-column-width({.})"/>
4631
- </xsl:otherwise>
4632
- </xsl:choose>
4633
- </xsl:for-each>
4634
- </xsl:otherwise>
4635
- </xsl:choose>
4598
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
4599
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
4600
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
4601
+ <xsl:if test="not(ancestor::*[local-name()='note_side'])">
4602
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
4603
+ </xsl:if>
4604
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
4605
+ <xsl:if test="@parent-type = 'quote'">
4606
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
4607
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
4608
+ </xsl:if>
4636
4609
 
4637
- <xsl:choose>
4638
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
4639
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
4640
- </xsl:when>
4641
- <xsl:otherwise>
4642
- <xsl:apply-templates/>
4643
- </xsl:otherwise>
4644
- </xsl:choose>
4645
4610
 
4646
- </fo:table>
4647
-
4648
- <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
4649
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
4650
- <xsl:call-template name="insertTableFooterInSeparateTable">
4651
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
4652
- <xsl:with-param name="colwidths" select="$colwidths"/>
4653
- <xsl:with-param name="colgroup" select="$colgroup"/>
4654
- </xsl:call-template>
4655
- </xsl:for-each>
4656
-
4657
- <!-- insert footer as table -->
4658
- <!-- <fo:table>
4659
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
4660
- <xsl:attribute name="{@name}">
4661
- <xsl:value-of select="."/>
4662
- </xsl:attribute>
4663
- </xsl:for-each>
4611
+ <xsl:variable name="table_width">
4612
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
4613
+
4614
+
4615
+
4616
+ <xsl:choose>
4617
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
4618
+ <xsl:otherwise>100%</xsl:otherwise>
4619
+ </xsl:choose>
4620
+
4621
+ </xsl:variable>
4622
+
4623
+ <xsl:variable name="table_attributes">
4624
+ <attribute name="table-layout">fixed</attribute>
4625
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
4626
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
4627
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
4628
+
4629
+
4630
+
4631
+
4632
+
4633
+
4634
+
4635
+
4636
+
4637
+
4638
+ <xsl:if test="not(ancestor::*[local-name()='preface']) and not(ancestor::*[local-name()='note_side']) and not(ancestor::*[local-name() = 'annex'] and .//*[local-name() = 'xref'][@pagenumber])">
4639
+ <attribute name="border-top">0.5pt solid black</attribute>
4640
+ <attribute name="border-bottom">0.5pt solid black</attribute>
4641
+ </xsl:if>
4642
+ <attribute name="margin-left">0mm</attribute>
4643
+ <attribute name="margin-right">0mm</attribute>
4644
+
4645
+ </xsl:variable>
4646
+
4664
4647
 
4665
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
4648
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
4649
+
4650
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
4651
+ <xsl:attribute name="{@name}">
4652
+ <xsl:value-of select="."/>
4653
+ </xsl:attribute>
4654
+ </xsl:for-each>
4655
+
4656
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
4657
+ <xsl:if test="$isNoteOrFnExist = 'true'">
4658
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
4659
+ </xsl:if>
4660
+
4661
+ <xsl:choose>
4662
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
4663
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
4664
+ <fo:table-column column-width="{@width}"/>
4665
+ </xsl:for-each>
4666
+ </xsl:when>
4667
+ <xsl:otherwise>
4668
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
4669
+ <xsl:choose>
4670
+ <xsl:when test=". = 1 or . = 0">
4671
+ <fo:table-column column-width="proportional-column-width(2)"/>
4672
+ </xsl:when>
4673
+ <xsl:otherwise>
4674
+ <fo:table-column column-width="proportional-column-width({.})"/>
4675
+ </xsl:otherwise>
4676
+ </xsl:choose>
4677
+ </xsl:for-each>
4678
+ </xsl:otherwise>
4679
+ </xsl:choose>
4680
+
4666
4681
  <xsl:choose>
4667
- <xsl:when test=". = 1 or . = 0">
4668
- <fo:table-column column-width="proportional-column-width(2)"/>
4682
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
4683
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
4669
4684
  </xsl:when>
4670
4685
  <xsl:otherwise>
4671
- <fo:table-column column-width="proportional-column-width({.})"/>
4686
+ <xsl:apply-templates/>
4672
4687
  </xsl:otherwise>
4673
4688
  </xsl:choose>
4689
+
4690
+ </fo:table>
4691
+
4692
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
4693
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
4694
+ <xsl:call-template name="insertTableFooterInSeparateTable">
4695
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
4696
+ <xsl:with-param name="colwidths" select="$colwidths"/>
4697
+ <xsl:with-param name="colgroup" select="$colgroup"/>
4698
+ </xsl:call-template>
4674
4699
  </xsl:for-each>
4675
- </fo:table>-->
4676
-
4677
-
4678
-
4679
-
4680
-
4681
- </fo:block-container>
4700
+
4701
+ <!-- insert footer as table -->
4702
+ <!-- <fo:table>
4703
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
4704
+ <xsl:attribute name="{@name}">
4705
+ <xsl:value-of select="."/>
4706
+ </xsl:attribute>
4707
+ </xsl:for-each>
4708
+
4709
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
4710
+ <xsl:choose>
4711
+ <xsl:when test=". = 1 or . = 0">
4712
+ <fo:table-column column-width="proportional-column-width(2)"/>
4713
+ </xsl:when>
4714
+ <xsl:otherwise>
4715
+ <fo:table-column column-width="proportional-column-width({.})"/>
4716
+ </xsl:otherwise>
4717
+ </xsl:choose>
4718
+ </xsl:for-each>
4719
+ </fo:table>-->
4720
+
4721
+
4722
+
4723
+
4724
+
4725
+ </fo:block-container>
4726
+ </xsl:variable>
4727
+
4728
+
4729
+
4730
+ <xsl:choose>
4731
+ <xsl:when test="@width">
4732
+
4733
+ <!-- centered table when table name is centered (see table-name-style) -->
4734
+
4735
+
4736
+
4737
+ <xsl:copy-of select="$table"/>
4738
+
4739
+
4740
+ </xsl:when>
4741
+ <xsl:otherwise>
4742
+ <xsl:copy-of select="$table"/>
4743
+ </xsl:otherwise>
4744
+ </xsl:choose>
4745
+
4682
4746
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
4683
4747
  <xsl:if test="normalize-space() != ''">
4684
4748
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -4810,7 +4874,15 @@
4810
4874
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
4811
4875
  <xsl:value-of select="@target"/>
4812
4876
  </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
4813
- <xsl:variable name="math_text" select="normalize-space(.)"/>
4877
+ <xsl:variable name="mathml">
4878
+ <xsl:for-each select="*">
4879
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
4880
+ <xsl:copy-of select="."/>
4881
+ </xsl:if>
4882
+ </xsl:for-each>
4883
+ </xsl:variable>
4884
+
4885
+ <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
4814
4886
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
4815
4887
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
4816
4888
  <xsl:param name="cols-count"/>
@@ -5111,7 +5183,7 @@
5111
5183
 
5112
5184
  <xsl:attribute name="font-weight">normal</xsl:attribute>
5113
5185
  <xsl:attribute name="border">solid black 0pt</xsl:attribute>
5114
- <xsl:attribute name="border-top">solid black 0.5pt</xsl:attribute>
5186
+ <!-- <xsl:attribute name="border-top">solid black 0.5pt</xsl:attribute> -->
5115
5187
  <xsl:attribute name="border-bottom">solid black 0.5pt</xsl:attribute>
5116
5188
  <xsl:attribute name="height">8mm</xsl:attribute>
5117
5189
  <xsl:attribute name="padding-top">2mm</xsl:attribute>
@@ -5579,7 +5651,7 @@
5579
5651
  <xsl:with-param name="table" select="$html-table"/>
5580
5652
  </xsl:call-template>
5581
5653
  </xsl:variable>
5582
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
5654
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
5583
5655
  <xsl:variable name="maxlength_dt">
5584
5656
  <xsl:call-template name="getMaxLength_dt"/>
5585
5657
  </xsl:variable>
@@ -5608,13 +5680,22 @@
5608
5680
  </xsl:when>
5609
5681
  <xsl:otherwise>
5610
5682
  <xsl:choose>
5683
+ <!-- to set width check most wide chars like `W` -->
5611
5684
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
5612
- <fo:table-column column-width="5%"/>
5613
- <fo:table-column column-width="95%"/>
5685
+ <fo:table-column column-width="7%"/>
5686
+ <fo:table-column column-width="93%"/>
5614
5687
  </xsl:when>
5615
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
5616
- <fo:table-column column-width="10%"/>
5617
- <fo:table-column column-width="90%"/>
5688
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
5689
+ <fo:table-column column-width="15%"/>
5690
+ <fo:table-column column-width="85%"/>
5691
+ </xsl:when>
5692
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
5693
+ <fo:table-column column-width="20%"/>
5694
+ <fo:table-column column-width="80%"/>
5695
+ </xsl:when>
5696
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
5697
+ <fo:table-column column-width="25%"/>
5698
+ <fo:table-column column-width="75%"/>
5618
5699
  </xsl:when>
5619
5700
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
5620
5701
  <fo:table-column column-width="60%"/>
@@ -5813,6 +5894,7 @@
5813
5894
 
5814
5895
 
5815
5896
 
5897
+
5816
5898
 
5817
5899
  </xsl:variable>
5818
5900
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -5826,10 +5908,18 @@
5826
5908
  </xsl:if>
5827
5909
  <xsl:apply-templates/>
5828
5910
  </fo:inline>
5911
+ </xsl:template><xsl:template match="*[local-name()='underline']">
5912
+ <fo:inline text-decoration="underline">
5913
+ <xsl:apply-templates/>
5914
+ </fo:inline>
5829
5915
  </xsl:template><xsl:template match="*[local-name()='del']">
5830
5916
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
5831
5917
  <xsl:apply-templates/>
5832
5918
  </fo:inline>
5919
+ </xsl:template><xsl:template match="*[local-name()='hi']">
5920
+ <fo:inline background-color="yellow">
5921
+ <xsl:apply-templates/>
5922
+ </fo:inline>
5833
5923
  </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
5834
5924
  <xsl:variable name="text" select="normalize-space(.)"/>
5835
5925
  <fo:inline font-size="75%">
@@ -5919,6 +6009,10 @@
5919
6009
  <xsl:param name="text" select="."/>
5920
6010
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
5921
6011
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
6012
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
6013
+ <xsl:param name="text" select="."/>
6014
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
6015
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
5922
6016
  </xsl:template><xsl:template name="add-zero-spaces">
5923
6017
  <xsl:param name="text" select="."/>
5924
6018
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -6170,6 +6264,14 @@
6170
6264
  <xsl:apply-templates select="." mode="mathml"/>
6171
6265
  </xsl:variable>
6172
6266
  <fo:instream-foreign-object fox:alt-text="Math">
6267
+
6268
+ <xsl:if test="ancestor::*[local-name() = 'formula']">
6269
+ <xsl:attribute name="width">95%</xsl:attribute>
6270
+ <xsl:attribute name="content-height">100%</xsl:attribute>
6271
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
6272
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
6273
+ </xsl:if>
6274
+
6173
6275
  <!-- <xsl:copy-of select="."/> -->
6174
6276
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
6175
6277
  </fo:instream-foreign-object>
@@ -6183,7 +6285,12 @@
6183
6285
  <!-- replace start and end spaces to non-break space -->
6184
6286
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
6185
6287
  </xsl:copy>
6186
- </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
6288
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
6289
+ <xsl:copy>
6290
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
6291
+ </xsl:copy>
6292
+ <mathml:mspace width="0.5ex"/>
6293
+ </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">
6187
6294
  <xsl:variable name="target">
6188
6295
  <xsl:choose>
6189
6296
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -6204,7 +6311,10 @@
6204
6311
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
6205
6312
  <xsl:choose>
6206
6313
  <xsl:when test="normalize-space(.) = ''">
6207
- <xsl:value-of select="$target"/>
6314
+ <!-- <xsl:value-of select="$target"/> -->
6315
+ <xsl:call-template name="add-zero-spaces-link-java">
6316
+ <xsl:with-param name="text" select="$target"/>
6317
+ </xsl:call-template>
6208
6318
  </xsl:when>
6209
6319
  <xsl:otherwise>
6210
6320
  <xsl:apply-templates/>
@@ -6214,8 +6324,6 @@
6214
6324
  </xsl:otherwise>
6215
6325
  </xsl:choose>
6216
6326
  </fo:inline>
6217
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
6218
- <fo:inline id="{@id}"/>
6219
6327
  </xsl:template><xsl:template match="*[local-name()='appendix']">
6220
6328
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
6221
6329
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
@@ -6417,7 +6525,7 @@
6417
6525
  </xsl:if> -->
6418
6526
  </fo:inline>
6419
6527
  </xsl:if>
6420
- </xsl:template><xsl:template match="*[local-name() = 'figure']">
6528
+ </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
6421
6529
  <fo:block-container id="{@id}">
6422
6530
 
6423
6531
  <xsl:if test="*[local-name() = 'name']">
@@ -6437,6 +6545,7 @@
6437
6545
  <fo:block id="{@id}">
6438
6546
  <xsl:apply-templates/>
6439
6547
  </fo:block>
6548
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
6440
6549
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
6441
6550
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
6442
6551
  <xsl:apply-templates/>
@@ -6642,6 +6751,12 @@
6642
6751
  <!-- <xsl:text> </xsl:text> -->
6643
6752
  </xsl:template><xsl:template name="getSection">
6644
6753
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
6754
+ <!--
6755
+ <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
6756
+ <xsl:value-of select="."/>
6757
+ </xsl:for-each>
6758
+ -->
6759
+
6645
6760
  </xsl:template><xsl:template name="getName">
6646
6761
  <xsl:choose>
6647
6762
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -6694,6 +6809,12 @@
6694
6809
  <xsl:copy>
6695
6810
  <xsl:apply-templates mode="contents_item"/>
6696
6811
  </xsl:copy>
6812
+ </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
6813
+ <xsl:copy>
6814
+ <xsl:apply-templates mode="contents_item"/>
6815
+ </xsl:copy>
6816
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
6817
+ <xsl:copy-of select="."/>
6697
6818
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
6698
6819
  <xsl:text> </xsl:text>
6699
6820
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -6719,6 +6840,7 @@
6719
6840
 
6720
6841
 
6721
6842
 
6843
+
6722
6844
 
6723
6845
 
6724
6846
 
@@ -7021,10 +7143,11 @@
7021
7143
  </xsl:choose>
7022
7144
 
7023
7145
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
7024
-
7146
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
7025
7147
  <xsl:variable name="element">
7026
7148
  block
7027
7149
 
7150
+
7028
7151
  </xsl:variable>
7029
7152
  <xsl:choose>
7030
7153
  <xsl:when test="normalize-space($element) = 'block'">
@@ -7099,11 +7222,13 @@
7099
7222
  </xsl:if>
7100
7223
  </xsl:if>
7101
7224
 
7225
+
7102
7226
  <fo:block-container margin-left="0mm">
7103
7227
 
7104
7228
  <fo:block xsl:use-attribute-sets="quote-style">
7105
7229
  <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
7106
- <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
7230
+
7231
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
7107
7232
  </fo:block>
7108
7233
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
7109
7234
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -7126,32 +7251,50 @@
7126
7251
  <xsl:text>— </xsl:text>
7127
7252
  <xsl:apply-templates/>
7128
7253
  </xsl:template><xsl:template match="*[local-name() = 'eref']">
7129
- <fo:inline xsl:use-attribute-sets="eref-style">
7130
- <xsl:if test="@type = 'footnote'">
7131
-
7132
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7133
- <xsl:attribute name="font-size">80%</xsl:attribute>
7134
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
7135
- <xsl:attribute name="vertical-align">super</xsl:attribute>
7136
-
7137
-
7138
- </xsl:if>
7139
-
7140
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
7141
-
7142
- <xsl:if test="@type = 'inline'">
7143
-
7144
- <xsl:attribute name="color">blue</xsl:attribute>
7145
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
7146
-
7147
-
7148
-
7149
- </xsl:if>
7150
-
7151
-
7152
- <xsl:apply-templates/>
7153
- </fo:basic-link>
7154
- </fo:inline>
7254
+
7255
+ <xsl:variable name="bibitemid">
7256
+ <xsl:choose>
7257
+ <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
7258
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
7259
+ <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
7260
+ </xsl:choose>
7261
+ </xsl:variable>
7262
+
7263
+ <xsl:choose>
7264
+ <xsl:when test="normalize-space($bibitemid) != ''">
7265
+ <fo:inline xsl:use-attribute-sets="eref-style">
7266
+ <xsl:if test="@type = 'footnote'">
7267
+
7268
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7269
+ <xsl:attribute name="font-size">80%</xsl:attribute>
7270
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
7271
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
7272
+
7273
+
7274
+ </xsl:if>
7275
+
7276
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
7277
+ <xsl:if test="normalize-space(@citeas) = ''">
7278
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
7279
+ </xsl:if>
7280
+ <xsl:if test="@type = 'inline'">
7281
+
7282
+ <xsl:attribute name="color">blue</xsl:attribute>
7283
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
7284
+
7285
+
7286
+
7287
+ </xsl:if>
7288
+
7289
+ <xsl:apply-templates/>
7290
+ </fo:basic-link>
7291
+
7292
+ </fo:inline>
7293
+ </xsl:when>
7294
+ <xsl:otherwise>
7295
+ <fo:inline><xsl:apply-templates/></fo:inline>
7296
+ </xsl:otherwise>
7297
+ </xsl:choose>
7155
7298
  </xsl:template><xsl:template match="*[local-name() = 'tab']">
7156
7299
  <!-- zero-space char -->
7157
7300
  <xsl:variable name="depth">
@@ -7257,6 +7400,7 @@
7257
7400
 
7258
7401
 
7259
7402
 
7403
+
7260
7404
 
7261
7405
 
7262
7406
 
@@ -7268,7 +7412,7 @@
7268
7412
 
7269
7413
 
7270
7414
 
7271
- </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
7415
+ </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
7272
7416
  <fo:block break-after="page"/>
7273
7417
  <fo:block>
7274
7418
  <xsl:call-template name="setId"/>
@@ -7276,10 +7420,11 @@
7276
7420
  </fo:block>
7277
7421
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
7278
7422
  <fo:block>
7279
- <xsl:call-template name="setId"/>
7423
+ <xsl:call-template name="setId"/>
7280
7424
 
7281
7425
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
7282
7426
 
7427
+
7283
7428
  <xsl:apply-templates/>
7284
7429
  </fo:block>
7285
7430
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
@@ -7331,6 +7476,153 @@
7331
7476
  </fo:block>
7332
7477
  </xsl:otherwise>
7333
7478
  </xsl:choose>
7479
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
7480
+ <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
7481
+ <bookmark><xsl:value-of select="@id"/></bookmark>
7482
+ </xsl:for-each>
7483
+ </xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
7484
+ <xsl:copy>
7485
+ <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
7486
+ </xsl:copy>
7487
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
7488
+ <xsl:variable name="id">
7489
+ <xsl:call-template name="generateIndexXrefId"/>
7490
+ </xsl:variable>
7491
+ <xsl:copy> <!-- add id to xref -->
7492
+ <xsl:apply-templates select="@*" mode="index_add_id"/>
7493
+ <xsl:attribute name="id">
7494
+ <xsl:value-of select="$id"/>
7495
+ </xsl:attribute>
7496
+ <xsl:apply-templates mode="index_add_id"/>
7497
+ </xsl:copy>
7498
+ <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
7499
+ <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
7500
+ <xsl:if test="@to">
7501
+ <xsl:value-of select="$dash"/>
7502
+ <xsl:copy>
7503
+ <xsl:copy-of select="@*"/>
7504
+ <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
7505
+ <xsl:attribute name="id">
7506
+ <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
7507
+ </xsl:attribute>
7508
+ <xsl:apply-templates mode="index_add_id"/>
7509
+ </xsl:copy>
7510
+ </xsl:if>
7511
+ </xsl:template><xsl:template match="@*|node()" mode="index_update">
7512
+ <xsl:copy>
7513
+ <xsl:apply-templates select="@*|node()" mode="index_update"/>
7514
+ </xsl:copy>
7515
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
7516
+ <xsl:copy>
7517
+ <xsl:apply-templates select="@*" mode="index_update"/>
7518
+ <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
7519
+ </xsl:copy>
7520
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
7521
+ <xsl:param name="element"/>
7522
+ <xsl:param name="remove" select="'false'"/>
7523
+ <xsl:param name="target"/>
7524
+ <!-- <node></node> -->
7525
+ <xsl:choose>
7526
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
7527
+ <!-- skip text (i.e. remove it) and process next element -->
7528
+ <!-- [removed_<xsl:value-of select="."/>] -->
7529
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
7530
+ <xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
7531
+ </xsl:apply-templates>
7532
+ </xsl:when>
7533
+ <xsl:when test="self::text()">
7534
+ <xsl:value-of select="."/>
7535
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
7536
+ </xsl:when>
7537
+ <xsl:when test="self::* and local-name(.) = 'xref'">
7538
+ <xsl:variable name="id" select="@id"/>
7539
+ <xsl:variable name="page" select="$index//item[@id = $id]"/>
7540
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
7541
+ <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
7542
+
7543
+ <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
7544
+ <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
7545
+
7546
+ <xsl:choose>
7547
+ <!-- 2nd pass -->
7548
+ <!-- if page is equal to page for next and page is not the end of range -->
7549
+ <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
7550
+ <!-- skip element (i.e. remove it) and remove next text ',' -->
7551
+ <!-- [removed_xref] -->
7552
+
7553
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
7554
+ <xsl:with-param name="remove">true</xsl:with-param>
7555
+ <xsl:with-param name="target">
7556
+ <xsl:choose>
7557
+ <xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
7558
+ <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
7559
+ </xsl:choose>
7560
+ </xsl:with-param>
7561
+ </xsl:apply-templates>
7562
+ </xsl:when>
7563
+
7564
+ <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
7565
+ <!-- remove xref -->
7566
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
7567
+ <xsl:with-param name="remove">true</xsl:with-param>
7568
+ </xsl:apply-templates>
7569
+ </xsl:when>
7570
+
7571
+ <xsl:otherwise>
7572
+ <xsl:apply-templates select="." mode="xref_copy">
7573
+ <xsl:with-param name="target" select="$target"/>
7574
+ </xsl:apply-templates>
7575
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
7576
+ </xsl:otherwise>
7577
+ </xsl:choose>
7578
+ </xsl:when>
7579
+ <xsl:when test="self::* and local-name(.) = 'ul'">
7580
+ <!-- ul -->
7581
+ <xsl:apply-templates select="." mode="index_update"/>
7582
+ </xsl:when>
7583
+ <xsl:otherwise>
7584
+ <xsl:apply-templates select="." mode="xref_copy">
7585
+ <xsl:with-param name="target" select="$target"/>
7586
+ </xsl:apply-templates>
7587
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
7588
+ </xsl:otherwise>
7589
+ </xsl:choose>
7590
+ </xsl:template><xsl:template match="@*|node()" mode="xref_copy">
7591
+ <xsl:param name="target"/>
7592
+ <xsl:copy>
7593
+ <xsl:apply-templates select="@*" mode="xref_copy"/>
7594
+ <xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
7595
+ <xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
7596
+ </xsl:if>
7597
+ <xsl:apply-templates select="node()" mode="xref_copy"/>
7598
+ </xsl:copy>
7599
+ </xsl:template><xsl:template name="generateIndexXrefId">
7600
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
7601
+
7602
+ <xsl:variable name="docid">
7603
+ <xsl:call-template name="getDocumentId"/>
7604
+ </xsl:variable>
7605
+ <xsl:variable name="item_number">
7606
+ <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
7607
+ </xsl:variable>
7608
+ <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
7609
+ <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
7610
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
7611
+ <xsl:apply-templates/>
7612
+ <fo:block>
7613
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
7614
+ <fo:block> </fo:block>
7615
+ </xsl:if>
7616
+ </fo:block>
7617
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
7618
+ <xsl:apply-templates/>
7619
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
7620
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
7621
+ <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
7622
+ <xsl:apply-templates/>
7623
+ </fo:block>
7624
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']">
7625
+ <fo:inline id="{@id}"/>
7334
7626
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
7335
7627
  <!-- <row>
7336
7628
  <date>05-07-2013</date>
@@ -7454,6 +7746,8 @@
7454
7746
  <xsl:value-of select="translate(.,'. ','')"/>
7455
7747
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
7456
7748
  <xsl:value-of select="substring(.,1,1)"/>
7749
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
7750
+ <fo:inline><xsl:apply-templates/></fo:inline>
7457
7751
  </xsl:template><xsl:template name="convertDate">
7458
7752
  <xsl:param name="date"/>
7459
7753
  <xsl:param name="format" select="'short'"/>
@@ -7478,6 +7772,57 @@
7478
7772
  </xsl:variable>
7479
7773
  <xsl:variable name="result">
7480
7774
  <xsl:choose>
7775
+ <xsl:when test="$format = 'ddMMyyyy'">
7776
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
7777
+ <xsl:text> </xsl:text>
7778
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
7779
+ </xsl:when>
7780
+ <xsl:when test="$format = 'ddMM'">
7781
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
7782
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
7783
+ </xsl:when>
7784
+ <xsl:when test="$format = 'short' or $day = ''">
7785
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
7786
+ </xsl:when>
7787
+ <xsl:otherwise>
7788
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
7789
+ </xsl:otherwise>
7790
+ </xsl:choose>
7791
+ </xsl:variable>
7792
+ <xsl:value-of select="$result"/>
7793
+ </xsl:template><xsl:template name="convertDateLocalized">
7794
+ <xsl:param name="date"/>
7795
+ <xsl:param name="format" select="'short'"/>
7796
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
7797
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
7798
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
7799
+ <xsl:variable name="monthStr">
7800
+ <xsl:choose>
7801
+ <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>
7802
+ <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>
7803
+ <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>
7804
+ <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>
7805
+ <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>
7806
+ <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>
7807
+ <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>
7808
+ <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>
7809
+ <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>
7810
+ <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>
7811
+ <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>
7812
+ <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>
7813
+ </xsl:choose>
7814
+ </xsl:variable>
7815
+ <xsl:variable name="result">
7816
+ <xsl:choose>
7817
+ <xsl:when test="$format = 'ddMMyyyy'">
7818
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
7819
+ <xsl:text> </xsl:text>
7820
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
7821
+ </xsl:when>
7822
+ <xsl:when test="$format = 'ddMM'">
7823
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
7824
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
7825
+ </xsl:when>
7481
7826
  <xsl:when test="$format = 'short' or $day = ''">
7482
7827
  <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
7483
7828
  </xsl:when>
@@ -7493,7 +7838,7 @@
7493
7838
  <xsl:param name="charDelim" select="', '"/>
7494
7839
  <xsl:choose>
7495
7840
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
7496
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
7841
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
7497
7842
  <xsl:sort data-type="text" order="ascending"/>
7498
7843
  <xsl:call-template name="insertKeyword">
7499
7844
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -7502,7 +7847,7 @@
7502
7847
  </xsl:for-each>
7503
7848
  </xsl:when>
7504
7849
  <xsl:otherwise>
7505
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
7850
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
7506
7851
  <xsl:call-template name="insertKeyword">
7507
7852
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
7508
7853
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -7519,65 +7864,71 @@
7519
7864
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
7520
7865
  </xsl:choose>
7521
7866
  </xsl:template><xsl:template name="addPDFUAmeta">
7522
- <fo:declarations>
7523
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
7524
- <pdf:dictionary type="normal" key="ViewerPreferences">
7525
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
7526
- </pdf:dictionary>
7527
- </pdf:catalog>
7528
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
7529
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
7530
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
7531
- <!-- Dublin Core properties go here -->
7532
- <dc:title>
7533
- <xsl:variable name="title">
7867
+ <xsl:variable name="lang">
7868
+ <xsl:call-template name="getLang"/>
7869
+ </xsl:variable>
7870
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
7871
+ <pdf:dictionary type="normal" key="ViewerPreferences">
7872
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
7873
+ </pdf:dictionary>
7874
+ </pdf:catalog>
7875
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
7876
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
7877
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
7878
+ <!-- Dublin Core properties go here -->
7879
+ <dc:title>
7880
+ <xsl:variable name="title">
7881
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
7882
+
7534
7883
 
7884
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
7535
7885
 
7536
- <xsl:value-of select="//*[local-name() = 'bibdata'][@type='standard']/*[local-name() = 'title'][@language = 'en' and @type = 'main']"/>
7537
7886
 
7538
7887
 
7539
7888
 
7540
7889
 
7541
- </xsl:variable>
7542
- <xsl:choose>
7543
- <xsl:when test="normalize-space($title) != ''">
7544
- <xsl:value-of select="$title"/>
7545
- </xsl:when>
7546
- <xsl:otherwise>
7547
- <xsl:text> </xsl:text>
7548
- </xsl:otherwise>
7549
- </xsl:choose>
7550
- </dc:title>
7551
- <dc:creator>
7890
+ </xsl:for-each>
7891
+ </xsl:variable>
7892
+ <xsl:choose>
7893
+ <xsl:when test="normalize-space($title) != ''">
7894
+ <xsl:value-of select="$title"/>
7895
+ </xsl:when>
7896
+ <xsl:otherwise>
7897
+ <xsl:text> </xsl:text>
7898
+ </xsl:otherwise>
7899
+ </xsl:choose>
7900
+ </dc:title>
7901
+ <dc:creator>
7902
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
7552
7903
 
7904
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
7905
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
7906
+ <xsl:if test="position() != last()">; </xsl:if>
7907
+ </xsl:for-each>
7553
7908
 
7554
- <xsl:value-of select="//*[local-name() = 'bibdata'][@type='standard']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'organization']/*[local-name() = 'name']"/>
7555
7909
 
7556
7910
 
7557
- </dc:creator>
7558
- <dc:description>
7559
- <xsl:variable name="abstract">
7560
-
7561
-
7562
-
7563
-
7564
-
7565
- <xsl:copy-of select="//*[local-name() = 'bibdata'][@type='standard']/*[local-name() = 'abstract']//text()"/>
7566
-
7567
- </xsl:variable>
7568
- <xsl:value-of select="normalize-space($abstract)"/>
7569
- </dc:description>
7570
- <pdf:Keywords>
7571
- <xsl:call-template name="insertKeywords"/>
7572
- </pdf:Keywords>
7573
- </rdf:Description>
7574
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
7575
- <!-- XMP properties go here -->
7576
- <xmp:CreatorTool/>
7577
- </rdf:Description>
7578
- </rdf:RDF>
7579
- </x:xmpmeta>
7580
- </fo:declarations>
7911
+ </xsl:for-each>
7912
+ </dc:creator>
7913
+ <dc:description>
7914
+ <xsl:variable name="abstract">
7915
+
7916
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
7917
+
7918
+
7919
+ </xsl:variable>
7920
+ <xsl:value-of select="normalize-space($abstract)"/>
7921
+ </dc:description>
7922
+ <pdf:Keywords>
7923
+ <xsl:call-template name="insertKeywords"/>
7924
+ </pdf:Keywords>
7925
+ </rdf:Description>
7926
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
7927
+ <!-- XMP properties go here -->
7928
+ <xmp:CreatorTool/>
7929
+ </rdf:Description>
7930
+ </rdf:RDF>
7931
+ </x:xmpmeta>
7581
7932
  </xsl:template><xsl:template name="getId">
7582
7933
  <xsl:choose>
7583
7934
  <xsl:when test="../@id">
@@ -7674,6 +8025,7 @@
7674
8025
 
7675
8026
  <xsl:value-of select="document('')//*/namespace::bipm"/>
7676
8027
 
8028
+
7677
8029
  </xsl:variable>
7678
8030
  <xsl:if test="$documentNS != $XSLNS">
7679
8031
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -7733,6 +8085,11 @@
7733
8085
  <xsl:call-template name="getLang"/>
7734
8086
  </xsl:variable>
7735
8087
 
7736
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
8088
+ <xsl:choose>
8089
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
8090
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
8091
+ </xsl:when>
8092
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
8093
+ </xsl:choose>
7737
8094
 
7738
8095
  </xsl:template></xsl:stylesheet>