metanorma-cc 1.5.5 → 1.6.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 +62 -0
- data/README.adoc +5 -6
- data/lib/asciidoctor/cc/basicdoc.rng +50 -3
- data/lib/asciidoctor/cc/cc.rng +1 -1
- data/lib/asciidoctor/cc/converter.rb +19 -26
- data/lib/asciidoctor/cc/isodoc.rng +36 -43
- data/lib/asciidoctor/cc/validate_section.rb +2 -1
- data/lib/isodoc/cc/base_convert.rb +2 -12
- data/lib/isodoc/cc/csd.standard.xsl +299 -68
- data/lib/isodoc/cc/html/_coverpage.css +4 -0
- data/lib/isodoc/cc/html/cc.css +20 -21
- data/lib/isodoc/cc/html/cc.scss +20 -21
- data/lib/isodoc/cc/html/htmlstyle.css +656 -648
- data/lib/isodoc/cc/html/htmlstyle.scss +3 -4
- data/lib/isodoc/cc/html/wordstyle.css +19 -19
- data/lib/isodoc/cc/html/wordstyle.scss +19 -19
- data/lib/isodoc/cc/html_convert.rb +2 -38
- data/lib/isodoc/cc/i18n.rb +3 -4
- data/lib/isodoc/cc/init.rb +2 -1
- data/lib/isodoc/cc/metadata.rb +6 -22
- data/lib/isodoc/cc/pdf_convert.rb +1 -0
- data/lib/isodoc/cc/presentation_xml_convert.rb +2 -1
- data/lib/isodoc/cc/word_convert.rb +2 -25
- data/lib/isodoc/cc/xref.rb +1 -1
- data/lib/metanorma/cc.rb +23 -20
- data/lib/metanorma/cc/processor.rb +11 -9
- data/lib/metanorma/cc/version.rb +1 -1
- data/metanorma-cc.gemspec +1 -2
- data/metanorma.yml +58 -0
- metadata +7 -24
- data/.github/workflows/macos.yml +0 -38
- data/.github/workflows/ubuntu.yml +0 -56
- data/.github/workflows/windows.yml +0 -40
- data/lib/asciidoctor/cc/front.rb +0 -67
- data/lib/asciidoctor/cc/validate.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccf08dec13e54c9bda2492e45448c05806a6ec2423313fec4d665ea0e94c1850
|
4
|
+
data.tar.gz: 970449ff10bd637add6afc4b50fcf09a93da7306709e0b24063dc4a3222f9d5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7878f144abf9849a3e87c7deb39a1a69abdac68b5e6f8d8d1d39ed211ba1c2ccf697fc901a33f5a20d709f193522bfcddee12e86df6c08e18a02e77ef406a81
|
7
|
+
data.tar.gz: f486c99a5fb4684c26d140051b33c6a62b3e46818955ae574663f880dc1d48cde0673cd7c5844daa4765f8b6f474a9db495c8ced2b95d63026539b5fe2ad8c07
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
|
+
name: rake
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches: [ master, main ]
|
8
|
+
tags: [ v* ]
|
9
|
+
pull_request:
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
rake:
|
13
|
+
name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
|
14
|
+
runs-on: ${{ matrix.os }}
|
15
|
+
continue-on-error: ${{ matrix.experimental }}
|
16
|
+
strategy:
|
17
|
+
fail-fast: false
|
18
|
+
matrix:
|
19
|
+
ruby: [ '2.6', '2.5', '2.4' ]
|
20
|
+
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
21
|
+
experimental: [ false ]
|
22
|
+
include:
|
23
|
+
- ruby: '2.7'
|
24
|
+
os: 'ubuntu-latest'
|
25
|
+
experimental: true
|
26
|
+
- ruby: '2.7'
|
27
|
+
os: 'windows-latest'
|
28
|
+
experimental: true
|
29
|
+
- ruby: '2.7'
|
30
|
+
os: 'macos-latest'
|
31
|
+
experimental: true
|
32
|
+
steps:
|
33
|
+
- uses: actions/checkout@master
|
34
|
+
|
35
|
+
- uses: ruby/setup-ruby@v1
|
36
|
+
with:
|
37
|
+
ruby-version: ${{ matrix.ruby }}
|
38
|
+
|
39
|
+
- uses: actions/cache@v2
|
40
|
+
with:
|
41
|
+
path: vendor/bundle
|
42
|
+
key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
|
43
|
+
restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
|
44
|
+
|
45
|
+
- run: bundle config set path 'vendor/bundle'
|
46
|
+
|
47
|
+
- run: bundle install --jobs 4 --retry 3
|
48
|
+
|
49
|
+
- 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 }}
|
data/README.adoc
CHANGED
@@ -1,18 +1,14 @@
|
|
1
1
|
= metanorma-cc: Metanorma processor for CalConnect standards
|
2
2
|
|
3
3
|
image:https://img.shields.io/gem/v/metanorma-cc.svg["Gem Version", link="https://rubygems.org/gems/metanorma-cc"]
|
4
|
-
image:https://github.com/metanorma/metanorma-cc/workflows/
|
5
|
-
image:https://github.com/metanorma/metanorma-cc/workflows/ubuntu/badge.svg["Build Status (ubuntu)", link="https://github.com/metanorma/metanorma-cc/actions?workflow=ubuntu"]
|
6
|
-
image:https://github.com/metanorma/metanorma-cc/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/metanorma/metanorma-cc/actions?workflow=windows"]
|
4
|
+
image:https://github.com/metanorma/metanorma-cc/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-cc/actions?workflow=rake"]
|
7
5
|
image:https://codeclimate.com/github/metanorma/metanorma-cc/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-cc"]
|
8
6
|
image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-cc.svg["Pull Requests", link="https://github.com/metanorma/metanorma-cc/pulls"]
|
9
7
|
image:https://img.shields.io/github/commits-since/metanorma/metanorma-cc/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-cc/releases"]
|
10
8
|
|
11
|
-
_Formerly known as_ `asciidoctor-csd`, `metanorma-csd`.
|
12
|
-
|
13
9
|
== Functionality
|
14
10
|
|
15
|
-
This gem processes
|
11
|
+
This gem processes https://www.metanorma.com/[Metanorma documents] following
|
16
12
|
the Metanorma model for generating CalConnect Standards.
|
17
13
|
|
18
14
|
The gem currently inherits from the https://github.com/metanorma/metanorma-standoc
|
@@ -59,3 +55,6 @@ See https://www.metanorma.com/author/cc/[Author CalConnect documents with Metano
|
|
59
55
|
* Example documents are avalable at the https://github.com/metanorma/mn-samples-cc[mn-samples-cc] repository.
|
60
56
|
* Document templates are available at the https://github.com/metanorma/mn-templates-cc[mn-templates-cc] repository.
|
61
57
|
|
58
|
+
== Notes
|
59
|
+
|
60
|
+
Metanorma-CC was formerly published as `asciidoctor-csd` and `metanorma-csd`.
|
@@ -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,15 +729,61 @@
|
|
728
729
|
</define>
|
729
730
|
<define name="index">
|
730
731
|
<element name="index">
|
731
|
-
<attribute name="
|
732
|
+
<attribute name="to">
|
733
|
+
<data type="IDREF"/>
|
734
|
+
</attribute>
|
735
|
+
<element name="primary">
|
736
|
+
<oneOrMore>
|
737
|
+
<ref name="PureTextElement"/>
|
738
|
+
</oneOrMore>
|
739
|
+
</element>
|
732
740
|
<optional>
|
733
|
-
<
|
741
|
+
<element name="secondary">
|
742
|
+
<oneOrMore>
|
743
|
+
<ref name="PureTextElement"/>
|
744
|
+
</oneOrMore>
|
745
|
+
</element>
|
734
746
|
</optional>
|
735
747
|
<optional>
|
736
|
-
<
|
748
|
+
<element name="tertiary">
|
749
|
+
<oneOrMore>
|
750
|
+
<ref name="PureTextElement"/>
|
751
|
+
</oneOrMore>
|
752
|
+
</element>
|
737
753
|
</optional>
|
738
754
|
</element>
|
739
755
|
</define>
|
756
|
+
<define name="index-xref">
|
757
|
+
<element name="index-xref">
|
758
|
+
<attribute name="also">
|
759
|
+
<data type="boolean"/>
|
760
|
+
</attribute>
|
761
|
+
<element name="primary">
|
762
|
+
<oneOrMore>
|
763
|
+
<ref name="PureTextElement"/>
|
764
|
+
</oneOrMore>
|
765
|
+
</element>
|
766
|
+
<optional>
|
767
|
+
<element name="secondary">
|
768
|
+
<oneOrMore>
|
769
|
+
<ref name="PureTextElement"/>
|
770
|
+
</oneOrMore>
|
771
|
+
</element>
|
772
|
+
</optional>
|
773
|
+
<optional>
|
774
|
+
<element name="tertiary">
|
775
|
+
<oneOrMore>
|
776
|
+
<ref name="PureTextElement"/>
|
777
|
+
</oneOrMore>
|
778
|
+
</element>
|
779
|
+
</optional>
|
780
|
+
<element name="target">
|
781
|
+
<oneOrMore>
|
782
|
+
<ref name="PureTextElement"/>
|
783
|
+
</oneOrMore>
|
784
|
+
</element>
|
785
|
+
</element>
|
786
|
+
</define>
|
740
787
|
<!-- bare ID element, used for referencing arbitrary spans of text -->
|
741
788
|
<define name="bookmark">
|
742
789
|
<element name="bookmark">
|
data/lib/asciidoctor/cc/cc.rng
CHANGED
@@ -4,24 +4,33 @@ require "isodoc/cc/word_convert"
|
|
4
4
|
require "isodoc/cc/presentation_xml_convert"
|
5
5
|
require "metanorma/cc"
|
6
6
|
require "asciidoctor/standoc/converter"
|
7
|
-
require
|
8
|
-
require_relative "validate"
|
7
|
+
require 'asciidoctor/generic/converter'
|
9
8
|
require_relative "validate_section"
|
10
|
-
require_relative "front"
|
11
9
|
|
12
10
|
module Asciidoctor
|
13
11
|
module CC
|
14
|
-
|
15
|
-
# A {Converter} implementation that generates CC output, and a document
|
16
|
-
# schema encapsulation of the document for validation
|
17
|
-
class Converter < Standoc::Converter
|
12
|
+
class Converter < Asciidoctor::Generic::Converter
|
18
13
|
XML_ROOT_TAG = "csd-standard".freeze
|
19
14
|
XML_NAMESPACE = "https://www.metanorma.org/ns/csd".freeze
|
20
15
|
|
21
16
|
register_for "cc"
|
22
17
|
|
23
|
-
def
|
24
|
-
|
18
|
+
def configuration
|
19
|
+
Metanorma::CC.configuration
|
20
|
+
end
|
21
|
+
|
22
|
+
def metadata_committee(node, xml)
|
23
|
+
return unless node.attr("technical-committee")
|
24
|
+
xml.editorialgroup do |a|
|
25
|
+
a.committee node.attr("technical-committee"),
|
26
|
+
**attr_code(type: node.attr("technical-committee-type"))
|
27
|
+
i = 2
|
28
|
+
while node.attr("technical-committee_#{i}") do
|
29
|
+
a.committee node.attr("technical-committee_#{i}"),
|
30
|
+
**attr_code(type: node.attr("technical-committee-type_#{i}"))
|
31
|
+
i += 1
|
32
|
+
end
|
33
|
+
end
|
25
34
|
end
|
26
35
|
|
27
36
|
def outputs(node, ret)
|
@@ -35,28 +44,12 @@ module Asciidoctor
|
|
35
44
|
nil, false, "#{@filename}.pdf")
|
36
45
|
end
|
37
46
|
|
38
|
-
def validate(doc)
|
39
|
-
content_validate(doc)
|
40
|
-
schema_validate(formattedstr_strip(doc.dup),
|
41
|
-
File.join(File.dirname(__FILE__), "cc.rng"))
|
42
|
-
end
|
43
|
-
|
44
|
-
def sections_cleanup(x)
|
45
|
-
super
|
46
|
-
x.xpath("//*[@inline-header]").each do |h|
|
47
|
-
h.delete("inline-header")
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
def style(n, t)
|
52
|
-
return
|
53
|
-
end
|
54
|
-
|
55
47
|
def html_converter(node)
|
56
48
|
IsoDoc::CC::HtmlConvert.new(html_extract_attributes(node))
|
57
49
|
end
|
58
50
|
|
59
51
|
def pdf_converter(node)
|
52
|
+
return if node.attr("no-pdf")
|
60
53
|
IsoDoc::CC::PdfConvert.new(html_extract_attributes(node))
|
61
54
|
end
|
62
55
|
|
@@ -24,6 +24,14 @@
|
|
24
24
|
<start>
|
25
25
|
<ref name="standard-document"/>
|
26
26
|
</start>
|
27
|
+
<define name="doctype">
|
28
|
+
<element name="doctype">
|
29
|
+
<optional>
|
30
|
+
<attribute name="abbreviation"/>
|
31
|
+
</optional>
|
32
|
+
<ref name="DocumentType"/>
|
33
|
+
</element>
|
34
|
+
</define>
|
27
35
|
<define name="hyperlink">
|
28
36
|
<element name="link">
|
29
37
|
<attribute name="target">
|
@@ -47,6 +55,13 @@
|
|
47
55
|
<param name="pattern">\i\c*|\c+#\c+</param>
|
48
56
|
</data>
|
49
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>
|
50
65
|
<optional>
|
51
66
|
<attribute name="type">
|
52
67
|
<ref name="ReferenceFormat"/>
|
@@ -141,6 +156,11 @@
|
|
141
156
|
<data type="boolean"/>
|
142
157
|
</attribute>
|
143
158
|
</optional>
|
159
|
+
<optional>
|
160
|
+
<attribute name="key">
|
161
|
+
<data type="boolean"/>
|
162
|
+
</attribute>
|
163
|
+
</optional>
|
144
164
|
<oneOrMore>
|
145
165
|
<ref name="dt"/>
|
146
166
|
<ref name="dd"/>
|
@@ -233,6 +253,9 @@
|
|
233
253
|
<data type="boolean"/>
|
234
254
|
</attribute>
|
235
255
|
</optional>
|
256
|
+
<optional>
|
257
|
+
<ref name="colgroup"/>
|
258
|
+
</optional>
|
236
259
|
<optional>
|
237
260
|
<ref name="tname"/>
|
238
261
|
</optional>
|
@@ -751,6 +774,18 @@
|
|
751
774
|
</define>
|
752
775
|
</include>
|
753
776
|
<!-- end overrides -->
|
777
|
+
<define name="colgroup">
|
778
|
+
<element name="colgroup">
|
779
|
+
<oneOrMore>
|
780
|
+
<ref name="col"/>
|
781
|
+
</oneOrMore>
|
782
|
+
</element>
|
783
|
+
</define>
|
784
|
+
<define name="col">
|
785
|
+
<element name="col">
|
786
|
+
<attribute name="width"/>
|
787
|
+
</element>
|
788
|
+
</define>
|
754
789
|
<define name="TextElement" combine="choice">
|
755
790
|
<ref name="concept"/>
|
756
791
|
</define>
|
@@ -1164,49 +1199,7 @@
|
|
1164
1199
|
</define>
|
1165
1200
|
<define name="annex">
|
1166
1201
|
<element name="annex">
|
1167
|
-
<
|
1168
|
-
<attribute name="id">
|
1169
|
-
<data type="ID"/>
|
1170
|
-
</attribute>
|
1171
|
-
</optional>
|
1172
|
-
<optional>
|
1173
|
-
<attribute name="language"/>
|
1174
|
-
</optional>
|
1175
|
-
<optional>
|
1176
|
-
<attribute name="script"/>
|
1177
|
-
</optional>
|
1178
|
-
<optional>
|
1179
|
-
<attribute name="inline-header">
|
1180
|
-
<data type="boolean"/>
|
1181
|
-
</attribute>
|
1182
|
-
</optional>
|
1183
|
-
<attribute name="obligation">
|
1184
|
-
<choice>
|
1185
|
-
<value>normative</value>
|
1186
|
-
<value>informative</value>
|
1187
|
-
</choice>
|
1188
|
-
</attribute>
|
1189
|
-
<optional>
|
1190
|
-
<ref name="section-title"/>
|
1191
|
-
</optional>
|
1192
|
-
<group>
|
1193
|
-
<group>
|
1194
|
-
<zeroOrMore>
|
1195
|
-
<ref name="BasicBlock"/>
|
1196
|
-
</zeroOrMore>
|
1197
|
-
<zeroOrMore>
|
1198
|
-
<ref name="note"/>
|
1199
|
-
</zeroOrMore>
|
1200
|
-
</group>
|
1201
|
-
<zeroOrMore>
|
1202
|
-
<choice>
|
1203
|
-
<ref name="annex-subsection"/>
|
1204
|
-
<ref name="terms"/>
|
1205
|
-
<ref name="definitions"/>
|
1206
|
-
<ref name="references"/>
|
1207
|
-
</choice>
|
1208
|
-
</zeroOrMore>
|
1209
|
-
</group>
|
1202
|
+
<ref name="Annex-Section"/>
|
1210
1203
|
</element>
|
1211
1204
|
</define>
|
1212
1205
|
<define name="terms">
|
@@ -1,8 +1,9 @@
|
|
1
1
|
require "nokogiri"
|
2
|
+
require "metanorma-generic"
|
2
3
|
|
3
4
|
module Asciidoctor
|
4
5
|
module CC
|
5
|
-
class Converter <
|
6
|
+
class Converter < Asciidoctor::Generic::Converter
|
6
7
|
def section_validate(doc)
|
7
8
|
advisory = doc.root.at("//bibdata/ext[doctype = 'advisory']")
|
8
9
|
symbols_validate(doc.root) unless advisory
|
@@ -3,18 +3,8 @@ require "isodoc"
|
|
3
3
|
module IsoDoc
|
4
4
|
module CC
|
5
5
|
module BaseConvert
|
6
|
-
def
|
7
|
-
|
8
|
-
term_cleanup(docxml)
|
9
|
-
end
|
10
|
-
|
11
|
-
def term_cleanup(docxml)
|
12
|
-
docxml.xpath("//p[@class = 'Terms']").each do |d|
|
13
|
-
h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
|
14
|
-
h2.add_child(" ")
|
15
|
-
h2.add_child(d.remove)
|
16
|
-
end
|
17
|
-
docxml
|
6
|
+
def configuration
|
7
|
+
Metanorma::CC.configuration
|
18
8
|
end
|
19
9
|
end
|
20
10
|
end
|
@@ -37,7 +37,7 @@
|
|
37
37
|
|
38
38
|
<xsl:template match="/">
|
39
39
|
<xsl:call-template name="namespaceCheck"/>
|
40
|
-
<fo:root font-family="
|
40
|
+
<fo:root font-family="Source Sans Pro, STIX Two Math, Source Han Sans" font-size="10.5pt" xml:lang="{$lang}">
|
41
41
|
<fo:layout-master-set>
|
42
42
|
<!-- Cover page -->
|
43
43
|
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
@@ -596,7 +596,7 @@
|
|
596
596
|
<xsl:otherwise> <!-- for ordered lists -->
|
597
597
|
<xsl:choose>
|
598
598
|
<xsl:when test="../@type = 'arabic'">
|
599
|
-
<xsl:number format="a)"/>
|
599
|
+
<xsl:number format="a)" lang="en"/>
|
600
600
|
</xsl:when>
|
601
601
|
<xsl:when test="../@type = 'alphabet'">
|
602
602
|
<xsl:number format="1)"/>
|
@@ -853,13 +853,22 @@
|
|
853
853
|
<title-part lang="en">
|
854
854
|
|
855
855
|
|
856
|
+
|
856
857
|
</title-part>
|
857
858
|
<title-part lang="fr">
|
858
859
|
|
859
860
|
|
861
|
+
|
860
862
|
</title-part>
|
861
863
|
<title-part lang="zh">第 # 部分:</title-part>
|
862
864
|
|
865
|
+
<title-subpart lang="en">
|
866
|
+
|
867
|
+
</title-subpart>
|
868
|
+
<title-subpart lang="fr">
|
869
|
+
|
870
|
+
</title-subpart>
|
871
|
+
|
863
872
|
<title-modified lang="en">modified</title-modified>
|
864
873
|
<title-modified lang="fr">modifiée</title-modified>
|
865
874
|
|
@@ -957,7 +966,7 @@
|
|
957
966
|
|
958
967
|
|
959
968
|
|
960
|
-
<xsl:attribute name="font-family">
|
969
|
+
<xsl:attribute name="font-family">Source Code Pro</xsl:attribute>
|
961
970
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
962
971
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
963
972
|
|
@@ -1130,6 +1139,7 @@
|
|
1130
1139
|
|
1131
1140
|
|
1132
1141
|
|
1142
|
+
|
1133
1143
|
</xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
|
1134
1144
|
|
1135
1145
|
|
@@ -1172,6 +1182,7 @@
|
|
1172
1182
|
|
1173
1183
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
1174
1184
|
|
1185
|
+
|
1175
1186
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
1176
1187
|
|
1177
1188
|
|
@@ -1205,6 +1216,7 @@
|
|
1205
1216
|
</xsl:attribute-set><xsl:attribute-set name="term-style">
|
1206
1217
|
|
1207
1218
|
</xsl:attribute-set><xsl:attribute-set name="figure-name-style">
|
1219
|
+
|
1208
1220
|
|
1209
1221
|
|
1210
1222
|
|
@@ -1251,7 +1263,7 @@
|
|
1251
1263
|
|
1252
1264
|
</xsl:attribute-set><xsl:attribute-set name="tt-style">
|
1253
1265
|
|
1254
|
-
<xsl:attribute name="font-family">
|
1266
|
+
<xsl:attribute name="font-family">Source Code Pro</xsl:attribute>
|
1255
1267
|
|
1256
1268
|
|
1257
1269
|
|
@@ -1327,7 +1339,9 @@
|
|
1327
1339
|
|
1328
1340
|
|
1329
1341
|
|
1330
|
-
|
1342
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1343
|
+
<fo:block> </fo:block>
|
1344
|
+
</xsl:if> -->
|
1331
1345
|
|
1332
1346
|
<!-- $namespace = 'iso' or -->
|
1333
1347
|
|
@@ -1361,10 +1375,12 @@
|
|
1361
1375
|
|
1362
1376
|
|
1363
1377
|
<xsl:variable name="colwidths">
|
1364
|
-
<xsl:
|
1365
|
-
<xsl:
|
1366
|
-
|
1367
|
-
|
1378
|
+
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
1379
|
+
<xsl:call-template name="calculate-column-widths">
|
1380
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1381
|
+
<xsl:with-param name="table" select="$simple-table"/>
|
1382
|
+
</xsl:call-template>
|
1383
|
+
</xsl:if>
|
1368
1384
|
</xsl:variable>
|
1369
1385
|
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
1370
1386
|
|
@@ -1434,16 +1450,25 @@
|
|
1434
1450
|
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1435
1451
|
</xsl:if>
|
1436
1452
|
|
1437
|
-
<xsl:
|
1438
|
-
<xsl:
|
1439
|
-
<xsl:
|
1440
|
-
<fo:table-column column-width="
|
1441
|
-
</xsl:
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1453
|
+
<xsl:choose>
|
1454
|
+
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
1455
|
+
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
1456
|
+
<fo:table-column column-width="{@width}"/>
|
1457
|
+
</xsl:for-each>
|
1458
|
+
</xsl:when>
|
1459
|
+
<xsl:otherwise>
|
1460
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1461
|
+
<xsl:choose>
|
1462
|
+
<xsl:when test=". = 1 or . = 0">
|
1463
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1464
|
+
</xsl:when>
|
1465
|
+
<xsl:otherwise>
|
1466
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1467
|
+
</xsl:otherwise>
|
1468
|
+
</xsl:choose>
|
1469
|
+
</xsl:for-each>
|
1470
|
+
</xsl:otherwise>
|
1471
|
+
</xsl:choose>
|
1447
1472
|
|
1448
1473
|
<xsl:choose>
|
1449
1474
|
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
|
@@ -1456,10 +1481,12 @@
|
|
1456
1481
|
|
1457
1482
|
</fo:table>
|
1458
1483
|
|
1484
|
+
<xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
|
1459
1485
|
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
1460
1486
|
<xsl:call-template name="insertTableFooterInSeparateTable">
|
1461
1487
|
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
1462
1488
|
<xsl:with-param name="colwidths" select="$colwidths"/>
|
1489
|
+
<xsl:with-param name="colgroup" select="$colgroup"/>
|
1463
1490
|
</xsl:call-template>
|
1464
1491
|
</xsl:for-each>
|
1465
1492
|
|
@@ -1492,6 +1519,7 @@
|
|
1492
1519
|
<xsl:if test="normalize-space() != ''">
|
1493
1520
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
1494
1521
|
|
1522
|
+
|
1495
1523
|
<xsl:apply-templates/>
|
1496
1524
|
</fo:block>
|
1497
1525
|
</xsl:if>
|
@@ -1674,12 +1702,26 @@
|
|
1674
1702
|
|
1675
1703
|
|
1676
1704
|
|
1677
|
-
<!-- except gb and bipm -->
|
1678
1705
|
|
1679
|
-
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
1680
1706
|
|
1681
1707
|
|
1708
|
+
<!-- except gb -->
|
1709
|
+
|
1710
|
+
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
1711
|
+
|
1682
1712
|
|
1713
|
+
<!-- show Note under table in preface (ex. abstract) sections -->
|
1714
|
+
<!-- empty, because notes show at page side in main sections -->
|
1715
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1716
|
+
<xsl:choose>
|
1717
|
+
<xsl:when test="ancestor::*[local-name()='preface']">
|
1718
|
+
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
1719
|
+
</xsl:when>
|
1720
|
+
<xsl:otherwise>
|
1721
|
+
<fo:block/>
|
1722
|
+
</xsl:otherwise>
|
1723
|
+
</xsl:choose>
|
1724
|
+
</xsl:if> -->
|
1683
1725
|
|
1684
1726
|
|
1685
1727
|
<!-- horizontal row separator -->
|
@@ -1698,12 +1740,22 @@
|
|
1698
1740
|
</xsl:template><xsl:template name="insertTableFooterInSeparateTable">
|
1699
1741
|
<xsl:param name="table_attributes"/>
|
1700
1742
|
<xsl:param name="colwidths"/>
|
1743
|
+
<xsl:param name="colgroup"/>
|
1701
1744
|
|
1702
1745
|
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1703
1746
|
|
1704
1747
|
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1705
1748
|
|
1706
|
-
<xsl:variable name="cols-count"
|
1749
|
+
<xsl:variable name="cols-count">
|
1750
|
+
<xsl:choose>
|
1751
|
+
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
1752
|
+
<xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
|
1753
|
+
</xsl:when>
|
1754
|
+
<xsl:otherwise>
|
1755
|
+
<xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
|
1756
|
+
</xsl:otherwise>
|
1757
|
+
</xsl:choose>
|
1758
|
+
</xsl:variable>
|
1707
1759
|
|
1708
1760
|
<fo:table keep-with-previous="always">
|
1709
1761
|
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
@@ -1721,16 +1773,25 @@
|
|
1721
1773
|
</xsl:choose>
|
1722
1774
|
</xsl:for-each>
|
1723
1775
|
|
1724
|
-
<xsl:
|
1725
|
-
<xsl:
|
1726
|
-
<xsl:
|
1727
|
-
<fo:table-column column-width="
|
1728
|
-
</xsl:
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1733
|
-
|
1776
|
+
<xsl:choose>
|
1777
|
+
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
1778
|
+
<xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
|
1779
|
+
<fo:table-column column-width="{@width}"/>
|
1780
|
+
</xsl:for-each>
|
1781
|
+
</xsl:when>
|
1782
|
+
<xsl:otherwise>
|
1783
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1784
|
+
<xsl:choose>
|
1785
|
+
<xsl:when test=". = 1 or . = 0">
|
1786
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1787
|
+
</xsl:when>
|
1788
|
+
<xsl:otherwise>
|
1789
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1790
|
+
</xsl:otherwise>
|
1791
|
+
</xsl:choose>
|
1792
|
+
</xsl:for-each>
|
1793
|
+
</xsl:otherwise>
|
1794
|
+
</xsl:choose>
|
1734
1795
|
|
1735
1796
|
<fo:table-body>
|
1736
1797
|
<fo:table-row>
|
@@ -1742,7 +1803,11 @@
|
|
1742
1803
|
|
1743
1804
|
|
1744
1805
|
|
1745
|
-
|
1806
|
+
|
1807
|
+
|
1808
|
+
|
1809
|
+
|
1810
|
+
<!-- except gb -->
|
1746
1811
|
|
1747
1812
|
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
1748
1813
|
|
@@ -1828,6 +1893,10 @@
|
|
1828
1893
|
|
1829
1894
|
|
1830
1895
|
|
1896
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1897
|
+
<xsl:attribute name="height">8mm</xsl:attribute>
|
1898
|
+
</xsl:if> -->
|
1899
|
+
|
1831
1900
|
<xsl:apply-templates/>
|
1832
1901
|
</fo:table-row>
|
1833
1902
|
</xsl:template><xsl:template match="*[local-name()='th']">
|
@@ -1909,7 +1978,8 @@
|
|
1909
1978
|
</xsl:attribute>
|
1910
1979
|
</xsl:if>
|
1911
1980
|
<xsl:call-template name="display-align"/>
|
1912
|
-
<fo:block>
|
1981
|
+
<fo:block>
|
1982
|
+
|
1913
1983
|
<xsl:apply-templates/>
|
1914
1984
|
</fo:block>
|
1915
1985
|
</fo:table-cell>
|
@@ -2121,7 +2191,13 @@
|
|
2121
2191
|
<xsl:apply-templates/>
|
2122
2192
|
</fo:inline>
|
2123
2193
|
</xsl:template><xsl:template match="*[local-name()='dl']">
|
2124
|
-
<fo:block-container
|
2194
|
+
<fo:block-container>
|
2195
|
+
|
2196
|
+
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
2197
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2198
|
+
</xsl:if>
|
2199
|
+
|
2200
|
+
|
2125
2201
|
<xsl:if test="parent::*[local-name() = 'note']">
|
2126
2202
|
<xsl:attribute name="margin-left">
|
2127
2203
|
<xsl:choose>
|
@@ -2131,8 +2207,12 @@
|
|
2131
2207
|
</xsl:attribute>
|
2132
2208
|
|
2133
2209
|
</xsl:if>
|
2134
|
-
<fo:block-container
|
2135
|
-
|
2210
|
+
<fo:block-container>
|
2211
|
+
|
2212
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
2213
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
2214
|
+
|
2215
|
+
|
2136
2216
|
<xsl:variable name="parent" select="local-name(..)"/>
|
2137
2217
|
|
2138
2218
|
<xsl:variable name="key_iso">
|
@@ -2146,9 +2226,12 @@
|
|
2146
2226
|
<fo:block margin-bottom="12pt" text-align="left">
|
2147
2227
|
|
2148
2228
|
<xsl:variable name="title-where">
|
2149
|
-
|
2150
|
-
|
2151
|
-
|
2229
|
+
|
2230
|
+
|
2231
|
+
<xsl:call-template name="getTitle">
|
2232
|
+
<xsl:with-param name="name" select="'title-where'"/>
|
2233
|
+
</xsl:call-template>
|
2234
|
+
|
2152
2235
|
</xsl:variable>
|
2153
2236
|
<xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
|
2154
2237
|
<xsl:apply-templates select="*[local-name()='dt']/*"/>
|
@@ -2164,9 +2247,12 @@
|
|
2164
2247
|
|
2165
2248
|
|
2166
2249
|
<xsl:variable name="title-where">
|
2167
|
-
|
2168
|
-
|
2169
|
-
|
2250
|
+
|
2251
|
+
|
2252
|
+
<xsl:call-template name="getTitle">
|
2253
|
+
<xsl:with-param name="name" select="'title-where'"/>
|
2254
|
+
</xsl:call-template>
|
2255
|
+
|
2170
2256
|
</xsl:variable>
|
2171
2257
|
<xsl:value-of select="$title-where"/>
|
2172
2258
|
</fo:block>
|
@@ -2177,9 +2263,12 @@
|
|
2177
2263
|
|
2178
2264
|
|
2179
2265
|
<xsl:variable name="title-key">
|
2180
|
-
|
2181
|
-
|
2182
|
-
|
2266
|
+
|
2267
|
+
|
2268
|
+
<xsl:call-template name="getTitle">
|
2269
|
+
<xsl:with-param name="name" select="'title-key'"/>
|
2270
|
+
</xsl:call-template>
|
2271
|
+
|
2183
2272
|
</xsl:variable>
|
2184
2273
|
<xsl:value-of select="$title-key"/>
|
2185
2274
|
</fo:block>
|
@@ -2305,12 +2394,32 @@
|
|
2305
2394
|
</xsl:otherwise>
|
2306
2395
|
</xsl:choose>
|
2307
2396
|
</xsl:template><xsl:template name="getMaxLength_dt">
|
2308
|
-
<xsl:
|
2309
|
-
<xsl:
|
2310
|
-
|
2311
|
-
<xsl:
|
2312
|
-
|
2313
|
-
|
2397
|
+
<xsl:variable name="lengths">
|
2398
|
+
<xsl:for-each select="*[local-name()='dt']">
|
2399
|
+
<xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
|
2400
|
+
<xsl:variable name="attributes">
|
2401
|
+
<xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
|
2402
|
+
<xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
|
2403
|
+
</xsl:variable>
|
2404
|
+
<length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
|
2405
|
+
</xsl:for-each>
|
2406
|
+
</xsl:variable>
|
2407
|
+
<xsl:variable name="maxLength">
|
2408
|
+
<!-- <xsl:for-each select="*[local-name()='dt']">
|
2409
|
+
<xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
|
2410
|
+
<xsl:if test="position() = 1">
|
2411
|
+
<xsl:value-of select="string-length(normalize-space(.))"/>
|
2412
|
+
</xsl:if>
|
2413
|
+
</xsl:for-each> -->
|
2414
|
+
<xsl:for-each select="xalan:nodeset($lengths)/length">
|
2415
|
+
<xsl:sort select="." data-type="number" order="descending"/>
|
2416
|
+
<xsl:if test="position() = 1">
|
2417
|
+
<xsl:value-of select="."/>
|
2418
|
+
</xsl:if>
|
2419
|
+
</xsl:for-each>
|
2420
|
+
</xsl:variable>
|
2421
|
+
<!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
|
2422
|
+
<xsl:value-of select="$maxLength"/>
|
2314
2423
|
</xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
|
2315
2424
|
<xsl:param name="key_iso"/>
|
2316
2425
|
|
@@ -2424,6 +2533,7 @@
|
|
2424
2533
|
</fo:inline>
|
2425
2534
|
</xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
|
2426
2535
|
<fo:inline font-weight="bold">
|
2536
|
+
|
2427
2537
|
<xsl:apply-templates/>
|
2428
2538
|
</fo:inline>
|
2429
2539
|
</xsl:template><xsl:template match="*[local-name()='sup']">
|
@@ -2752,7 +2862,18 @@
|
|
2752
2862
|
<xsl:with-param name="previousRow" select="$newRow"/>
|
2753
2863
|
</xsl:apply-templates>
|
2754
2864
|
</xsl:template><xsl:template name="getLang">
|
2755
|
-
<xsl:variable name="
|
2865
|
+
<xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
2866
|
+
<xsl:variable name="language">
|
2867
|
+
<xsl:choose>
|
2868
|
+
<xsl:when test="$language_current != ''">
|
2869
|
+
<xsl:value-of select="$language_current"/>
|
2870
|
+
</xsl:when>
|
2871
|
+
<xsl:otherwise>
|
2872
|
+
<xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
2873
|
+
</xsl:otherwise>
|
2874
|
+
</xsl:choose>
|
2875
|
+
</xsl:variable>
|
2876
|
+
|
2756
2877
|
<xsl:choose>
|
2757
2878
|
<xsl:when test="$language = 'English'">en</xsl:when>
|
2758
2879
|
<xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
|
@@ -2787,6 +2908,7 @@
|
|
2787
2908
|
<xsl:value-of select="substring($str, 2)"/>
|
2788
2909
|
</xsl:template><xsl:template match="mathml:math">
|
2789
2910
|
<fo:inline font-family="STIX Two Math"> <!-- -->
|
2911
|
+
|
2790
2912
|
<xsl:variable name="mathml">
|
2791
2913
|
<xsl:apply-templates select="." mode="mathml"/>
|
2792
2914
|
</xsl:variable>
|
@@ -2816,6 +2938,7 @@
|
|
2816
2938
|
</xsl:choose>
|
2817
2939
|
</xsl:variable>
|
2818
2940
|
<fo:inline xsl:use-attribute-sets="link-style">
|
2941
|
+
|
2819
2942
|
<xsl:choose>
|
2820
2943
|
<xsl:when test="$target = ''">
|
2821
2944
|
<xsl:apply-templates/>
|
@@ -2869,10 +2992,14 @@
|
|
2869
2992
|
</fo:inline>
|
2870
2993
|
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
2871
2994
|
<xsl:variable name="title-modified">
|
2872
|
-
|
2873
|
-
|
2874
|
-
|
2995
|
+
|
2996
|
+
|
2997
|
+
<xsl:call-template name="getTitle">
|
2998
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
2999
|
+
</xsl:call-template>
|
3000
|
+
|
2875
3001
|
</xsl:variable>
|
3002
|
+
|
2876
3003
|
<xsl:choose>
|
2877
3004
|
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
|
2878
3005
|
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
|
@@ -2933,6 +3060,8 @@
|
|
2933
3060
|
|
2934
3061
|
|
2935
3062
|
|
3063
|
+
|
3064
|
+
|
2936
3065
|
<fo:inline xsl:use-attribute-sets="note-name-style">
|
2937
3066
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
2938
3067
|
</fo:inline>
|
@@ -3021,7 +3150,8 @@
|
|
3021
3150
|
</fo:inline>
|
3022
3151
|
</xsl:if>
|
3023
3152
|
</xsl:template><xsl:template match="*[local-name() = 'figure']">
|
3024
|
-
<fo:block-container id="{@id}">
|
3153
|
+
<fo:block-container id="{@id}">
|
3154
|
+
|
3025
3155
|
<fo:block>
|
3026
3156
|
<xsl:apply-templates/>
|
3027
3157
|
</fo:block>
|
@@ -3072,7 +3202,7 @@
|
|
3072
3202
|
<xsl:apply-templates mode="bookmarks"/>
|
3073
3203
|
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
|
3074
3204
|
<xsl:apply-templates select="."/>
|
3075
|
-
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3205
|
+
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
|
3076
3206
|
<xsl:apply-templates mode="bookmarks"/>
|
3077
3207
|
</xsl:template><xsl:template name="addBookmarks">
|
3078
3208
|
<xsl:param name="contents"/>
|
@@ -3088,6 +3218,8 @@
|
|
3088
3218
|
<xsl:variable name="bookmark-title_">
|
3089
3219
|
<xsl:call-template name="getLangVersion">
|
3090
3220
|
<xsl:with-param name="lang" select="@lang"/>
|
3221
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
3222
|
+
<xsl:with-param name="title" select="@title-part"/>
|
3091
3223
|
</xsl:call-template>
|
3092
3224
|
</xsl:variable>
|
3093
3225
|
<xsl:choose>
|
@@ -3105,13 +3237,34 @@
|
|
3105
3237
|
</xsl:choose>
|
3106
3238
|
</fo:bookmark-title>
|
3107
3239
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3240
|
+
|
3241
|
+
<xsl:call-template name="insertFigureBookmarks">
|
3242
|
+
<xsl:with-param name="contents" select="contents"/>
|
3243
|
+
</xsl:call-template>
|
3244
|
+
|
3245
|
+
<xsl:call-template name="insertTableBookmarks">
|
3246
|
+
<xsl:with-param name="contents" select="contents"/>
|
3247
|
+
<xsl:with-param name="lang" select="@lang"/>
|
3248
|
+
</xsl:call-template>
|
3249
|
+
|
3108
3250
|
</fo:bookmark>
|
3109
3251
|
|
3110
3252
|
</xsl:for-each>
|
3111
3253
|
</xsl:when>
|
3112
3254
|
<xsl:otherwise>
|
3113
3255
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3256
|
+
|
3114
3257
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3258
|
+
|
3259
|
+
<xsl:call-template name="insertFigureBookmarks">
|
3260
|
+
<xsl:with-param name="contents" select="contents"/>
|
3261
|
+
</xsl:call-template>
|
3262
|
+
|
3263
|
+
<xsl:call-template name="insertTableBookmarks">
|
3264
|
+
<xsl:with-param name="contents" select="contents"/>
|
3265
|
+
<xsl:with-param name="lang" select="@lang"/>
|
3266
|
+
</xsl:call-template>
|
3267
|
+
|
3115
3268
|
</xsl:for-each>
|
3116
3269
|
</xsl:otherwise>
|
3117
3270
|
</xsl:choose>
|
@@ -3130,8 +3283,44 @@
|
|
3130
3283
|
|
3131
3284
|
</fo:bookmark-tree>
|
3132
3285
|
</xsl:if>
|
3286
|
+
</xsl:template><xsl:template name="insertFigureBookmarks">
|
3287
|
+
<xsl:param name="contents"/>
|
3288
|
+
<xsl:if test="xalan:nodeset($contents)/figure">
|
3289
|
+
<fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
|
3290
|
+
<fo:bookmark-title>Figures</fo:bookmark-title>
|
3291
|
+
<xsl:for-each select="xalan:nodeset($contents)/figure">
|
3292
|
+
<fo:bookmark internal-destination="{@id}">
|
3293
|
+
<fo:bookmark-title>
|
3294
|
+
<xsl:value-of select="normalize-space(title)"/>
|
3295
|
+
</fo:bookmark-title>
|
3296
|
+
</fo:bookmark>
|
3297
|
+
</xsl:for-each>
|
3298
|
+
</fo:bookmark>
|
3299
|
+
</xsl:if>
|
3300
|
+
</xsl:template><xsl:template name="insertTableBookmarks">
|
3301
|
+
<xsl:param name="contents"/>
|
3302
|
+
<xsl:param name="lang"/>
|
3303
|
+
<xsl:if test="xalan:nodeset($contents)/table">
|
3304
|
+
<fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
|
3305
|
+
<fo:bookmark-title>
|
3306
|
+
<xsl:choose>
|
3307
|
+
<xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
|
3308
|
+
<xsl:otherwise>Tables</xsl:otherwise>
|
3309
|
+
</xsl:choose>
|
3310
|
+
</fo:bookmark-title>
|
3311
|
+
<xsl:for-each select="xalan:nodeset($contents)/table">
|
3312
|
+
<fo:bookmark internal-destination="{@id}">
|
3313
|
+
<fo:bookmark-title>
|
3314
|
+
<xsl:value-of select="normalize-space(title)"/>
|
3315
|
+
</fo:bookmark-title>
|
3316
|
+
</fo:bookmark>
|
3317
|
+
</xsl:for-each>
|
3318
|
+
</fo:bookmark>
|
3319
|
+
</xsl:if>
|
3133
3320
|
</xsl:template><xsl:template name="getLangVersion">
|
3134
3321
|
<xsl:param name="lang"/>
|
3322
|
+
<xsl:param name="doctype" select="''"/>
|
3323
|
+
<xsl:param name="title" select="''"/>
|
3135
3324
|
<xsl:choose>
|
3136
3325
|
<xsl:when test="$lang = 'en'">
|
3137
3326
|
|
@@ -3595,9 +3784,14 @@
|
|
3595
3784
|
|
3596
3785
|
<fo:inline>
|
3597
3786
|
|
3598
|
-
|
3599
|
-
|
3600
|
-
|
3787
|
+
|
3788
|
+
|
3789
|
+
|
3790
|
+
<xsl:call-template name="getTitle">
|
3791
|
+
<xsl:with-param name="name" select="'title-source'"/>
|
3792
|
+
</xsl:call-template>
|
3793
|
+
|
3794
|
+
|
3601
3795
|
<xsl:text>: </xsl:text>
|
3602
3796
|
</fo:inline>
|
3603
3797
|
|
@@ -3622,7 +3816,8 @@
|
|
3622
3816
|
<fo:block-container margin-left="0mm">
|
3623
3817
|
|
3624
3818
|
<fo:block xsl:use-attribute-sets="quote-style">
|
3625
|
-
<xsl:apply-templates select=".//*[local-name() = 'p']"/>
|
3819
|
+
<!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
|
3820
|
+
<xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
|
3626
3821
|
</fo:block>
|
3627
3822
|
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
|
3628
3823
|
<fo:block xsl:use-attribute-sets="quote-source-style">
|
@@ -3750,9 +3945,12 @@
|
|
3750
3945
|
</fo:block>
|
3751
3946
|
</xsl:template><xsl:template match="*[local-name() = 'deprecates']">
|
3752
3947
|
<xsl:variable name="title-deprecated">
|
3753
|
-
|
3754
|
-
|
3755
|
-
|
3948
|
+
|
3949
|
+
|
3950
|
+
<xsl:call-template name="getTitle">
|
3951
|
+
<xsl:with-param name="name" select="'title-deprecated'"/>
|
3952
|
+
</xsl:call-template>
|
3953
|
+
|
3756
3954
|
</xsl:variable>
|
3757
3955
|
<fo:block xsl:use-attribute-sets="deprecates-style">
|
3758
3956
|
<xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
|
@@ -3806,7 +4004,7 @@
|
|
3806
4004
|
<fo:block id="{@id}">
|
3807
4005
|
<xsl:apply-templates/>
|
3808
4006
|
</fo:block>
|
3809
|
-
</xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
|
4007
|
+
</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']">
|
3810
4008
|
|
3811
4009
|
<fo:block id="{@id}">
|
3812
4010
|
<xsl:apply-templates/>
|
@@ -3863,7 +4061,8 @@
|
|
3863
4061
|
<fo:table-column column-width="107mm"/>
|
3864
4062
|
<fo:table-column column-width="15mm"/>
|
3865
4063
|
<fo:table-body>
|
3866
|
-
<fo:table-row
|
4064
|
+
<fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
|
4065
|
+
|
3867
4066
|
<fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
|
3868
4067
|
<fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
|
3869
4068
|
<fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
|
@@ -3881,6 +4080,10 @@
|
|
3881
4080
|
<fo:block><xsl:apply-templates/></fo:block>
|
3882
4081
|
</fo:table-cell>
|
3883
4082
|
</xsl:template><xsl:template name="processBibitem">
|
4083
|
+
|
4084
|
+
|
4085
|
+
<!-- end BIPM bibitem processing-->
|
4086
|
+
|
3884
4087
|
|
3885
4088
|
|
3886
4089
|
|
@@ -4118,13 +4321,22 @@
|
|
4118
4321
|
</xsl:template><xsl:template name="split">
|
4119
4322
|
<xsl:param name="pText" select="."/>
|
4120
4323
|
<xsl:param name="sep" select="','"/>
|
4324
|
+
<xsl:param name="normalize-space" select="'true'"/>
|
4121
4325
|
<xsl:if test="string-length($pText) >0">
|
4122
4326
|
<item>
|
4123
|
-
<xsl:
|
4327
|
+
<xsl:choose>
|
4328
|
+
<xsl:when test="$normalize-space = 'true'">
|
4329
|
+
<xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
|
4330
|
+
</xsl:when>
|
4331
|
+
<xsl:otherwise>
|
4332
|
+
<xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
|
4333
|
+
</xsl:otherwise>
|
4334
|
+
</xsl:choose>
|
4124
4335
|
</item>
|
4125
4336
|
<xsl:call-template name="split">
|
4126
4337
|
<xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
|
4127
4338
|
<xsl:with-param name="sep" select="$sep"/>
|
4339
|
+
<xsl:with-param name="normalize-space" select="$normalize-space"/>
|
4128
4340
|
</xsl:call-template>
|
4129
4341
|
</xsl:if>
|
4130
4342
|
</xsl:template><xsl:template name="getDocumentId">
|
@@ -4190,4 +4402,23 @@
|
|
4190
4402
|
<xsl:with-param name="letter-spacing" select="$letter-spacing"/>
|
4191
4403
|
</xsl:call-template>
|
4192
4404
|
</xsl:if>
|
4405
|
+
</xsl:template><xsl:template name="repeat">
|
4406
|
+
<xsl:param name="char" select="'*'"/>
|
4407
|
+
<xsl:param name="count"/>
|
4408
|
+
<xsl:if test="$count > 0">
|
4409
|
+
<xsl:value-of select="$char"/>
|
4410
|
+
<xsl:call-template name="repeat">
|
4411
|
+
<xsl:with-param name="char" select="$char"/>
|
4412
|
+
<xsl:with-param name="count" select="$count - 1"/>
|
4413
|
+
</xsl:call-template>
|
4414
|
+
</xsl:if>
|
4415
|
+
</xsl:template><xsl:template name="getLocalizedString">
|
4416
|
+
<xsl:param name="key"/>
|
4417
|
+
|
4418
|
+
<xsl:variable name="curr_lang">
|
4419
|
+
<xsl:call-template name="getLang"/>
|
4420
|
+
</xsl:variable>
|
4421
|
+
|
4422
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
4423
|
+
|
4193
4424
|
</xsl:template></xsl:stylesheet>
|