metanorma-iso 1.5.11 → 1.5.12
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 +66 -0
- data/README.adoc +5 -6
- data/lib/asciidoctor/iso/boilerplate-fr.xml +2 -2
- data/lib/asciidoctor/iso/cleanup.rb +33 -0
- data/lib/asciidoctor/iso/isodoc.rng +13 -0
- data/lib/asciidoctor/iso/validate.rb +1 -1
- data/lib/asciidoctor/iso/validate_section.rb +9 -0
- data/lib/isodoc/iso/html/header.html +4 -8
- data/lib/isodoc/iso/i18n-en.yaml +1 -0
- data/lib/isodoc/iso/i18n-fr.yaml +2 -0
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -0
- data/lib/isodoc/iso/i18n.rb +10 -11
- data/lib/isodoc/iso/iso.amendment.xsl +190 -45
- data/lib/isodoc/iso/iso.international-standard.xsl +190 -45
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/asciidoctor-iso/cleanup_spec.rb +4 -4
- data/spec/asciidoctor-iso/refs_spec.rb +174 -143
- data/spec/asciidoctor-iso/validate_spec.rb +17 -0
- data/spec/isodoc/blocks_spec.rb +1 -0
- data/spec/isodoc/ref_spec.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fa41b9ff5a061ea7bf8428ec4cd1a692867c877462f4fd1b7bf1ae1b0dd2a9f
|
4
|
+
data.tar.gz: 7e99d7041d2a295b48057be5ea7505ce05be4b40739ce4ffa3ffc4b94149aabc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7ee3745f439ae3aae5664e6440aed30d94f5e02b4691754fc39cc8ed58fa9bd8e8b80063d9d7889c4e36e8edc9e056f1bef761f471af4742bab8d8465d6a8d7
|
7
|
+
data.tar.gz: a8f78935bf25b08a0cf56872384d0dcabd71d7ea8e996bf87d54db1f7045811b6e064953773b93d0d4f560a38f4fff16b4efd96814f01ac1eefbd4ae4e214d04
|
@@ -0,0 +1,66 @@
|
|
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@v1
|
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
|
+
- name: install plantuml ubuntu
|
50
|
+
if: matrix.os == 'ubuntu-latest'
|
51
|
+
uses: nick-invision/retry@v1
|
52
|
+
with:
|
53
|
+
polling_interval_seconds: 5
|
54
|
+
timeout_minutes: 5
|
55
|
+
max_attempts: 3
|
56
|
+
command: >
|
57
|
+
sudo apt-get update -y && sudo bash -c
|
58
|
+
"curl -L https://github.com/metanorma/plantuml-install/raw/master/ubuntu.sh | bash"
|
59
|
+
|
60
|
+
- if: matrix.os == 'macos-latest'
|
61
|
+
run: brew install plantuml
|
62
|
+
|
63
|
+
- if: matrix.os == 'windows-latest'
|
64
|
+
run: cinst -y plantuml
|
65
|
+
|
66
|
+
- run: bundle exec rake
|
data/README.adoc
CHANGED
@@ -1,22 +1,18 @@
|
|
1
1
|
= Metanorma-ISO: Metanorma processor for ISO standards
|
2
2
|
|
3
3
|
image:https://img.shields.io/gem/v/metanorma-iso.svg["Gem Version", link="https://rubygems.org/gems/metanorma-iso"]
|
4
|
-
image:https://github.com/metanorma/metanorma-iso/workflows/
|
5
|
-
image:https://github.com/metanorma/metanorma-iso/workflows/ubuntu/badge.svg["Build Status (ubuntu)", link="https://github.com/metanorma/metanorma-iso/actions?workflow=ubuntu"]
|
6
|
-
image:https://github.com/metanorma/metanorma-iso/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/metanorma/metanorma-iso/actions?workflow=windows"]
|
4
|
+
image:https://github.com/metanorma/metanorma-iso/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-iso/actions?workflow=rake"]
|
7
5
|
image:https://codeclimate.com/github/metanorma/metanorma-iso/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-iso"]
|
8
6
|
image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-iso.svg["Pull Requests", link="https://github.com/metanorma/metanorma-iso/pulls"]
|
9
7
|
image:https://img.shields.io/github/commits-since/metanorma/metanorma-iso/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-iso/releases"]
|
10
8
|
|
11
|
-
_Formerly known as_ `asciidoctor-iso`.
|
12
|
-
|
13
9
|
== Functionality and Approach
|
14
10
|
|
15
11
|
For the conceptual underpinnings of this gem, and the other gems in the Metanorma suite, see the https://github.com/metanorma/metanorma-model-standoc/blob/master/README.adoc[metanorma-standoc README].
|
16
12
|
|
17
13
|
== Outputs
|
18
14
|
|
19
|
-
This gem processes Metanorma documents following a template for generating ISO
|
15
|
+
This gem processes https://www.metanorma.com[Metanorma documents] following a template for generating ISO
|
20
16
|
International Standards. The following outputs are generated.
|
21
17
|
|
22
18
|
* The XML representation of the document, intended as a document model for ISO
|
@@ -79,3 +75,6 @@ See https://www.metanorma.com/author/iso/[The ISO flavor of Metanorma].
|
|
79
75
|
* Example documents are avalable at the https://github.com/metanorma/mn-samples-iso[mn-samples-iso] repository.
|
80
76
|
* Document templates are available at the https://github.com/metanorma/mn-templates-iso[mn-templates-iso] repository.
|
81
77
|
|
78
|
+
== Notes
|
79
|
+
|
80
|
+
Metanorma-ISO was formerly published as `asciidoctor-iso`.
|
@@ -32,8 +32,8 @@ l’adresse ci-après ou au comité membre de l’ISO dans le pays du demandeur.
|
|
32
32
|
<clause>
|
33
33
|
<title>Avertissement</title>
|
34
34
|
|
35
|
-
<p>Ce document n'est pas une Norme internationale de l'ISO. Il est
|
36
|
-
<p>Les destinataires du
|
35
|
+
<p>Ce document n'est pas une Norme internationale de l'ISO. Il est distribué pour examen et observations. Il est susceptible de modification sans préavis et ne peut être cité comme Norme internationale.</p>
|
36
|
+
<p>Les destinataires du présent projet sont invités à présenter, avec leurs observations, notification des droits de propriété dont ils auraient éventuellement connaissance et à fournir une documentation explicative.</p>
|
37
37
|
</clause>
|
38
38
|
</license-statement>
|
39
39
|
{% endif %}
|
@@ -129,6 +129,39 @@ module Asciidoctor
|
|
129
129
|
file = @lang == "fr" ? "boilerplate-fr.xml" : "boilerplate.xml"
|
130
130
|
File.join(@libdir, file)
|
131
131
|
end
|
132
|
+
|
133
|
+
def footnote_cleanup(xmldoc)
|
134
|
+
unpub_footnotes(xmldoc)
|
135
|
+
super
|
136
|
+
end
|
137
|
+
|
138
|
+
def unpub_footnotes(xmldoc)
|
139
|
+
xmldoc.xpath("//bibitem/note[@type = 'Unpublished-Status']").each do |n|
|
140
|
+
id = n.parent["id"]
|
141
|
+
e = xmldoc.at("//eref[@bibitemid = '#{id}']") or next
|
142
|
+
e.next = n.dup
|
143
|
+
e.next.name = "fn"
|
144
|
+
e.next.delete("format")
|
145
|
+
e.next.delete("type")
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
def bibitem_cleanup(xmldoc)
|
150
|
+
super
|
151
|
+
unpublished_note(xmldoc)
|
152
|
+
end
|
153
|
+
|
154
|
+
def unpublished_note(xmldoc)
|
155
|
+
xmldoc.xpath("//bibitem[not(note[@type = 'Unpublished-Status'])]").each do |b|
|
156
|
+
next if pub_class(b) > 2
|
157
|
+
next unless s = b.at("./status/stage") and s.text.to_i < 60
|
158
|
+
id = b.at("docidentifier").text
|
159
|
+
b.at("./language | ./script | ./abstract | ./status").previous = <<~NOTE
|
160
|
+
<note type="Unpublished-Status">
|
161
|
+
<p>#{@i18n.under_preparation.sub(/%/, id)}</p></note>
|
162
|
+
NOTE
|
163
|
+
end
|
164
|
+
end
|
132
165
|
end
|
133
166
|
end
|
134
167
|
end
|
@@ -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">
|
@@ -141,6 +149,11 @@
|
|
141
149
|
<data type="boolean"/>
|
142
150
|
</attribute>
|
143
151
|
</optional>
|
152
|
+
<optional>
|
153
|
+
<attribute name="key">
|
154
|
+
<data type="boolean"/>
|
155
|
+
</attribute>
|
156
|
+
</optional>
|
144
157
|
<oneOrMore>
|
145
158
|
<ref name="dt"/>
|
146
159
|
<ref name="dd"/>
|
@@ -170,7 +170,7 @@ module Asciidoctor
|
|
170
170
|
|
171
171
|
def bibitem_validate(xmldoc)
|
172
172
|
xmldoc.xpath("//bibitem[date/on = '–']").each do |b|
|
173
|
-
b.at("./note[@type = '
|
173
|
+
b.at("./note[@type = 'Unpublished-Status']") or
|
174
174
|
@log.add("Style", b,
|
175
175
|
"Reference #{b&.at("./@id")&.text} does not have an "\
|
176
176
|
"associated footnote indicating unpublished status")
|
@@ -157,6 +157,15 @@ module Asciidoctor
|
|
157
157
|
scope = root.at("//clause[@type = 'scope']/clause")
|
158
158
|
# ISO/IEC DIR 2, 14.4
|
159
159
|
scope.nil? || style_warning(scope, SCOPE_WARN, nil)
|
160
|
+
tech_report_style(root)
|
161
|
+
end
|
162
|
+
|
163
|
+
def tech_report_style(root)
|
164
|
+
root.at("//bibdata/ext/doctype")&.text == "technical-report" or return
|
165
|
+
root.xpath("//sections/clause[not(@type = 'scope')] | //annex").each do |s|
|
166
|
+
r = requirement_check(extract_text(s))
|
167
|
+
style_warning(s, "Technical Report clause may contain requirement", r) if r
|
168
|
+
end
|
160
169
|
end
|
161
170
|
|
162
171
|
ASSETS_TO_STYLE =
|
@@ -149,8 +149,7 @@ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span style='mso-tab-count:
|
|
149
149
|
|
150
150
|
<div style='mso-element:footer' id=f2>
|
151
151
|
<p class=MsoFooter style='line-height:12.0pt'><span lang=EN-GB
|
152
|
-
style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ agency }} {{ docyear }} –
|
153
|
-
rights reserved<span style='mso-tab-count:1'> </span></span><!--[if supportFields]><span
|
152
|
+
style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ agency }} {{ docyear }} – {{ all_rights_reserved }}<span style='mso-tab-count:1'> </span></span><!--[if supportFields]><span
|
154
153
|
lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
|
155
154
|
style='mso-element:field-begin'></span> PAGE<span style='mso-spacerun:yes'>
|
156
155
|
</span>\* MERGEFORMAT <span style='mso-element:field-separator'></span></span><![endif]--><span
|
@@ -163,8 +162,7 @@ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span></p>
|
|
163
162
|
|
164
163
|
<div style='mso-element:footer' id=f2l>
|
165
164
|
<p class=MsoFooterLandscape style='line-height:12.0pt'><span lang=EN-GB
|
166
|
-
style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ agency }} {{ docyear }} –
|
167
|
-
rights reserved<span style='mso-tab-count:1'> </span></span><!--[if supportFields]><span
|
165
|
+
style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ agency }} {{ docyear }} – {{ all_rights_reserved }}<span style='mso-tab-count:1'> </span></span><!--[if supportFields]><span
|
168
166
|
lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
|
169
167
|
style='mso-element:field-begin'></span> PAGE<span style='mso-spacerun:yes'>
|
170
168
|
</span>\* MERGEFORMAT <span style='mso-element:field-separator'></span></span><![endif]--><span
|
@@ -209,8 +207,7 @@ style='mso-tab-count:1'>
|
|
209
207
|
|
210
208
|
<div style='mso-element:footer' id=f3>
|
211
209
|
<p class=MsoFooter style='line-height:12.0pt'><span lang=EN-GB
|
212
|
-
style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ agency }} {{ docyear }} –
|
213
|
-
rights reserved<span style='mso-tab-count:1'> </span></span><!--[if supportFields]><b
|
210
|
+
style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ agency }} {{ docyear }} – {{ all_rights_reserved }}<span style='mso-tab-count:1'> </span></span><!--[if supportFields]><b
|
214
211
|
style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
|
215
212
|
mso-bidi-font-size:11.0pt'><span style='mso-element:field-begin'></span>
|
216
213
|
PAGE<span style='mso-spacerun:yes'> </span>\* MERGEFORMAT <span
|
@@ -224,8 +221,7 @@ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span>
|
|
224
221
|
|
225
222
|
<div style='mso-element:footer' id=f3l>
|
226
223
|
<p class=MsoFooterLandscape style='line-height:12.0pt'><span lang=EN-GB
|
227
|
-
style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ agency }} {{ docyear }} –
|
228
|
-
rights reserved<span style='mso-tab-count:1'> </span></span><!--[if supportFields]><b
|
224
|
+
style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ agency }} {{ docyear }} – {{ all_rights_reserved }}<span style='mso-tab-count:1'> </span></span><!--[if supportFields]><b
|
229
225
|
style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
|
230
226
|
mso-bidi-font-size:11.0pt'><span style='mso-element:field-begin'></span>
|
231
227
|
PAGE<span style='mso-spacerun:yes'> </span>\* MERGEFORMAT <span
|
data/lib/isodoc/iso/i18n-en.yaml
CHANGED
data/lib/isodoc/iso/i18n-fr.yaml
CHANGED
data/lib/isodoc/iso/i18n.rb
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
module IsoDoc
|
2
2
|
module Iso
|
3
3
|
class I18n < IsoDoc::I18n
|
4
|
-
def
|
5
|
-
y = if
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
4
|
+
def load_yaml1(lang, script)
|
5
|
+
y = if lang == "en"
|
6
|
+
YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
|
7
|
+
elsif lang == "fr"
|
8
|
+
YAML.load_file(File.join(File.dirname(__FILE__), "i18n-fr.yaml"))
|
9
|
+
elsif lang == "zh" && script == "Hans"
|
10
|
+
YAML.load_file(File.join(File.dirname(__FILE__), "i18n-zh-Hans.yaml"))
|
11
|
+
else
|
12
|
+
YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
|
13
|
+
end
|
15
14
|
super.merge(y)
|
16
15
|
end
|
17
16
|
end
|
@@ -17,7 +17,12 @@
|
|
17
17
|
|
18
18
|
<xsl:variable name="docidentifierISO" select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso'] | /iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'ISO']"/>
|
19
19
|
|
20
|
-
<xsl:variable name="
|
20
|
+
<xsl:variable name="all_rights_reserved">
|
21
|
+
<xsl:call-template name="getLocalizedString">
|
22
|
+
<xsl:with-param name="key">all_rights_reserved</xsl:with-param>
|
23
|
+
</xsl:call-template>
|
24
|
+
</xsl:variable>
|
25
|
+
<xsl:variable name="copyrightText" select="concat('© ISO ', /iso:iso-standard/iso:bibdata/iso:copyright/iso:from ,' – ', $all_rights_reserved)"/>
|
21
26
|
|
22
27
|
<xsl:variable name="lang-1st-letter_tmp" select="substring-before(substring-after(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-with-lang'], '('), ')')"/>
|
23
28
|
<xsl:variable name="lang-1st-letter" select="concat('(', $lang-1st-letter_tmp , ')')"/>
|
@@ -162,6 +167,9 @@
|
|
162
167
|
<xsl:template match="/">
|
163
168
|
<xsl:call-template name="namespaceCheck"/>
|
164
169
|
<fo:root font-family="Cambria, Times New Roman, Cambria Math, HanSans" font-size="11pt" xml:lang="{$lang}"> <!-- -->
|
170
|
+
<xsl:if test="$lang = 'zh'">
|
171
|
+
<xsl:attribute name="font-family">HanSans, Times New Roman, Cambria Math</xsl:attribute>
|
172
|
+
</xsl:if>
|
165
173
|
<fo:layout-master-set>
|
166
174
|
|
167
175
|
<!-- cover page -->
|
@@ -376,8 +384,13 @@
|
|
376
384
|
</fo:block>
|
377
385
|
</fo:table-cell>
|
378
386
|
<fo:table-cell display-align="center">
|
379
|
-
<fo:block text-align="right">
|
380
|
-
|
387
|
+
<fo:block text-align="right">
|
388
|
+
<!-- Reference number -->
|
389
|
+
<fo:block>
|
390
|
+
<xsl:call-template name="getLocalizedString">
|
391
|
+
<xsl:with-param name="key">reference_number</xsl:with-param>
|
392
|
+
</xsl:call-template>
|
393
|
+
</fo:block>
|
381
394
|
<fo:block>
|
382
395
|
<xsl:value-of select="$ISOname"/>
|
383
396
|
</fo:block>
|
@@ -756,8 +769,12 @@
|
|
756
769
|
</fo:block>
|
757
770
|
</fo:table-cell>
|
758
771
|
<fo:table-cell display-align="center">
|
759
|
-
<fo:block text-align="right">
|
760
|
-
<fo:block>
|
772
|
+
<fo:block text-align="right">
|
773
|
+
<fo:block>
|
774
|
+
<xsl:call-template name="getLocalizedString">
|
775
|
+
<xsl:with-param name="key">reference_number</xsl:with-param>
|
776
|
+
</xsl:call-template>
|
777
|
+
</fo:block>
|
761
778
|
<fo:block><xsl:value-of select="$ISOname"/></fo:block>
|
762
779
|
<fo:block> </fo:block>
|
763
780
|
<fo:block> </fo:block>
|
@@ -984,10 +1001,10 @@
|
|
984
1001
|
<xsl:if test="/iso:iso-standard/iso:boilerplate/iso:copyright-statement">
|
985
1002
|
|
986
1003
|
<fo:block-container height="252mm" display-align="after">
|
987
|
-
<fo:block margin-bottom="3mm">
|
988
|
-
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Attention))}" width="14mm" content-height="13mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/>
|
989
|
-
<fo:inline padding-left="6mm" font-size="12pt" font-weight="bold"
|
990
|
-
</fo:block>
|
1004
|
+
<!-- <fo:block margin-bottom="3mm">
|
1005
|
+
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Attention))}" width="14mm" content-height="13mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/>
|
1006
|
+
<fo:inline padding-left="6mm" font-size="12pt" font-weight="bold"></fo:inline>
|
1007
|
+
</fo:block> -->
|
991
1008
|
<fo:block line-height="90%">
|
992
1009
|
<fo:block font-size="9pt" text-align="justify">
|
993
1010
|
<xsl:apply-templates select="/iso:iso-standard/iso:boilerplate/iso:copyright-statement"/>
|
@@ -1106,20 +1123,26 @@
|
|
1106
1123
|
</fo:block>
|
1107
1124
|
-->
|
1108
1125
|
<fo:block font-size="18pt" font-weight="bold" margin-top="40pt" margin-bottom="20pt" line-height="1.1">
|
1109
|
-
|
1126
|
+
|
1127
|
+
<xsl:variable name="title-part-doc-lang" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-part']"/>
|
1128
|
+
|
1129
|
+
<xsl:variable name="title-intro-doc-lang" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-intro']"/>
|
1130
|
+
|
1110
1131
|
<fo:block>
|
1111
|
-
<xsl:if test="normalize-space($title-intro) != ''">
|
1112
|
-
<xsl:value-of select="$title-intro"/>
|
1132
|
+
<xsl:if test="normalize-space($title-intro-doc-lang) != ''">
|
1133
|
+
<xsl:value-of select="$title-intro-doc-lang"/>
|
1113
1134
|
<xsl:text> — </xsl:text>
|
1114
1135
|
</xsl:if>
|
1115
1136
|
|
1116
|
-
<xsl:
|
1137
|
+
<xsl:variable name="title-main-doc-lang" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-main']"/>
|
1117
1138
|
|
1118
|
-
<xsl:
|
1139
|
+
<xsl:value-of select="$title-main-doc-lang"/>
|
1140
|
+
|
1141
|
+
<xsl:if test="normalize-space($title-part-doc-lang) != ''">
|
1119
1142
|
<xsl:if test="$part != ''">
|
1120
1143
|
<xsl:text> — </xsl:text>
|
1121
|
-
<fo:block font-weight="normal" margin-top="12pt" line-height="1.1">
|
1122
|
-
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang
|
1144
|
+
<fo:block font-weight="normal" margin-top="12pt" line-height="1.1">
|
1145
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang=$lang]),'#',$part)"/>
|
1123
1146
|
<!-- <xsl:value-of select="$title-part-en"/>
|
1124
1147
|
<xsl:value-of select="$part"/>
|
1125
1148
|
<xsl:text>:</xsl:text> -->
|
@@ -1128,10 +1151,10 @@
|
|
1128
1151
|
</xsl:if>
|
1129
1152
|
</fo:block>
|
1130
1153
|
<fo:block>
|
1131
|
-
<xsl:value-of select="$part-
|
1154
|
+
<xsl:value-of select="$title-part-doc-lang"/>
|
1132
1155
|
</fo:block>
|
1133
1156
|
|
1134
|
-
<xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language =
|
1157
|
+
<xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-amd']"/>
|
1135
1158
|
<xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
|
1136
1159
|
<fo:block margin-top="12pt">
|
1137
1160
|
<xsl:call-template name="printAmendmentTitle"/>
|
@@ -1215,7 +1238,28 @@
|
|
1215
1238
|
</xsl:call-template>
|
1216
1239
|
</fo:block>
|
1217
1240
|
</xsl:if>
|
1218
|
-
<
|
1241
|
+
<xsl:variable name="countPages"/>
|
1242
|
+
<xsl:variable name="price_based_on">
|
1243
|
+
<xsl:call-template name="getLocalizedString">
|
1244
|
+
<xsl:with-param name="key">price_based_on</xsl:with-param>
|
1245
|
+
</xsl:call-template>
|
1246
|
+
</xsl:variable>
|
1247
|
+
<xsl:variable name="price_based_on_items">
|
1248
|
+
<xsl:call-template name="split">
|
1249
|
+
<xsl:with-param name="pText" select="$price_based_on"/>
|
1250
|
+
<xsl:with-param name="sep" select="'%'"/>
|
1251
|
+
<xsl:with-param name="normalize-space">false</xsl:with-param>
|
1252
|
+
</xsl:call-template>
|
1253
|
+
</xsl:variable>
|
1254
|
+
<!-- Price based on ... pages -->
|
1255
|
+
<fo:block font-size="9pt">
|
1256
|
+
<xsl:for-each select="xalan:nodeset($price_based_on_items)/item">
|
1257
|
+
<xsl:value-of select="."/>
|
1258
|
+
<xsl:if test="position() != last()">
|
1259
|
+
<fo:page-number-citation ref-id="lastBlock"/>
|
1260
|
+
</xsl:if>
|
1261
|
+
</xsl:for-each>
|
1262
|
+
</fo:block>
|
1219
1263
|
</fo:block-container>
|
1220
1264
|
</fo:block-container>
|
1221
1265
|
</fo:flow>
|
@@ -1365,6 +1409,14 @@
|
|
1365
1409
|
<fo:block>www.iso.org</fo:block>
|
1366
1410
|
</fo:block> -->
|
1367
1411
|
|
1412
|
+
<xsl:template match="iso:copyright-statement/iso:clause[1]/iso:title">
|
1413
|
+
<fo:block margin-bottom="3mm">
|
1414
|
+
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Attention))}" width="14mm" content-height="13mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/>
|
1415
|
+
<!-- <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold">COPYRIGHT PROTECTED DOCUMENT</fo:inline> -->
|
1416
|
+
<fo:inline padding-left="6mm" font-size="12pt" font-weight="bold"><xsl:apply-templates/></fo:inline>
|
1417
|
+
</fo:block>
|
1418
|
+
</xsl:template>
|
1419
|
+
|
1368
1420
|
<xsl:template match="iso:copyright-statement//iso:p">
|
1369
1421
|
<fo:block>
|
1370
1422
|
<xsl:if test="preceding-sibling::iso:p">
|
@@ -1629,6 +1681,9 @@
|
|
1629
1681
|
<xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
|
1630
1682
|
<fo:inline font-style="italic">
|
1631
1683
|
<xsl:choose>
|
1684
|
+
<xsl:when test="iso:title[@type = 'main' and @language = $lang]">
|
1685
|
+
<xsl:value-of select="iso:title[@type = 'main' and @language = $lang]"/>
|
1686
|
+
</xsl:when>
|
1632
1687
|
<xsl:when test="iso:title[@type = 'main' and @language = 'en']">
|
1633
1688
|
<xsl:value-of select="iso:title[@type = 'main' and @language = 'en']"/>
|
1634
1689
|
</xsl:when>
|
@@ -1748,6 +1803,9 @@
|
|
1748
1803
|
<xsl:apply-templates select="iso:note"/>
|
1749
1804
|
<xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
|
1750
1805
|
<xsl:choose>
|
1806
|
+
<xsl:when test="iso:title[@type = 'main' and @language = $lang]">
|
1807
|
+
<xsl:apply-templates select="iso:title[@type = 'main' and @language = $lang]"/>
|
1808
|
+
</xsl:when>
|
1751
1809
|
<xsl:when test="iso:title[@type = 'main' and @language = 'en']">
|
1752
1810
|
<xsl:apply-templates select="iso:title[@type = 'main' and @language = 'en']"/>
|
1753
1811
|
</xsl:when>
|
@@ -1789,7 +1847,12 @@
|
|
1789
1847
|
|
1790
1848
|
<xsl:template match="iso:admonition">
|
1791
1849
|
<fo:block margin-bottom="12pt" font-weight="bold"> <!-- text-align="center" -->
|
1792
|
-
<xsl:
|
1850
|
+
<xsl:variable name="type">
|
1851
|
+
<xsl:call-template name="getLocalizedString">
|
1852
|
+
<xsl:with-param name="key">admonition.<xsl:value-of select="@type"/></xsl:with-param>
|
1853
|
+
</xsl:call-template>
|
1854
|
+
</xsl:variable>
|
1855
|
+
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new($type))"/>
|
1793
1856
|
<xsl:text> — </xsl:text>
|
1794
1857
|
<xsl:apply-templates/>
|
1795
1858
|
</fo:block>
|
@@ -2111,15 +2174,24 @@
|
|
2111
2174
|
<xsl:text>Part #:</xsl:text>
|
2112
2175
|
|
2113
2176
|
|
2177
|
+
|
2114
2178
|
</title-part>
|
2115
2179
|
<title-part lang="fr">
|
2116
2180
|
|
2117
2181
|
<xsl:text>Partie #:</xsl:text>
|
2118
2182
|
|
2119
2183
|
|
2184
|
+
|
2120
2185
|
</title-part>
|
2121
2186
|
<title-part lang="zh">第 # 部分:</title-part>
|
2122
2187
|
|
2188
|
+
<title-subpart lang="en">
|
2189
|
+
|
2190
|
+
</title-subpart>
|
2191
|
+
<title-subpart lang="fr">
|
2192
|
+
|
2193
|
+
</title-subpart>
|
2194
|
+
|
2123
2195
|
<title-modified lang="en">modified</title-modified>
|
2124
2196
|
<title-modified lang="fr">modifiée</title-modified>
|
2125
2197
|
|
@@ -2597,7 +2669,9 @@
|
|
2597
2669
|
|
2598
2670
|
|
2599
2671
|
|
2600
|
-
|
2672
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
2673
|
+
<fo:block> </fo:block>
|
2674
|
+
</xsl:if> -->
|
2601
2675
|
|
2602
2676
|
<!-- $namespace = 'iso' or -->
|
2603
2677
|
|
@@ -2773,6 +2847,7 @@
|
|
2773
2847
|
|
2774
2848
|
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
2775
2849
|
|
2850
|
+
|
2776
2851
|
<xsl:apply-templates/>
|
2777
2852
|
</fo:block>
|
2778
2853
|
</xsl:if>
|
@@ -3184,6 +3259,7 @@
|
|
3184
3259
|
|
3185
3260
|
|
3186
3261
|
|
3262
|
+
|
3187
3263
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
3188
3264
|
<xsl:attribute name="height">8mm</xsl:attribute>
|
3189
3265
|
</xsl:if> -->
|
@@ -3277,7 +3353,8 @@
|
|
3277
3353
|
</xsl:attribute>
|
3278
3354
|
</xsl:if>
|
3279
3355
|
<xsl:call-template name="display-align"/>
|
3280
|
-
<fo:block>
|
3356
|
+
<fo:block>
|
3357
|
+
|
3281
3358
|
<xsl:apply-templates/>
|
3282
3359
|
</fo:block>
|
3283
3360
|
</fo:table-cell>
|
@@ -3501,7 +3578,11 @@
|
|
3501
3578
|
<xsl:apply-templates/>
|
3502
3579
|
</fo:inline>
|
3503
3580
|
</xsl:template><xsl:template match="*[local-name()='dl']">
|
3504
|
-
<fo:block-container
|
3581
|
+
<fo:block-container>
|
3582
|
+
|
3583
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
3584
|
+
|
3585
|
+
|
3505
3586
|
<xsl:if test="parent::*[local-name() = 'note']">
|
3506
3587
|
<xsl:attribute name="margin-left">
|
3507
3588
|
<xsl:choose>
|
@@ -3511,8 +3592,11 @@
|
|
3511
3592
|
</xsl:attribute>
|
3512
3593
|
|
3513
3594
|
</xsl:if>
|
3514
|
-
<fo:block-container
|
3515
|
-
|
3595
|
+
<fo:block-container>
|
3596
|
+
|
3597
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
3598
|
+
|
3599
|
+
|
3516
3600
|
<xsl:variable name="parent" select="local-name(..)"/>
|
3517
3601
|
|
3518
3602
|
<xsl:variable name="key_iso">
|
@@ -3530,9 +3614,12 @@
|
|
3530
3614
|
<xsl:attribute name="margin-bottom">0</xsl:attribute>
|
3531
3615
|
|
3532
3616
|
<xsl:variable name="title-where">
|
3533
|
-
|
3534
|
-
<xsl:
|
3535
|
-
|
3617
|
+
|
3618
|
+
<xsl:call-template name="getLocalizedString">
|
3619
|
+
<xsl:with-param name="key">where</xsl:with-param>
|
3620
|
+
</xsl:call-template>
|
3621
|
+
|
3622
|
+
|
3536
3623
|
</xsl:variable>
|
3537
3624
|
<xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
|
3538
3625
|
<xsl:apply-templates select="*[local-name()='dt']/*"/>
|
@@ -3550,9 +3637,12 @@
|
|
3550
3637
|
|
3551
3638
|
|
3552
3639
|
<xsl:variable name="title-where">
|
3553
|
-
|
3554
|
-
<xsl:
|
3555
|
-
|
3640
|
+
|
3641
|
+
<xsl:call-template name="getLocalizedString">
|
3642
|
+
<xsl:with-param name="key">where</xsl:with-param>
|
3643
|
+
</xsl:call-template>
|
3644
|
+
|
3645
|
+
|
3556
3646
|
</xsl:variable>
|
3557
3647
|
<xsl:value-of select="$title-where"/>
|
3558
3648
|
</fo:block>
|
@@ -3566,9 +3656,12 @@
|
|
3566
3656
|
|
3567
3657
|
|
3568
3658
|
<xsl:variable name="title-key">
|
3569
|
-
|
3570
|
-
<xsl:
|
3571
|
-
|
3659
|
+
|
3660
|
+
<xsl:call-template name="getLocalizedString">
|
3661
|
+
<xsl:with-param name="key">key</xsl:with-param>
|
3662
|
+
</xsl:call-template>
|
3663
|
+
|
3664
|
+
|
3572
3665
|
</xsl:variable>
|
3573
3666
|
<xsl:value-of select="$title-key"/>
|
3574
3667
|
</fo:block>
|
@@ -4146,7 +4239,18 @@
|
|
4146
4239
|
<xsl:with-param name="previousRow" select="$newRow"/>
|
4147
4240
|
</xsl:apply-templates>
|
4148
4241
|
</xsl:template><xsl:template name="getLang">
|
4149
|
-
<xsl:variable name="
|
4242
|
+
<xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
4243
|
+
<xsl:variable name="language">
|
4244
|
+
<xsl:choose>
|
4245
|
+
<xsl:when test="$language_current != ''">
|
4246
|
+
<xsl:value-of select="$language_current"/>
|
4247
|
+
</xsl:when>
|
4248
|
+
<xsl:otherwise>
|
4249
|
+
<xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
4250
|
+
</xsl:otherwise>
|
4251
|
+
</xsl:choose>
|
4252
|
+
</xsl:variable>
|
4253
|
+
|
4150
4254
|
<xsl:choose>
|
4151
4255
|
<xsl:when test="$language = 'English'">en</xsl:when>
|
4152
4256
|
<xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
|
@@ -4181,6 +4285,7 @@
|
|
4181
4285
|
<xsl:value-of select="substring($str, 2)"/>
|
4182
4286
|
</xsl:template><xsl:template match="mathml:math">
|
4183
4287
|
<fo:inline font-family="STIX Two Math"> <!-- -->
|
4288
|
+
|
4184
4289
|
<xsl:variable name="mathml">
|
4185
4290
|
<xsl:apply-templates select="." mode="mathml"/>
|
4186
4291
|
</xsl:variable>
|
@@ -4263,10 +4368,14 @@
|
|
4263
4368
|
</fo:inline>
|
4264
4369
|
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
4265
4370
|
<xsl:variable name="title-modified">
|
4266
|
-
|
4267
|
-
<xsl:
|
4268
|
-
|
4371
|
+
|
4372
|
+
<xsl:call-template name="getLocalizedString">
|
4373
|
+
<xsl:with-param name="key">modified</xsl:with-param>
|
4374
|
+
</xsl:call-template>
|
4375
|
+
|
4376
|
+
|
4269
4377
|
</xsl:variable>
|
4378
|
+
|
4270
4379
|
<xsl:choose>
|
4271
4380
|
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
|
4272
4381
|
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
|
@@ -4993,9 +5102,14 @@
|
|
4993
5102
|
|
4994
5103
|
<fo:inline>
|
4995
5104
|
|
4996
|
-
|
4997
|
-
|
4998
|
-
|
5105
|
+
|
5106
|
+
|
5107
|
+
<xsl:call-template name="getLocalizedString">
|
5108
|
+
<xsl:with-param name="key">source</xsl:with-param>
|
5109
|
+
</xsl:call-template>
|
5110
|
+
|
5111
|
+
|
5112
|
+
|
4999
5113
|
<xsl:text>: </xsl:text>
|
5000
5114
|
</fo:inline>
|
5001
5115
|
|
@@ -5144,9 +5258,12 @@
|
|
5144
5258
|
</fo:block>
|
5145
5259
|
</xsl:template><xsl:template match="*[local-name() = 'deprecates']">
|
5146
5260
|
<xsl:variable name="title-deprecated">
|
5147
|
-
|
5148
|
-
<xsl:
|
5149
|
-
|
5261
|
+
|
5262
|
+
<xsl:call-template name="getLocalizedString">
|
5263
|
+
<xsl:with-param name="key">deprecated</xsl:with-param>
|
5264
|
+
</xsl:call-template>
|
5265
|
+
|
5266
|
+
|
5150
5267
|
</xsl:variable>
|
5151
5268
|
<fo:block xsl:use-attribute-sets="deprecates-style">
|
5152
5269
|
<xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
|
@@ -5514,13 +5631,22 @@
|
|
5514
5631
|
</xsl:template><xsl:template name="split">
|
5515
5632
|
<xsl:param name="pText" select="."/>
|
5516
5633
|
<xsl:param name="sep" select="','"/>
|
5634
|
+
<xsl:param name="normalize-space" select="'true'"/>
|
5517
5635
|
<xsl:if test="string-length($pText) >0">
|
5518
5636
|
<item>
|
5519
|
-
<xsl:
|
5637
|
+
<xsl:choose>
|
5638
|
+
<xsl:when test="$normalize-space = 'true'">
|
5639
|
+
<xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
|
5640
|
+
</xsl:when>
|
5641
|
+
<xsl:otherwise>
|
5642
|
+
<xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
|
5643
|
+
</xsl:otherwise>
|
5644
|
+
</xsl:choose>
|
5520
5645
|
</item>
|
5521
5646
|
<xsl:call-template name="split">
|
5522
5647
|
<xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
|
5523
5648
|
<xsl:with-param name="sep" select="$sep"/>
|
5649
|
+
<xsl:with-param name="normalize-space" select="$normalize-space"/>
|
5524
5650
|
</xsl:call-template>
|
5525
5651
|
</xsl:if>
|
5526
5652
|
</xsl:template><xsl:template name="getDocumentId">
|
@@ -5586,4 +5712,23 @@
|
|
5586
5712
|
<xsl:with-param name="letter-spacing" select="$letter-spacing"/>
|
5587
5713
|
</xsl:call-template>
|
5588
5714
|
</xsl:if>
|
5715
|
+
</xsl:template><xsl:template name="repeat">
|
5716
|
+
<xsl:param name="char" select="'*'"/>
|
5717
|
+
<xsl:param name="count"/>
|
5718
|
+
<xsl:if test="$count > 0">
|
5719
|
+
<xsl:value-of select="$char"/>
|
5720
|
+
<xsl:call-template name="repeat">
|
5721
|
+
<xsl:with-param name="char" select="$char"/>
|
5722
|
+
<xsl:with-param name="count" select="$count - 1"/>
|
5723
|
+
</xsl:call-template>
|
5724
|
+
</xsl:if>
|
5725
|
+
</xsl:template><xsl:template name="getLocalizedString">
|
5726
|
+
<xsl:param name="key"/>
|
5727
|
+
|
5728
|
+
<xsl:variable name="curr_lang">
|
5729
|
+
<xsl:call-template name="getLang"/>
|
5730
|
+
</xsl:variable>
|
5731
|
+
|
5732
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
5733
|
+
|
5589
5734
|
</xsl:template></xsl:stylesheet>
|