metanorma-csa 1.6.7 → 1.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +7 -5
- data/lib/asciidoctor/csa/basicdoc.rng +52 -3
- data/lib/asciidoctor/csa/converter.rb +21 -41
- data/lib/asciidoctor/csa/isodoc.rng +51 -3
- data/lib/isodoc/csa/base_convert.rb +2 -12
- data/lib/isodoc/csa/csa.standard.xsl +259 -51
- data/lib/isodoc/csa/html/csa.css +19 -20
- data/lib/isodoc/csa/html/csa.scss +19 -20
- data/lib/isodoc/csa/html/htmlstyle.css +7 -7
- data/lib/isodoc/csa/html/htmlstyle.scss +6 -6
- data/lib/isodoc/csa/html/wordstyle.css +19 -19
- data/lib/isodoc/csa/html/wordstyle.scss +19 -19
- data/lib/isodoc/csa/html_convert.rb +2 -43
- data/lib/isodoc/csa/i18n.rb +3 -4
- data/lib/isodoc/csa/metadata.rb +3 -18
- data/lib/isodoc/csa/presentation_xml_convert.rb +2 -1
- data/lib/isodoc/csa/word_convert.rb +1 -25
- data/lib/isodoc/csa/xref.rb +1 -1
- data/lib/metanorma/csa.rb +26 -1
- data/lib/metanorma/csa/processor.rb +10 -10
- data/lib/metanorma/csa/version.rb +1 -1
- data/metanorma-csa.gemspec +1 -10
- data/metanorma.yml +61 -0
- metadata +6 -104
- data/lib/asciidoctor/csa/validate.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3ce871483aba209182d7c60ee564f676a812ce48ea7b9016a331efc4ebdaac9
|
4
|
+
data.tar.gz: 8b73c397a28b544ab66f5414010d66c8b44a358dd9ff3eb9acc191b550ce2ab9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f291b4a3ff5bdd2d00b9b79cc6525e02896c0a3bb79f9e14af6b80cfe052779a3732bfe925212b6b0b49ffd43b5189b9d97e68f46c09f0df77721d4bcf8d16ea
|
7
|
+
data.tar.gz: 167eb0d69a196e816b1bcc6bbfcf9638113404aa26b3de40ae23c8fa7054c980221b3e44be61a5ba3e4909a72adbf4cb5b331215a78f725f766de82f6405ef34
|
data/.github/workflows/rake.yml
CHANGED
@@ -36,7 +36,10 @@ jobs:
|
|
36
36
|
with:
|
37
37
|
ruby-version: ${{ matrix.ruby }}
|
38
38
|
|
39
|
-
-
|
39
|
+
- if: matrix.os == 'macos-latest'
|
40
|
+
run: brew install autoconf automake libtool
|
41
|
+
|
42
|
+
- uses: actions/cache@v2
|
40
43
|
with:
|
41
44
|
path: vendor/bundle
|
42
45
|
key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
|
@@ -48,15 +51,14 @@ jobs:
|
|
48
51
|
|
49
52
|
- run: bundle exec rake
|
50
53
|
|
51
|
-
|
52
|
-
name: Trigger notify workflow
|
54
|
+
tests-passed:
|
53
55
|
needs: rake
|
54
56
|
runs-on: ubuntu-latest
|
55
57
|
steps:
|
56
|
-
- name: Trigger
|
58
|
+
- name: Trigger tests passed event
|
57
59
|
uses: Sibz/github-status-action@v1
|
58
60
|
with:
|
59
|
-
authToken: ${{ secrets.GITHUB_TOKEN }}
|
61
|
+
authToken: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
|
60
62
|
context: 'tests-passed-successfully'
|
61
63
|
description: 'Tests passed successfully'
|
62
64
|
state: 'success'
|
@@ -596,6 +596,7 @@
|
|
596
596
|
<ref name="bookmark"/>
|
597
597
|
<ref name="image"/>
|
598
598
|
<ref name="index"/>
|
599
|
+
<ref name="index-xref"/>
|
599
600
|
</choice>
|
600
601
|
</define>
|
601
602
|
<define name="PureTextElement">
|
@@ -728,13 +729,61 @@
|
|
728
729
|
</define>
|
729
730
|
<define name="index">
|
730
731
|
<element name="index">
|
731
|
-
<attribute name="primary"/>
|
732
732
|
<optional>
|
733
|
-
<attribute name="
|
733
|
+
<attribute name="to">
|
734
|
+
<data type="IDREF"/>
|
735
|
+
</attribute>
|
736
|
+
</optional>
|
737
|
+
<element name="primary">
|
738
|
+
<oneOrMore>
|
739
|
+
<ref name="PureTextElement"/>
|
740
|
+
</oneOrMore>
|
741
|
+
</element>
|
742
|
+
<optional>
|
743
|
+
<element name="secondary">
|
744
|
+
<oneOrMore>
|
745
|
+
<ref name="PureTextElement"/>
|
746
|
+
</oneOrMore>
|
747
|
+
</element>
|
748
|
+
</optional>
|
749
|
+
<optional>
|
750
|
+
<element name="tertiary">
|
751
|
+
<oneOrMore>
|
752
|
+
<ref name="PureTextElement"/>
|
753
|
+
</oneOrMore>
|
754
|
+
</element>
|
755
|
+
</optional>
|
756
|
+
</element>
|
757
|
+
</define>
|
758
|
+
<define name="index-xref">
|
759
|
+
<element name="index-xref">
|
760
|
+
<attribute name="also">
|
761
|
+
<data type="boolean"/>
|
762
|
+
</attribute>
|
763
|
+
<element name="primary">
|
764
|
+
<oneOrMore>
|
765
|
+
<ref name="PureTextElement"/>
|
766
|
+
</oneOrMore>
|
767
|
+
</element>
|
768
|
+
<optional>
|
769
|
+
<element name="secondary">
|
770
|
+
<oneOrMore>
|
771
|
+
<ref name="PureTextElement"/>
|
772
|
+
</oneOrMore>
|
773
|
+
</element>
|
734
774
|
</optional>
|
735
775
|
<optional>
|
736
|
-
<
|
776
|
+
<element name="tertiary">
|
777
|
+
<oneOrMore>
|
778
|
+
<ref name="PureTextElement"/>
|
779
|
+
</oneOrMore>
|
780
|
+
</element>
|
737
781
|
</optional>
|
782
|
+
<element name="target">
|
783
|
+
<oneOrMore>
|
784
|
+
<ref name="PureTextElement"/>
|
785
|
+
</oneOrMore>
|
786
|
+
</element>
|
738
787
|
</element>
|
739
788
|
</define>
|
740
789
|
<!-- bare ID element, used for referencing arbitrary spans of text -->
|
@@ -1,29 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'asciidoctor'
|
4
|
-
require 'metanorma
|
4
|
+
require 'metanorma-generic'
|
5
5
|
require 'isodoc/csa/html_convert'
|
6
6
|
require 'isodoc/csa/pdf_convert'
|
7
7
|
require 'isodoc/csa/word_convert'
|
8
8
|
require 'isodoc/csa/presentation_xml_convert'
|
9
|
-
require '
|
9
|
+
require 'metanorma/csa'
|
10
10
|
require 'fileutils'
|
11
|
-
require_relative 'validate'
|
12
11
|
|
13
12
|
module Asciidoctor
|
14
13
|
module Csa
|
15
|
-
|
16
|
-
|
17
|
-
# A {Converter} implementation that generates CSD output, and a document
|
18
|
-
# schema encapsulation of the document for validation
|
19
|
-
class Converter < Standoc::Converter
|
14
|
+
class Converter < ::Asciidoctor::Generic::Converter
|
20
15
|
XML_ROOT_TAG = "csa-standard".freeze
|
21
16
|
XML_NAMESPACE = "https://www.metanorma.org/ns/csa".freeze
|
22
17
|
|
23
|
-
register_for
|
18
|
+
register_for "csa"
|
24
19
|
|
25
|
-
def
|
26
|
-
|
20
|
+
def configuration
|
21
|
+
Metanorma::Csa.configuration
|
27
22
|
end
|
28
23
|
|
29
24
|
def personal_role(node, c, suffix)
|
@@ -47,34 +42,10 @@ module Asciidoctor
|
|
47
42
|
end
|
48
43
|
end
|
49
44
|
|
50
|
-
def metadata_id(node, xml)
|
51
|
-
dn = node.attr('docnumber') or return
|
52
|
-
docstatus = node.attr('status')
|
53
|
-
if docstatus
|
54
|
-
abbr = IsoDoc::Csa::Metadata.new('en', 'Latn', @i18n)
|
55
|
-
.stage_abbr(docstatus)
|
56
|
-
dn = "#{dn}(#{abbr})" unless abbr.empty?
|
57
|
-
end
|
58
|
-
node.attr('copyright-year') && dn += ":#{node.attr('copyright-year')}"
|
59
|
-
xml.docidentifier dn, **{ type: CSA_TYPE }
|
60
|
-
xml.docnumber { |i| i << node.attr('docnumber') }
|
61
|
-
end
|
62
|
-
|
63
45
|
def title_validate(root)
|
64
46
|
nil
|
65
47
|
end
|
66
48
|
|
67
|
-
def doctype(node)
|
68
|
-
d = super
|
69
|
-
unless %w{guidance proposal standard report whitepaper charter policy
|
70
|
-
glossary case-study}.include? d
|
71
|
-
@log.add("Document Attributes", nil,
|
72
|
-
"#{d} is not a legal document type: reverting to 'standard'")
|
73
|
-
d = 'standard'
|
74
|
-
end
|
75
|
-
d
|
76
|
-
end
|
77
|
-
|
78
49
|
def outputs(node, ret)
|
79
50
|
File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
|
80
51
|
presentation_xml_converter(node).convert(@filename + ".xml")
|
@@ -86,12 +57,6 @@ module Asciidoctor
|
|
86
57
|
nil, false, "#{@filename}.pdf")
|
87
58
|
end
|
88
59
|
|
89
|
-
def validate(doc)
|
90
|
-
content_validate(doc)
|
91
|
-
schema_validate(formattedstr_strip(doc.dup),
|
92
|
-
File.join(File.dirname(__FILE__), 'csa.rng'))
|
93
|
-
end
|
94
|
-
|
95
60
|
def sections_cleanup(x)
|
96
61
|
super
|
97
62
|
x.xpath("//*[@inline-header]").each do |h|
|
@@ -99,6 +64,21 @@ module Asciidoctor
|
|
99
64
|
end
|
100
65
|
end
|
101
66
|
|
67
|
+
def bibdata_validate(doc)
|
68
|
+
super
|
69
|
+
role_validate(doc)
|
70
|
+
end
|
71
|
+
|
72
|
+
def role_validate(doc)
|
73
|
+
doc&.xpath("//bibdata/contributor/role[description]")&.each do |r|
|
74
|
+
r["type"] == "author" or next
|
75
|
+
role = r.at("./description").text
|
76
|
+
%w{full-author contributor staff reviewer}.include?(role) or
|
77
|
+
@log.add("Document Attributes", nil,
|
78
|
+
"#{role} is not a recognised role")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
102
82
|
def style(n, t)
|
103
83
|
return
|
104
84
|
end
|
@@ -55,6 +55,13 @@
|
|
55
55
|
<param name="pattern">\i\c*|\c+#\c+</param>
|
56
56
|
</data>
|
57
57
|
</attribute>
|
58
|
+
<optional>
|
59
|
+
<attribute name="to">
|
60
|
+
<data type="string">
|
61
|
+
<param name="pattern">\i\c*|\c+#\c+</param>
|
62
|
+
</data>
|
63
|
+
</attribute>
|
64
|
+
</optional>
|
58
65
|
<optional>
|
59
66
|
<attribute name="type">
|
60
67
|
<ref name="ReferenceFormat"/>
|
@@ -246,6 +253,12 @@
|
|
246
253
|
<data type="boolean"/>
|
247
254
|
</attribute>
|
248
255
|
</optional>
|
256
|
+
<optional>
|
257
|
+
<attribute name="width"/>
|
258
|
+
</optional>
|
259
|
+
<optional>
|
260
|
+
<ref name="colgroup"/>
|
261
|
+
</optional>
|
249
262
|
<optional>
|
250
263
|
<ref name="tname"/>
|
251
264
|
</optional>
|
@@ -764,6 +777,21 @@
|
|
764
777
|
</define>
|
765
778
|
</include>
|
766
779
|
<!-- end overrides -->
|
780
|
+
<define name="colgroup">
|
781
|
+
<element name="colgroup">
|
782
|
+
<oneOrMore>
|
783
|
+
<ref name="col"/>
|
784
|
+
</oneOrMore>
|
785
|
+
</element>
|
786
|
+
</define>
|
787
|
+
<define name="col">
|
788
|
+
<element name="col">
|
789
|
+
<attribute name="width"/>
|
790
|
+
</element>
|
791
|
+
</define>
|
792
|
+
<define name="BibItemType" combine="choice">
|
793
|
+
<value>internal</value>
|
794
|
+
</define>
|
767
795
|
<define name="TextElement" combine="choice">
|
768
796
|
<ref name="concept"/>
|
769
797
|
</define>
|
@@ -814,6 +842,9 @@
|
|
814
842
|
<data type="boolean"/>
|
815
843
|
</attribute>
|
816
844
|
</optional>
|
845
|
+
<optional>
|
846
|
+
<attribute name="number"/>
|
847
|
+
</optional>
|
817
848
|
<optional>
|
818
849
|
<attribute name="obligation">
|
819
850
|
<choice>
|
@@ -869,9 +900,11 @@
|
|
869
900
|
<element name="code">
|
870
901
|
<text/>
|
871
902
|
</element>
|
872
|
-
<
|
873
|
-
<text
|
874
|
-
|
903
|
+
<optional>
|
904
|
+
<element name="text">
|
905
|
+
<text/>
|
906
|
+
</element>
|
907
|
+
</optional>
|
875
908
|
</element>
|
876
909
|
</define>
|
877
910
|
<define name="standard-document">
|
@@ -1041,6 +1074,9 @@
|
|
1041
1074
|
</choice>
|
1042
1075
|
</attribute>
|
1043
1076
|
</optional>
|
1077
|
+
<optional>
|
1078
|
+
<attribute name="number"/>
|
1079
|
+
</optional>
|
1044
1080
|
<optional>
|
1045
1081
|
<attribute name="type"/>
|
1046
1082
|
</optional>
|
@@ -1094,6 +1130,9 @@
|
|
1094
1130
|
<optional>
|
1095
1131
|
<attribute name="type"/>
|
1096
1132
|
</optional>
|
1133
|
+
<optional>
|
1134
|
+
<attribute name="number"/>
|
1135
|
+
</optional>
|
1097
1136
|
<optional>
|
1098
1137
|
<ref name="section-title"/>
|
1099
1138
|
</optional>
|
@@ -1196,6 +1235,9 @@
|
|
1196
1235
|
<optional>
|
1197
1236
|
<attribute name="type"/>
|
1198
1237
|
</optional>
|
1238
|
+
<optional>
|
1239
|
+
<attribute name="number"/>
|
1240
|
+
</optional>
|
1199
1241
|
<optional>
|
1200
1242
|
<attribute name="obligation">
|
1201
1243
|
<choice>
|
@@ -1524,6 +1566,7 @@
|
|
1524
1566
|
<value>add</value>
|
1525
1567
|
<value>modify</value>
|
1526
1568
|
<value>delete</value>
|
1569
|
+
<value>replace</value>
|
1527
1570
|
</choice>
|
1528
1571
|
</attribute>
|
1529
1572
|
<optional>
|
@@ -1554,6 +1597,11 @@
|
|
1554
1597
|
</optional>
|
1555
1598
|
<optional>
|
1556
1599
|
<element name="newcontent">
|
1600
|
+
<optional>
|
1601
|
+
<attribute name="id">
|
1602
|
+
<data type="ID"/>
|
1603
|
+
</attribute>
|
1604
|
+
</optional>
|
1557
1605
|
<zeroOrMore>
|
1558
1606
|
<ref name="BasicBlock"/>
|
1559
1607
|
</zeroOrMore>
|
@@ -5,18 +5,8 @@ require 'isodoc'
|
|
5
5
|
module IsoDoc
|
6
6
|
module Csa
|
7
7
|
module BaseConvert
|
8
|
-
def
|
9
|
-
|
10
|
-
term_cleanup(docxml)
|
11
|
-
end
|
12
|
-
|
13
|
-
def term_cleanup(docxml)
|
14
|
-
docxml.xpath("//p[@class = 'Terms']").each do |d|
|
15
|
-
h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
|
16
|
-
h2.add_child(" ")
|
17
|
-
h2.add_child(d.remove)
|
18
|
-
end
|
19
|
-
docxml
|
8
|
+
def configuration
|
9
|
+
Metanorma::Csa.configuration
|
20
10
|
end
|
21
11
|
end
|
22
12
|
end
|
@@ -33,7 +33,7 @@
|
|
33
33
|
|
34
34
|
<xsl:template match="/">
|
35
35
|
<xsl:call-template name="namespaceCheck"/>
|
36
|
-
<fo:root font-family="
|
36
|
+
<fo:root font-family="Azo Sans, STIX Two Math" font-size="10pt" xml:lang="{$lang}">
|
37
37
|
<fo:layout-master-set>
|
38
38
|
<!-- Cover page -->
|
39
39
|
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
@@ -519,7 +519,7 @@
|
|
519
519
|
</fo:basic-link>
|
520
520
|
</fo:inline>
|
521
521
|
<fo:footnote-body>
|
522
|
-
<fo:block font-family="
|
522
|
+
<fo:block font-family="Azo Sans Lt" font-size="10pt" margin-bottom="12pt" font-weight="normal" text-indent="0" start-indent="0" color="rgb(168, 170, 173)" text-align="left">
|
523
523
|
<fo:inline id="footnote_{@reference}" keep-with-next.within-line="always" font-size="60%" vertical-align="super">
|
524
524
|
<xsl:value-of select="$number "/><!-- + count(//csa:bibitem/csa:note) -->
|
525
525
|
</fo:inline>
|
@@ -601,7 +601,7 @@
|
|
601
601
|
</fo:basic-link>
|
602
602
|
</fo:inline>
|
603
603
|
<fo:footnote-body>
|
604
|
-
<fo:block font-family="
|
604
|
+
<fo:block font-family="Azo Sans Lt" font-size="10pt" margin-bottom="12pt" start-indent="0pt" color="rgb(168, 170, 173)">
|
605
605
|
<fo:inline id="{generate-id()}" keep-with-next.within-line="always" font-size="60%" vertical-align="super"><!-- baseline-shift="30%" padding-right="9mm" alignment-baseline="hanging" -->
|
606
606
|
<xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> -->
|
607
607
|
</fo:inline>
|
@@ -658,13 +658,13 @@
|
|
658
658
|
<xsl:otherwise> <!-- for ordered lists -->
|
659
659
|
<xsl:choose>
|
660
660
|
<xsl:when test="../@type = 'arabic'">
|
661
|
-
<xsl:number format="a)"/>
|
661
|
+
<xsl:number format="a)" lang="en"/>
|
662
662
|
</xsl:when>
|
663
663
|
<xsl:when test="../@type = 'alphabet'">
|
664
664
|
<xsl:number format="1)"/>
|
665
665
|
</xsl:when>
|
666
666
|
<xsl:when test="../@type = 'alphabet_upper'">
|
667
|
-
<xsl:number format="A)"/>
|
667
|
+
<xsl:number format="A)" lang="en"/>
|
668
668
|
</xsl:when>
|
669
669
|
|
670
670
|
<xsl:when test="../@type = 'roman'">
|
@@ -856,7 +856,7 @@
|
|
856
856
|
</fo:block-container>
|
857
857
|
</fo:static-content>
|
858
858
|
<fo:static-content flow-name="footer">
|
859
|
-
<fo:block-container font-family="
|
859
|
+
<fo:block-container font-family="Azo Sans Lt" font-size="10.1pt" height="100%" display-align="after"> <!-- 11.5pt -->
|
860
860
|
<fo:block padding-bottom="13mm" text-align="right" color="rgb(144, 144, 144)">
|
861
861
|
<fo:inline padding-right="7mm"><xsl:value-of select="$copyright"/></fo:inline>
|
862
862
|
<fo:page-number/>
|
@@ -1040,7 +1040,7 @@
|
|
1040
1040
|
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
1041
1041
|
|
1042
1042
|
|
1043
|
-
<xsl:attribute name="font-family">
|
1043
|
+
<xsl:attribute name="font-family">Source Code Pro</xsl:attribute>
|
1044
1044
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
1045
1045
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1046
1046
|
<xsl:attribute name="line-height">113%</xsl:attribute>
|
@@ -1252,6 +1252,7 @@
|
|
1252
1252
|
|
1253
1253
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
1254
1254
|
|
1255
|
+
|
1255
1256
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
1256
1257
|
|
1257
1258
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
@@ -1263,6 +1264,7 @@
|
|
1263
1264
|
|
1264
1265
|
|
1265
1266
|
|
1267
|
+
|
1266
1268
|
</xsl:attribute-set><xsl:attribute-set name="quote-source-style">
|
1267
1269
|
|
1268
1270
|
<xsl:attribute name="text-align">right</xsl:attribute>
|
@@ -1290,6 +1292,7 @@
|
|
1290
1292
|
|
1291
1293
|
</xsl:attribute-set><xsl:attribute-set name="figure-name-style">
|
1292
1294
|
|
1295
|
+
|
1293
1296
|
<xsl:attribute name="font-size">11pt</xsl:attribute>
|
1294
1297
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
1295
1298
|
<xsl:attribute name="text-align">center</xsl:attribute>
|
@@ -1336,7 +1339,7 @@
|
|
1336
1339
|
|
1337
1340
|
</xsl:attribute-set><xsl:attribute-set name="tt-style">
|
1338
1341
|
|
1339
|
-
<xsl:attribute name="font-family">
|
1342
|
+
<xsl:attribute name="font-family">Source Code Pro</xsl:attribute>
|
1340
1343
|
|
1341
1344
|
|
1342
1345
|
|
@@ -1402,7 +1405,7 @@
|
|
1402
1405
|
</xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
|
1403
1406
|
<!-- <xsl:call-template name="add-zero-spaces"/> -->
|
1404
1407
|
<xsl:call-template name="add-zero-spaces-java"/>
|
1405
|
-
</xsl:template><xsl:template match="*[local-name()='table']">
|
1408
|
+
</xsl:template><xsl:template match="*[local-name()='table']" name="table">
|
1406
1409
|
|
1407
1410
|
<xsl:variable name="simple-table">
|
1408
1411
|
<xsl:call-template name="getSimpleTable"/>
|
@@ -1446,10 +1449,12 @@
|
|
1446
1449
|
|
1447
1450
|
|
1448
1451
|
<xsl:variable name="colwidths">
|
1449
|
-
<xsl:
|
1450
|
-
<xsl:
|
1451
|
-
|
1452
|
-
|
1452
|
+
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
1453
|
+
<xsl:call-template name="calculate-column-widths">
|
1454
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1455
|
+
<xsl:with-param name="table" select="$simple-table"/>
|
1456
|
+
</xsl:call-template>
|
1457
|
+
</xsl:if>
|
1453
1458
|
</xsl:variable>
|
1454
1459
|
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
1455
1460
|
|
@@ -1488,7 +1493,12 @@
|
|
1488
1493
|
|
1489
1494
|
<xsl:variable name="table_attributes">
|
1490
1495
|
<attribute name="table-layout">fixed</attribute>
|
1491
|
-
<attribute name="width">
|
1496
|
+
<attribute name="width">
|
1497
|
+
<xsl:choose>
|
1498
|
+
<xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
|
1499
|
+
<xsl:otherwise>100%</xsl:otherwise>
|
1500
|
+
</xsl:choose>
|
1501
|
+
</attribute>
|
1492
1502
|
<attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1493
1503
|
<attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1494
1504
|
|
@@ -1517,16 +1527,25 @@
|
|
1517
1527
|
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1518
1528
|
</xsl:if>
|
1519
1529
|
|
1520
|
-
<xsl:
|
1521
|
-
<xsl:
|
1522
|
-
<xsl:
|
1523
|
-
<fo:table-column column-width="
|
1524
|
-
</xsl:
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
+
<xsl:choose>
|
1531
|
+
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
1532
|
+
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
1533
|
+
<fo:table-column column-width="{@width}"/>
|
1534
|
+
</xsl:for-each>
|
1535
|
+
</xsl:when>
|
1536
|
+
<xsl:otherwise>
|
1537
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1538
|
+
<xsl:choose>
|
1539
|
+
<xsl:when test=". = 1 or . = 0">
|
1540
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1541
|
+
</xsl:when>
|
1542
|
+
<xsl:otherwise>
|
1543
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1544
|
+
</xsl:otherwise>
|
1545
|
+
</xsl:choose>
|
1546
|
+
</xsl:for-each>
|
1547
|
+
</xsl:otherwise>
|
1548
|
+
</xsl:choose>
|
1530
1549
|
|
1531
1550
|
<xsl:choose>
|
1532
1551
|
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
|
@@ -1539,10 +1558,12 @@
|
|
1539
1558
|
|
1540
1559
|
</fo:table>
|
1541
1560
|
|
1561
|
+
<xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
|
1542
1562
|
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
1543
1563
|
<xsl:call-template name="insertTableFooterInSeparateTable">
|
1544
1564
|
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
1545
1565
|
<xsl:with-param name="colwidths" select="$colwidths"/>
|
1566
|
+
<xsl:with-param name="colgroup" select="$colgroup"/>
|
1546
1567
|
</xsl:call-template>
|
1547
1568
|
</xsl:for-each>
|
1548
1569
|
|
@@ -1796,12 +1817,22 @@
|
|
1796
1817
|
</xsl:template><xsl:template name="insertTableFooterInSeparateTable">
|
1797
1818
|
<xsl:param name="table_attributes"/>
|
1798
1819
|
<xsl:param name="colwidths"/>
|
1820
|
+
<xsl:param name="colgroup"/>
|
1799
1821
|
|
1800
1822
|
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1801
1823
|
|
1802
1824
|
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1803
1825
|
|
1804
|
-
<xsl:variable name="cols-count"
|
1826
|
+
<xsl:variable name="cols-count">
|
1827
|
+
<xsl:choose>
|
1828
|
+
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
1829
|
+
<xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
|
1830
|
+
</xsl:when>
|
1831
|
+
<xsl:otherwise>
|
1832
|
+
<xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
|
1833
|
+
</xsl:otherwise>
|
1834
|
+
</xsl:choose>
|
1835
|
+
</xsl:variable>
|
1805
1836
|
|
1806
1837
|
<fo:table keep-with-previous="always">
|
1807
1838
|
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
@@ -1819,16 +1850,25 @@
|
|
1819
1850
|
</xsl:choose>
|
1820
1851
|
</xsl:for-each>
|
1821
1852
|
|
1822
|
-
<xsl:
|
1823
|
-
<xsl:
|
1824
|
-
<xsl:
|
1825
|
-
<fo:table-column column-width="
|
1826
|
-
</xsl:
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1853
|
+
<xsl:choose>
|
1854
|
+
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
1855
|
+
<xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
|
1856
|
+
<fo:table-column column-width="{@width}"/>
|
1857
|
+
</xsl:for-each>
|
1858
|
+
</xsl:when>
|
1859
|
+
<xsl:otherwise>
|
1860
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1861
|
+
<xsl:choose>
|
1862
|
+
<xsl:when test=". = 1 or . = 0">
|
1863
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1864
|
+
</xsl:when>
|
1865
|
+
<xsl:otherwise>
|
1866
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1867
|
+
</xsl:otherwise>
|
1868
|
+
</xsl:choose>
|
1869
|
+
</xsl:for-each>
|
1870
|
+
</xsl:otherwise>
|
1871
|
+
</xsl:choose>
|
1832
1872
|
|
1833
1873
|
<fo:table-body>
|
1834
1874
|
<fo:table-row>
|
@@ -2228,7 +2268,9 @@
|
|
2228
2268
|
</xsl:template><xsl:template match="*[local-name()='dl']">
|
2229
2269
|
<fo:block-container>
|
2230
2270
|
|
2231
|
-
<xsl:
|
2271
|
+
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
2272
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2273
|
+
</xsl:if>
|
2232
2274
|
|
2233
2275
|
|
2234
2276
|
<xsl:if test="parent::*[local-name() = 'note']">
|
@@ -2243,6 +2285,7 @@
|
|
2243
2285
|
<fo:block-container>
|
2244
2286
|
|
2245
2287
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2288
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
2246
2289
|
|
2247
2290
|
|
2248
2291
|
<xsl:variable name="parent" select="local-name(..)"/>
|
@@ -2426,12 +2469,32 @@
|
|
2426
2469
|
</xsl:otherwise>
|
2427
2470
|
</xsl:choose>
|
2428
2471
|
</xsl:template><xsl:template name="getMaxLength_dt">
|
2429
|
-
<xsl:
|
2430
|
-
<xsl:
|
2431
|
-
|
2432
|
-
<xsl:
|
2433
|
-
|
2434
|
-
|
2472
|
+
<xsl:variable name="lengths">
|
2473
|
+
<xsl:for-each select="*[local-name()='dt']">
|
2474
|
+
<xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
|
2475
|
+
<xsl:variable name="attributes">
|
2476
|
+
<xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
|
2477
|
+
<xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
|
2478
|
+
</xsl:variable>
|
2479
|
+
<length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
|
2480
|
+
</xsl:for-each>
|
2481
|
+
</xsl:variable>
|
2482
|
+
<xsl:variable name="maxLength">
|
2483
|
+
<!-- <xsl:for-each select="*[local-name()='dt']">
|
2484
|
+
<xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
|
2485
|
+
<xsl:if test="position() = 1">
|
2486
|
+
<xsl:value-of select="string-length(normalize-space(.))"/>
|
2487
|
+
</xsl:if>
|
2488
|
+
</xsl:for-each> -->
|
2489
|
+
<xsl:for-each select="xalan:nodeset($lengths)/length">
|
2490
|
+
<xsl:sort select="." data-type="number" order="descending"/>
|
2491
|
+
<xsl:if test="position() = 1">
|
2492
|
+
<xsl:value-of select="."/>
|
2493
|
+
</xsl:if>
|
2494
|
+
</xsl:for-each>
|
2495
|
+
</xsl:variable>
|
2496
|
+
<!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
|
2497
|
+
<xsl:value-of select="$maxLength"/>
|
2435
2498
|
</xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
|
2436
2499
|
<xsl:param name="key_iso"/>
|
2437
2500
|
|
@@ -2543,6 +2606,7 @@
|
|
2543
2606
|
</fo:inline>
|
2544
2607
|
</xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
|
2545
2608
|
<fo:inline font-weight="bold">
|
2609
|
+
|
2546
2610
|
<xsl:apply-templates/>
|
2547
2611
|
</fo:inline>
|
2548
2612
|
</xsl:template><xsl:template match="*[local-name()='sup']">
|
@@ -2569,6 +2633,7 @@
|
|
2569
2633
|
|
2570
2634
|
|
2571
2635
|
|
2636
|
+
|
2572
2637
|
|
2573
2638
|
</xsl:variable>
|
2574
2639
|
<xsl:variable name="font-size" select="normalize-space($_font-size)"/>
|
@@ -2582,6 +2647,10 @@
|
|
2582
2647
|
</xsl:if>
|
2583
2648
|
<xsl:apply-templates/>
|
2584
2649
|
</fo:inline>
|
2650
|
+
</xsl:template><xsl:template match="*[local-name()='underline']">
|
2651
|
+
<fo:inline text-decoration="underline">
|
2652
|
+
<xsl:apply-templates/>
|
2653
|
+
</fo:inline>
|
2585
2654
|
</xsl:template><xsl:template match="*[local-name()='del']">
|
2586
2655
|
<fo:inline font-size="10pt" color="red" text-decoration="line-through">
|
2587
2656
|
<xsl:apply-templates/>
|
@@ -2947,6 +3016,7 @@
|
|
2947
3016
|
</xsl:choose>
|
2948
3017
|
</xsl:variable>
|
2949
3018
|
<fo:inline xsl:use-attribute-sets="link-style">
|
3019
|
+
|
2950
3020
|
<xsl:choose>
|
2951
3021
|
<xsl:when test="$target = ''">
|
2952
3022
|
<xsl:apply-templates/>
|
@@ -3161,8 +3231,9 @@
|
|
3161
3231
|
</xsl:if> -->
|
3162
3232
|
</fo:inline>
|
3163
3233
|
</xsl:if>
|
3164
|
-
</xsl:template><xsl:template match="*[local-name() = 'figure']">
|
3165
|
-
<fo:block-container id="{@id}">
|
3234
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
|
3235
|
+
<fo:block-container id="{@id}">
|
3236
|
+
|
3166
3237
|
<fo:block>
|
3167
3238
|
<xsl:apply-templates/>
|
3168
3239
|
</fo:block>
|
@@ -3213,7 +3284,7 @@
|
|
3213
3284
|
<xsl:apply-templates mode="bookmarks"/>
|
3214
3285
|
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
|
3215
3286
|
<xsl:apply-templates select="."/>
|
3216
|
-
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3287
|
+
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3217
3288
|
<xsl:apply-templates mode="bookmarks"/>
|
3218
3289
|
</xsl:template><xsl:template name="addBookmarks">
|
3219
3290
|
<xsl:param name="contents"/>
|
@@ -3229,6 +3300,8 @@
|
|
3229
3300
|
<xsl:variable name="bookmark-title_">
|
3230
3301
|
<xsl:call-template name="getLangVersion">
|
3231
3302
|
<xsl:with-param name="lang" select="@lang"/>
|
3303
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
3304
|
+
<xsl:with-param name="title" select="@title-part"/>
|
3232
3305
|
</xsl:call-template>
|
3233
3306
|
</xsl:variable>
|
3234
3307
|
<xsl:choose>
|
@@ -3246,13 +3319,34 @@
|
|
3246
3319
|
</xsl:choose>
|
3247
3320
|
</fo:bookmark-title>
|
3248
3321
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3322
|
+
|
3323
|
+
<xsl:call-template name="insertFigureBookmarks">
|
3324
|
+
<xsl:with-param name="contents" select="contents"/>
|
3325
|
+
</xsl:call-template>
|
3326
|
+
|
3327
|
+
<xsl:call-template name="insertTableBookmarks">
|
3328
|
+
<xsl:with-param name="contents" select="contents"/>
|
3329
|
+
<xsl:with-param name="lang" select="@lang"/>
|
3330
|
+
</xsl:call-template>
|
3331
|
+
|
3249
3332
|
</fo:bookmark>
|
3250
3333
|
|
3251
3334
|
</xsl:for-each>
|
3252
3335
|
</xsl:when>
|
3253
3336
|
<xsl:otherwise>
|
3254
3337
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3338
|
+
|
3255
3339
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3340
|
+
|
3341
|
+
<xsl:call-template name="insertFigureBookmarks">
|
3342
|
+
<xsl:with-param name="contents" select="contents"/>
|
3343
|
+
</xsl:call-template>
|
3344
|
+
|
3345
|
+
<xsl:call-template name="insertTableBookmarks">
|
3346
|
+
<xsl:with-param name="contents" select="contents"/>
|
3347
|
+
<xsl:with-param name="lang" select="@lang"/>
|
3348
|
+
</xsl:call-template>
|
3349
|
+
|
3256
3350
|
</xsl:for-each>
|
3257
3351
|
</xsl:otherwise>
|
3258
3352
|
</xsl:choose>
|
@@ -3271,8 +3365,44 @@
|
|
3271
3365
|
|
3272
3366
|
</fo:bookmark-tree>
|
3273
3367
|
</xsl:if>
|
3368
|
+
</xsl:template><xsl:template name="insertFigureBookmarks">
|
3369
|
+
<xsl:param name="contents"/>
|
3370
|
+
<xsl:if test="xalan:nodeset($contents)/figure">
|
3371
|
+
<fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
|
3372
|
+
<fo:bookmark-title>Figures</fo:bookmark-title>
|
3373
|
+
<xsl:for-each select="xalan:nodeset($contents)/figure">
|
3374
|
+
<fo:bookmark internal-destination="{@id}">
|
3375
|
+
<fo:bookmark-title>
|
3376
|
+
<xsl:value-of select="normalize-space(title)"/>
|
3377
|
+
</fo:bookmark-title>
|
3378
|
+
</fo:bookmark>
|
3379
|
+
</xsl:for-each>
|
3380
|
+
</fo:bookmark>
|
3381
|
+
</xsl:if>
|
3382
|
+
</xsl:template><xsl:template name="insertTableBookmarks">
|
3383
|
+
<xsl:param name="contents"/>
|
3384
|
+
<xsl:param name="lang"/>
|
3385
|
+
<xsl:if test="xalan:nodeset($contents)/table">
|
3386
|
+
<fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
|
3387
|
+
<fo:bookmark-title>
|
3388
|
+
<xsl:choose>
|
3389
|
+
<xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
|
3390
|
+
<xsl:otherwise>Tables</xsl:otherwise>
|
3391
|
+
</xsl:choose>
|
3392
|
+
</fo:bookmark-title>
|
3393
|
+
<xsl:for-each select="xalan:nodeset($contents)/table">
|
3394
|
+
<fo:bookmark internal-destination="{@id}">
|
3395
|
+
<fo:bookmark-title>
|
3396
|
+
<xsl:value-of select="normalize-space(title)"/>
|
3397
|
+
</fo:bookmark-title>
|
3398
|
+
</fo:bookmark>
|
3399
|
+
</xsl:for-each>
|
3400
|
+
</fo:bookmark>
|
3401
|
+
</xsl:if>
|
3274
3402
|
</xsl:template><xsl:template name="getLangVersion">
|
3275
3403
|
<xsl:param name="lang"/>
|
3404
|
+
<xsl:param name="doctype" select="''"/>
|
3405
|
+
<xsl:param name="title" select="''"/>
|
3276
3406
|
<xsl:choose>
|
3277
3407
|
<xsl:when test="$lang = 'en'">
|
3278
3408
|
|
@@ -3308,6 +3438,12 @@
|
|
3308
3438
|
<!-- <xsl:text> </xsl:text> -->
|
3309
3439
|
</xsl:template><xsl:template name="getSection">
|
3310
3440
|
<xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
3441
|
+
<!--
|
3442
|
+
<xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
|
3443
|
+
<xsl:value-of select="."/>
|
3444
|
+
</xsl:for-each>
|
3445
|
+
-->
|
3446
|
+
|
3311
3447
|
</xsl:template><xsl:template name="getName">
|
3312
3448
|
<xsl:choose>
|
3313
3449
|
<xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
|
@@ -3360,6 +3496,10 @@
|
|
3360
3496
|
<xsl:copy>
|
3361
3497
|
<xsl:apply-templates mode="contents_item"/>
|
3362
3498
|
</xsl:copy>
|
3499
|
+
</xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
|
3500
|
+
<xsl:copy>
|
3501
|
+
<xsl:apply-templates mode="contents_item"/>
|
3502
|
+
</xsl:copy>
|
3363
3503
|
</xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
|
3364
3504
|
<xsl:text> </xsl:text>
|
3365
3505
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
@@ -3385,6 +3525,7 @@
|
|
3385
3525
|
|
3386
3526
|
|
3387
3527
|
|
3528
|
+
|
3388
3529
|
|
3389
3530
|
|
3390
3531
|
|
@@ -3768,7 +3909,8 @@
|
|
3768
3909
|
<fo:block-container margin-left="0mm">
|
3769
3910
|
|
3770
3911
|
<fo:block xsl:use-attribute-sets="quote-style">
|
3771
|
-
<xsl:apply-templates select=".//*[local-name() = 'p']"/>
|
3912
|
+
<!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
|
3913
|
+
<xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
|
3772
3914
|
</fo:block>
|
3773
3915
|
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
|
3774
3916
|
<fo:block xsl:use-attribute-sets="quote-source-style">
|
@@ -3919,6 +4061,7 @@
|
|
3919
4061
|
|
3920
4062
|
|
3921
4063
|
|
4064
|
+
|
3922
4065
|
|
3923
4066
|
|
3924
4067
|
|
@@ -3930,7 +4073,7 @@
|
|
3930
4073
|
|
3931
4074
|
|
3932
4075
|
|
3933
|
-
</xsl:template><xsl:template match="
|
4076
|
+
</xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
|
3934
4077
|
<fo:block break-after="page"/>
|
3935
4078
|
<fo:block>
|
3936
4079
|
<xsl:call-template name="setId"/>
|
@@ -3938,7 +4081,8 @@
|
|
3938
4081
|
</fo:block>
|
3939
4082
|
</xsl:template><xsl:template match="*[local-name() = 'clause']">
|
3940
4083
|
<fo:block>
|
3941
|
-
<xsl:call-template name="setId"/>
|
4084
|
+
<xsl:call-template name="setId"/>
|
4085
|
+
|
3942
4086
|
|
3943
4087
|
<xsl:apply-templates/>
|
3944
4088
|
</fo:block>
|
@@ -3946,7 +4090,7 @@
|
|
3946
4090
|
<fo:block id="{@id}">
|
3947
4091
|
<xsl:apply-templates/>
|
3948
4092
|
</fo:block>
|
3949
|
-
</xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
|
4093
|
+
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
|
3950
4094
|
|
3951
4095
|
<fo:block id="{@id}">
|
3952
4096
|
<xsl:apply-templates/>
|
@@ -4003,7 +4147,8 @@
|
|
4003
4147
|
<fo:table-column column-width="107mm"/>
|
4004
4148
|
<fo:table-column column-width="15mm"/>
|
4005
4149
|
<fo:table-body>
|
4006
|
-
<fo:table-row
|
4150
|
+
<fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
|
4151
|
+
|
4007
4152
|
<fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
|
4008
4153
|
<fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
|
4009
4154
|
<fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
|
@@ -4021,6 +4166,10 @@
|
|
4021
4166
|
<fo:block><xsl:apply-templates/></fo:block>
|
4022
4167
|
</fo:table-cell>
|
4023
4168
|
</xsl:template><xsl:template name="processBibitem">
|
4169
|
+
|
4170
|
+
|
4171
|
+
<!-- end BIPM bibitem processing-->
|
4172
|
+
|
4024
4173
|
|
4025
4174
|
|
4026
4175
|
|
@@ -4079,6 +4228,8 @@
|
|
4079
4228
|
<xsl:value-of select="translate(.,'. ','')"/>
|
4080
4229
|
</xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
|
4081
4230
|
<xsl:value-of select="substring(.,1,1)"/>
|
4231
|
+
</xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
|
4232
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4082
4233
|
</xsl:template><xsl:template name="convertDate">
|
4083
4234
|
<xsl:param name="date"/>
|
4084
4235
|
<xsl:param name="format" select="'short'"/>
|
@@ -4103,6 +4254,57 @@
|
|
4103
4254
|
</xsl:variable>
|
4104
4255
|
<xsl:variable name="result">
|
4105
4256
|
<xsl:choose>
|
4257
|
+
<xsl:when test="$format = 'ddMMyyyy'">
|
4258
|
+
<xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
|
4259
|
+
<xsl:text> </xsl:text>
|
4260
|
+
<xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
|
4261
|
+
</xsl:when>
|
4262
|
+
<xsl:when test="$format = 'ddMM'">
|
4263
|
+
<xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
|
4264
|
+
<xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
|
4265
|
+
</xsl:when>
|
4266
|
+
<xsl:when test="$format = 'short' or $day = ''">
|
4267
|
+
<xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
|
4268
|
+
</xsl:when>
|
4269
|
+
<xsl:otherwise>
|
4270
|
+
<xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
|
4271
|
+
</xsl:otherwise>
|
4272
|
+
</xsl:choose>
|
4273
|
+
</xsl:variable>
|
4274
|
+
<xsl:value-of select="$result"/>
|
4275
|
+
</xsl:template><xsl:template name="convertDateLocalized">
|
4276
|
+
<xsl:param name="date"/>
|
4277
|
+
<xsl:param name="format" select="'short'"/>
|
4278
|
+
<xsl:variable name="year" select="substring($date, 1, 4)"/>
|
4279
|
+
<xsl:variable name="month" select="substring($date, 6, 2)"/>
|
4280
|
+
<xsl:variable name="day" select="substring($date, 9, 2)"/>
|
4281
|
+
<xsl:variable name="monthStr">
|
4282
|
+
<xsl:choose>
|
4283
|
+
<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>
|
4284
|
+
<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>
|
4285
|
+
<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>
|
4286
|
+
<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>
|
4287
|
+
<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>
|
4288
|
+
<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>
|
4289
|
+
<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>
|
4290
|
+
<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>
|
4291
|
+
<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>
|
4292
|
+
<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>
|
4293
|
+
<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>
|
4294
|
+
<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>
|
4295
|
+
</xsl:choose>
|
4296
|
+
</xsl:variable>
|
4297
|
+
<xsl:variable name="result">
|
4298
|
+
<xsl:choose>
|
4299
|
+
<xsl:when test="$format = 'ddMMyyyy'">
|
4300
|
+
<xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
|
4301
|
+
<xsl:text> </xsl:text>
|
4302
|
+
<xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
|
4303
|
+
</xsl:when>
|
4304
|
+
<xsl:when test="$format = 'ddMM'">
|
4305
|
+
<xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
|
4306
|
+
<xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
|
4307
|
+
</xsl:when>
|
4106
4308
|
<xsl:when test="$format = 'short' or $day = ''">
|
4107
4309
|
<xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
|
4108
4310
|
</xsl:when>
|
@@ -4297,6 +4499,7 @@
|
|
4297
4499
|
|
4298
4500
|
|
4299
4501
|
|
4502
|
+
|
4300
4503
|
</xsl:variable>
|
4301
4504
|
<xsl:if test="$documentNS != $XSLNS">
|
4302
4505
|
<xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
|
@@ -4356,6 +4559,11 @@
|
|
4356
4559
|
<xsl:call-template name="getLang"/>
|
4357
4560
|
</xsl:variable>
|
4358
4561
|
|
4359
|
-
<xsl:
|
4562
|
+
<xsl:choose>
|
4563
|
+
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
4564
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
4565
|
+
</xsl:when>
|
4566
|
+
<xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
|
4567
|
+
</xsl:choose>
|
4360
4568
|
|
4361
4569
|
</xsl:template></xsl:stylesheet>
|