metanorma-iso 1.7.1 → 1.8.1
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 +11 -41
- data/.gitignore +2 -0
- data/.rubocop.yml +6 -2
- data/lib/asciidoctor/iso/base.rb +18 -16
- data/lib/asciidoctor/iso/biblio.rng +4 -6
- data/lib/asciidoctor/iso/cleanup.rb +28 -24
- data/lib/asciidoctor/iso/front.rb +26 -16
- data/lib/asciidoctor/iso/front_id.rb +30 -25
- data/lib/asciidoctor/iso/isodoc.rng +172 -3
- data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
- data/lib/asciidoctor/iso/isostandard.rng +17 -97
- data/lib/asciidoctor/iso/validate.rb +22 -109
- data/lib/asciidoctor/iso/validate_image.rb +97 -0
- data/lib/asciidoctor/iso/validate_requirements.rb +26 -20
- data/lib/asciidoctor/iso/validate_section.rb +39 -20
- data/lib/asciidoctor/iso/validate_style.rb +36 -24
- data/lib/asciidoctor/iso/validate_title.rb +23 -17
- data/lib/isodoc/iso/base_convert.rb +19 -2
- data/lib/isodoc/iso/html/style-human.css +7 -0
- data/lib/isodoc/iso/html/style-iso.css +7 -0
- data/lib/isodoc/iso/html_convert.rb +0 -1
- data/lib/isodoc/iso/i18n-en.yaml +4 -0
- data/lib/isodoc/iso/i18n-fr.yaml +4 -0
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +4 -0
- data/lib/isodoc/iso/index.rb +140 -0
- data/lib/isodoc/iso/iso.amendment.xsl +1092 -208
- data/lib/isodoc/iso/iso.international-standard.xsl +1092 -208
- data/lib/isodoc/iso/presentation_xml_convert.rb +45 -37
- data/lib/isodoc/iso/word_convert.rb +0 -1
- data/lib/isodoc/iso/xref.rb +15 -7
- data/lib/metanorma/iso/processor.rb +1 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +8 -8
- data/spec/asciidoctor/amd_spec.rb +696 -0
- data/spec/asciidoctor/base_spec.rb +733 -0
- data/spec/asciidoctor/blocks_spec.rb +527 -0
- data/spec/asciidoctor/cleanup_spec.rb +1134 -0
- data/spec/asciidoctor/inline_spec.rb +195 -0
- data/spec/asciidoctor/lists_spec.rb +197 -0
- data/spec/asciidoctor/refs_spec.rb +375 -0
- data/spec/asciidoctor/section_spec.rb +393 -0
- data/spec/asciidoctor/table_spec.rb +329 -0
- data/spec/asciidoctor/validate_spec.rb +1627 -0
- data/spec/isodoc/amd_spec.rb +967 -946
- data/spec/isodoc/blocks_spec.rb +530 -507
- data/spec/isodoc/i18n_spec.rb +953 -911
- data/spec/isodoc/inline_spec.rb +355 -293
- data/spec/isodoc/iso_spec.rb +338 -314
- data/spec/isodoc/metadata_spec.rb +392 -382
- data/spec/isodoc/postproc_spec.rb +836 -657
- data/spec/isodoc/ref_spec.rb +374 -331
- data/spec/isodoc/section_spec.rb +821 -519
- data/spec/isodoc/table_spec.rb +472 -411
- data/spec/isodoc/terms_spec.rb +209 -185
- data/spec/isodoc/xref_spec.rb +1370 -1236
- data/spec/metanorma/processor_spec.rb +28 -26
- data/spec/spec_helper.rb +178 -193
- metadata +65 -66
- data/.rubocop.ribose.yml +0 -66
- data/lib/isodoc/iso/html/scripts.html +0 -178
- data/spec/asciidoctor-iso/amd_spec.rb +0 -694
- data/spec/asciidoctor-iso/base_spec.rb +0 -713
- data/spec/asciidoctor-iso/blocks_spec.rb +0 -482
- data/spec/asciidoctor-iso/cleanup_spec.rb +0 -1025
- data/spec/asciidoctor-iso/inline_spec.rb +0 -170
- data/spec/asciidoctor-iso/lists_spec.rb +0 -190
- data/spec/asciidoctor-iso/refs_spec.rb +0 -317
- data/spec/asciidoctor-iso/section_spec.rb +0 -362
- data/spec/asciidoctor-iso/table_spec.rb +0 -313
- data/spec/asciidoctor-iso/validate_spec.rb +0 -1621
- data/spec/assets/xref_error.adoc +0 -7
@@ -3,9 +3,13 @@ require "metanorma-standoc"
|
|
3
3
|
module Asciidoctor
|
4
4
|
module ISO
|
5
5
|
class Converter < Standoc::Converter
|
6
|
+
def title_lang_part(doc, part, lang)
|
7
|
+
doc.at("//bibdata/title[@type='title-#{part}' and @language='#{lang}']")
|
8
|
+
end
|
9
|
+
|
6
10
|
def title_intro_validate(root)
|
7
|
-
title_intro_en = root
|
8
|
-
title_intro_fr = root
|
11
|
+
title_intro_en = title_lang_part(root, "intro", "en")
|
12
|
+
title_intro_fr = title_lang_part(root, "intro", "fr")
|
9
13
|
if title_intro_en.nil? && !title_intro_fr.nil?
|
10
14
|
@log.add("Style", title_intro_fr, "No English Title Intro!")
|
11
15
|
end
|
@@ -15,8 +19,8 @@ module Asciidoctor
|
|
15
19
|
end
|
16
20
|
|
17
21
|
def title_main_validate(root)
|
18
|
-
title_main_en = root
|
19
|
-
title_main_fr = root
|
22
|
+
title_main_en = title_lang_part(root, "main", "en")
|
23
|
+
title_main_fr = title_lang_part(root, "main", "fr")
|
20
24
|
if title_main_en.nil? && !title_main_fr.nil?
|
21
25
|
@log.add("Style", title_main_fr, "No English Title!")
|
22
26
|
end
|
@@ -26,8 +30,8 @@ module Asciidoctor
|
|
26
30
|
end
|
27
31
|
|
28
32
|
def title_part_validate(root)
|
29
|
-
title_part_en = root
|
30
|
-
title_part_fr = root
|
33
|
+
title_part_en = title_lang_part(root, "part", "en")
|
34
|
+
title_part_fr = title_lang_part(root, "part", "fr")
|
31
35
|
(title_part_en.nil? && !title_part_fr.nil?) &&
|
32
36
|
@log.add("Style", title_part_fr, "No English Title Part!")
|
33
37
|
(!title_part_en.nil? && title_part_fr.nil?) &&
|
@@ -41,21 +45,21 @@ module Asciidoctor
|
|
41
45
|
iec = root.at("//bibdata/contributor[role/@type = 'publisher']/"\
|
42
46
|
"organization[abbreviation = 'IEC' or "\
|
43
47
|
"name = 'International Electrotechnical Commission']")
|
44
|
-
|
48
|
+
subpart && !iec and
|
49
|
+
@log.add("Style", docid, "Subpart defined on non-IEC document!")
|
45
50
|
end
|
46
51
|
|
47
52
|
# ISO/IEC DIR 2, 11.5.2
|
48
53
|
def title_names_type_validate(root)
|
49
54
|
doctypes = /International\sStandard | Technical\sSpecification |
|
50
55
|
Publicly\sAvailable\sSpecification | Technical\sReport | Guide /xi
|
51
|
-
title_main_en = root
|
52
|
-
|
56
|
+
title_main_en = title_lang_part(root, "main", "en")
|
57
|
+
!title_main_en.nil? && doctypes.match(title_main_en.text) and
|
53
58
|
@log.add("Style", title_main_en, "Main Title may name document type")
|
54
|
-
|
55
|
-
title_intro_en
|
56
|
-
|
57
|
-
|
58
|
-
end
|
59
|
+
title_intro_en = title_lang_part(root, "intro", "en")
|
60
|
+
!title_intro_en.nil? && doctypes.match(title_intro_en.text) and
|
61
|
+
@log.add("Style", title_intro_en,
|
62
|
+
"Title Intro may name document type")
|
59
63
|
end
|
60
64
|
|
61
65
|
# ISO/IEC DIR 2, 22.2
|
@@ -64,8 +68,9 @@ module Asciidoctor
|
|
64
68
|
title = s&.at("./title")&.text || s.name
|
65
69
|
s.xpath("./clause | ./terms | ./references").each do |ss|
|
66
70
|
subtitle = ss.at("./title")
|
67
|
-
!subtitle.nil? && !subtitle&.text&.empty?
|
68
|
-
@log.add("Style", ss,
|
71
|
+
!subtitle.nil? && !subtitle&.text&.empty? or
|
72
|
+
@log.add("Style", ss,
|
73
|
+
"#{title}: each first-level subclause must have a title")
|
69
74
|
end
|
70
75
|
end
|
71
76
|
end
|
@@ -82,7 +87,8 @@ module Asciidoctor
|
|
82
87
|
withtitle = withtitle || (subtitle && !subtitle.text.empty?)
|
83
88
|
end
|
84
89
|
notitle && withtitle &&
|
85
|
-
@log.add("Style", nil,
|
90
|
+
@log.add("Style", nil,
|
91
|
+
"#{label}: all subclauses must have a title, or none")
|
86
92
|
end
|
87
93
|
|
88
94
|
def title_validate(root)
|
@@ -15,6 +15,7 @@ module IsoDoc
|
|
15
15
|
|
16
16
|
def implicit_reference(b)
|
17
17
|
return true if b&.at(ns("./docidentifier"))&.text == "IEV"
|
18
|
+
|
18
19
|
super
|
19
20
|
end
|
20
21
|
|
@@ -27,8 +28,9 @@ module IsoDoc
|
|
27
28
|
end
|
28
29
|
end
|
29
30
|
|
30
|
-
def example_span_label(
|
31
|
+
def example_span_label(_node, div, name)
|
31
32
|
return if name.nil?
|
33
|
+
|
32
34
|
div.span **{ class: "example_label" } do |p|
|
33
35
|
name.children.each { |n| parse(n, div) }
|
34
36
|
end
|
@@ -56,6 +58,7 @@ module IsoDoc
|
|
56
58
|
node.elements.each do |e|
|
57
59
|
next if e.name == "name"
|
58
60
|
return true if e.name == "p"
|
61
|
+
|
59
62
|
return false
|
60
63
|
end
|
61
64
|
false
|
@@ -74,6 +77,7 @@ module IsoDoc
|
|
74
77
|
def insertall_after_here(node, insert, name)
|
75
78
|
node.children.each do |n|
|
76
79
|
next unless n.name == name
|
80
|
+
|
77
81
|
insert.next = n.remove
|
78
82
|
insert = n
|
79
83
|
end
|
@@ -83,6 +87,7 @@ module IsoDoc
|
|
83
87
|
def termexamples_before_termnotes(node)
|
84
88
|
return unless node.at(ns("./termnote")) && node.at(ns("./termexample"))
|
85
89
|
return unless insert = node.at(ns("./definition"))
|
90
|
+
|
86
91
|
insert = insertall_after_here(node, insert, "termexample")
|
87
92
|
insert = insertall_after_here(node, insert, "termnote")
|
88
93
|
end
|
@@ -110,6 +115,7 @@ module IsoDoc
|
|
110
115
|
return super unless (dl&.xpath(ns("./dt"))&.size == 1 &&
|
111
116
|
dl&.at(ns("./dd"))&.elements&.size == 1 &&
|
112
117
|
dl&.at(ns("./dd/p")))
|
118
|
+
|
113
119
|
out.span **{ class: "zzMoveToFollowing" } do |s|
|
114
120
|
s << "#{@i18n.where} "
|
115
121
|
dl.at(ns("./dt")).children.each { |n| parse(n, s) }
|
@@ -149,7 +155,18 @@ module IsoDoc
|
|
149
155
|
|
150
156
|
def figure_name_parse(node, div, name)
|
151
157
|
div.p **{ class: "FigureTitle", style: "text-align:center;" } do |p|
|
152
|
-
name
|
158
|
+
name&.children&.each { |n| parse(n, div) }
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
def middle(isoxml, out)
|
163
|
+
super
|
164
|
+
indexsect isoxml, out
|
165
|
+
end
|
166
|
+
|
167
|
+
def indexsect(isoxml, out)
|
168
|
+
isoxml.xpath(ns("//indexsect")).each do |i|
|
169
|
+
clause_parse(i, out)
|
153
170
|
end
|
154
171
|
end
|
155
172
|
end
|
@@ -115,6 +115,13 @@ a.FootnoteRef + a.FootnoteRef:before {
|
|
115
115
|
content: ", ";
|
116
116
|
vertical-align: super; }
|
117
117
|
|
118
|
+
.addition {
|
119
|
+
color: blue; }
|
120
|
+
|
121
|
+
.deletion {
|
122
|
+
color: red;
|
123
|
+
text-decoration: line-through; }
|
124
|
+
|
118
125
|
#standard-band {
|
119
126
|
background-color: #0AC442; }
|
120
127
|
|
@@ -115,6 +115,13 @@ a.FootnoteRef + a.FootnoteRef:before {
|
|
115
115
|
content: ", ";
|
116
116
|
vertical-align: super; }
|
117
117
|
|
118
|
+
.addition {
|
119
|
+
color: blue; }
|
120
|
+
|
121
|
+
.deletion {
|
122
|
+
color: red;
|
123
|
+
text-decoration: line-through; }
|
124
|
+
|
118
125
|
#standard-band {
|
119
126
|
background-color: #0AC442; }
|
120
127
|
|
data/lib/isodoc/iso/i18n-en.yaml
CHANGED
data/lib/isodoc/iso/i18n-fr.yaml
CHANGED
@@ -0,0 +1,140 @@
|
|
1
|
+
module IsoDoc
|
2
|
+
module Iso
|
3
|
+
class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
|
4
|
+
def add_id
|
5
|
+
%(id="_#{UUIDTools::UUID.random_create}")
|
6
|
+
end
|
7
|
+
|
8
|
+
def index(docxml)
|
9
|
+
unless docxml.at(ns("//index"))
|
10
|
+
docxml.xpath(ns("//indexsect")).each { |i| i.remove }
|
11
|
+
return
|
12
|
+
end
|
13
|
+
i = docxml.at(ns("//indexsect")) ||
|
14
|
+
docxml.root.add_child("<indexsect #{add_id}><title>#{@i18n.index}</title></indexsect>").first
|
15
|
+
index = sort_indexterms(docxml.xpath(ns("//index")), docxml.xpath(ns("//index-xref[@also = 'false']")),
|
16
|
+
docxml.xpath(ns("//index-xref[@also = 'true']")))
|
17
|
+
index1(docxml, i, index)
|
18
|
+
end
|
19
|
+
|
20
|
+
def index1(docxml, i, index)
|
21
|
+
c = i.add_child("<ul></ul>").first
|
22
|
+
index.keys.sort.each do |k|
|
23
|
+
#c = i.add_child "<clause #{add_id}><title>#{k}</title><ul></ul></clause>"
|
24
|
+
words = index[k].keys.each_with_object({}) { |w, v| v[sortable(w).downcase] = w }
|
25
|
+
words.keys.localize(@lang.to_sym).sort.to_a.each do |w|
|
26
|
+
#c.first.at(ns("./ul")).add_child index_entries(words, index[k], w)
|
27
|
+
c.add_child index_entries(words, index[k], w)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
docxml.xpath(ns("//indexsect//xref")).each { |x| x.children.remove }
|
31
|
+
@xrefs.bookmark_anchor_names(docxml)
|
32
|
+
end
|
33
|
+
|
34
|
+
def sortable(s)
|
35
|
+
HTMLEntities.new.decode(Nokogiri::XML.fragment(s).text)
|
36
|
+
end
|
37
|
+
|
38
|
+
def index_entries_opt
|
39
|
+
{ xref_lbl: ", ", see_lbl: ", #{see_lbl}", also_lbl: ", #{also_lbl}" }
|
40
|
+
end
|
41
|
+
|
42
|
+
def index_entries(words, index, primary)
|
43
|
+
ret = index_entries_head(words[primary], index.dig(words[primary], nil, nil), index_entries_opt)
|
44
|
+
words2 = index[words[primary]]&.keys&.reject { |k| k.nil?}&.each_with_object({}) { |w, v| v[w.downcase] = w }
|
45
|
+
unless words2.empty?
|
46
|
+
ret += "<ul>"
|
47
|
+
words2.keys.localize(@lang.to_sym).sort.to_a.each do |w|
|
48
|
+
ret += index_entries2(words2, index[words[primary]], w)
|
49
|
+
end
|
50
|
+
ret += "</ul>"
|
51
|
+
end
|
52
|
+
ret + "</li>"
|
53
|
+
end
|
54
|
+
|
55
|
+
def index_entries2(words, index, secondary)
|
56
|
+
ret = index_entries_head(words[secondary], index.dig(words[secondary], nil), index_entries_opt)
|
57
|
+
words3 = index[words[secondary]]&.keys&.reject { |k| k.nil?}&.each_with_object({}) { |w, v| v[w.downcase] = w }
|
58
|
+
unless words3.empty?
|
59
|
+
ret += "<ul>"
|
60
|
+
words3.keys.localize(@lang.to_sym).sort.to_a.each do |w|
|
61
|
+
ret += (index_entries_head(words3[w], index[words[secondary]][words3[w]], index_entries_opt) + "</li>")
|
62
|
+
end
|
63
|
+
ret += "</ul>"
|
64
|
+
end
|
65
|
+
ret + "</li>"
|
66
|
+
end
|
67
|
+
|
68
|
+
def index_entries_head(head, entries, opt)
|
69
|
+
ret = "<li>#{head}"
|
70
|
+
xref = entries&.dig(:xref)&.join(", ")
|
71
|
+
see_sort = entries&.dig(:see)&.each_with_object({}) { |w, v| v[sortable(w).downcase] = w }
|
72
|
+
see = see_sort&.keys&.localize(@lang.to_sym)&.sort&.to_a&.map { |k| see_sort[k] }&.join(", ")
|
73
|
+
also_sort = entries&.dig(:also)&.each_with_object({}) { |w, v| v[sortable(w).downcase] = w }
|
74
|
+
also = also_sort&.keys&.localize(@lang.to_sym)&.sort&.to_a&.map { |k| also_sort[k] }&.join(", ")
|
75
|
+
ret += "#{opt[:xref_lbl]} #{xref}" if xref
|
76
|
+
ret += "#{opt[:see_lbl]} #{see}" if see
|
77
|
+
ret += "#{opt[:also_lbl]} #{also}" if also
|
78
|
+
ret
|
79
|
+
end
|
80
|
+
|
81
|
+
def see_lbl
|
82
|
+
@lang == "en" ? @i18n.see : "<em>#{@i18n.see}</em>"
|
83
|
+
end
|
84
|
+
|
85
|
+
def also_lbl
|
86
|
+
@lang == "en" ? @i18n.see_also : "<em>#{@i18n.see_also}</em>"
|
87
|
+
end
|
88
|
+
|
89
|
+
def sort_indexterms(terms, see, also)
|
90
|
+
index = extract_indexterms(terms)
|
91
|
+
index = extract_indexsee(index, see, :see)
|
92
|
+
index = extract_indexsee(index, also, :also)
|
93
|
+
index.keys.sort.each_with_object({}) do |k, v|
|
94
|
+
v[sortable(k)[0].upcase.transliterate] ||= {}
|
95
|
+
v[sortable(k)[0].upcase.transliterate][k] = index[k]
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
def extract_indexsee(v, terms, label)
|
100
|
+
terms.each_with_object(v) do |t, v|
|
101
|
+
term = t&.at(ns("./primary"))&.children&.to_xml
|
102
|
+
term2 = t&.at(ns("./secondary"))&.children&.to_xml
|
103
|
+
term3 = t&.at(ns("./tertiary"))&.children&.to_xml
|
104
|
+
v[term] ||= {}
|
105
|
+
v[term][term2] ||= {}
|
106
|
+
v[term][term2][term3] ||= {}
|
107
|
+
v[term][term2][term3][label] ||= []
|
108
|
+
v[term][term2][term3][label] << t&.at(ns("./target"))&.children&.to_xml
|
109
|
+
t.remove
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def xml_encode_attr(s)
|
114
|
+
HTMLEntities.new.encode(s, :basic, :hexadecimal).gsub(/\&#x([^;]+);/) { |x| "&#x#{$1.upcase};" }
|
115
|
+
end
|
116
|
+
|
117
|
+
# attributes are decoded into UTF-8, elements in extract_indexsee are still in entities
|
118
|
+
def extract_indexterms(terms)
|
119
|
+
terms.each_with_object({}) do |t, v|
|
120
|
+
term = t&.at(ns("./primary"))&.children&.to_xml
|
121
|
+
term2 = t&.at(ns("./secondary"))&.children&.to_xml
|
122
|
+
term3 = t&.at(ns("./tertiary"))&.children&.to_xml
|
123
|
+
index2bookmark(t)
|
124
|
+
v[term] ||= {}
|
125
|
+
v[term][term2] ||= {}
|
126
|
+
v[term][term2][term3] ||= {}
|
127
|
+
v[term][term2][term3][:xref] ||= []
|
128
|
+
to = t["to"] ? "to='#{t['to']}' " : ""
|
129
|
+
v[term][term2][term3][:xref] << "<xref target='#{t['id']}' #{to}pagenumber='true'/>"
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def index2bookmark(t)
|
134
|
+
t.name = "bookmark"
|
135
|
+
t.children.each { |x| x.remove }
|
136
|
+
t["id"] = "_#{UUIDTools::UUID.random_create}"
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
@@ -1,19 +1,34 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:java="http://xml.apache.org/xalan/java" exclude-result-prefixes="java" version="1.0">
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:java="http://xml.apache.org/xalan/java" exclude-result-prefixes="java" version="1.0">
|
2
2
|
|
3
3
|
<xsl:output method="xml" encoding="UTF-8" indent="no"/>
|
4
4
|
|
5
5
|
<xsl:param name="svg_images"/>
|
6
|
+
<xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
|
6
7
|
<xsl:variable name="images" select="document($svg_images)"/>
|
8
|
+
<xsl:param name="basepath"/>
|
7
9
|
|
8
10
|
|
9
11
|
|
10
12
|
<xsl:key name="kfn" match="iso:p/iso:fn" use="@reference"/>
|
11
13
|
|
14
|
+
<xsl:key name="attachments" match="iso:eref[contains(@bibitemid, '.exp')]" use="@bibitemid"/>
|
15
|
+
|
12
16
|
|
13
17
|
|
14
18
|
<xsl:variable name="debug">false</xsl:variable>
|
15
|
-
<xsl:variable name="pageWidth" select="
|
16
|
-
<xsl:variable name="pageHeight" select="
|
19
|
+
<xsl:variable name="pageWidth" select="210"/>
|
20
|
+
<xsl:variable name="pageHeight" select="297"/>
|
21
|
+
<xsl:variable name="marginLeftRight1" select="25"/>
|
22
|
+
<xsl:variable name="marginLeftRight2" select="12.5"/>
|
23
|
+
<xsl:variable name="marginTop" select="27.4"/>
|
24
|
+
<xsl:variable name="marginBottom" select="13"/>
|
25
|
+
|
26
|
+
<xsl:variable name="figure_name_height">14</xsl:variable>
|
27
|
+
<xsl:variable name="width_effective" select="$pageWidth - $marginLeftRight1 - $marginLeftRight2"/><!-- paper width minus margins -->
|
28
|
+
<xsl:variable name="height_effective" select="$pageHeight - $marginTop - $marginBottom - $figure_name_height"/><!-- paper height minus margins and title height -->
|
29
|
+
<xsl:variable name="image_dpi" select="96"/>
|
30
|
+
<xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/>
|
31
|
+
<xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/>
|
17
32
|
|
18
33
|
<xsl:variable name="docidentifierISO" select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso'] | /iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'ISO']"/>
|
19
34
|
|
@@ -157,6 +172,7 @@
|
|
157
172
|
<contents>
|
158
173
|
<xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
|
159
174
|
<xsl:call-template name="processMainSectionsDefault_Contents"/>
|
175
|
+
<xsl:apply-templates select="//iso:indexsect" mode="contents"/>
|
160
176
|
</contents>
|
161
177
|
</xsl:variable>
|
162
178
|
|
@@ -170,10 +186,11 @@
|
|
170
186
|
<xsl:if test="$lang = 'zh'">
|
171
187
|
<xsl:attribute name="font-family">Source Han Sans, Times New Roman, Cambria Math</xsl:attribute>
|
172
188
|
</xsl:if>
|
189
|
+
|
173
190
|
<fo:layout-master-set>
|
174
191
|
|
175
192
|
<!-- cover page -->
|
176
|
-
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
193
|
+
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
177
194
|
<fo:region-body margin-top="25.4mm" margin-bottom="25.4mm" margin-left="31.7mm" margin-right="31.7mm"/>
|
178
195
|
<fo:region-before region-name="cover-page-header" extent="25.4mm"/>
|
179
196
|
<fo:region-after/>
|
@@ -181,7 +198,7 @@
|
|
181
198
|
<fo:region-end region-name="cover-right-region" extent="31.7mm"/>
|
182
199
|
</fo:simple-page-master>
|
183
200
|
|
184
|
-
<fo:simple-page-master master-name="cover-page-published" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
201
|
+
<fo:simple-page-master master-name="cover-page-published" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
185
202
|
<fo:region-body margin-top="12.7mm" margin-bottom="40mm" margin-left="78mm" margin-right="18.5mm"/>
|
186
203
|
<fo:region-before region-name="cover-page-header" extent="12.7mm"/>
|
187
204
|
<fo:region-after region-name="cover-page-footer" extent="40mm" display-align="after"/>
|
@@ -190,19 +207,19 @@
|
|
190
207
|
</fo:simple-page-master>
|
191
208
|
|
192
209
|
|
193
|
-
<fo:simple-page-master master-name="cover-page-publishedISO-odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
194
|
-
<fo:region-body margin-top="12.7mm" margin-bottom="40mm" margin-left="
|
210
|
+
<fo:simple-page-master master-name="cover-page-publishedISO-odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
211
|
+
<fo:region-body margin-top="12.7mm" margin-bottom="40mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
195
212
|
<fo:region-before region-name="cover-page-header" extent="12.7mm"/>
|
196
213
|
<fo:region-after region-name="cover-page-footer" extent="40mm" display-align="after"/>
|
197
|
-
<fo:region-start region-name="cover-left-region" extent="
|
198
|
-
<fo:region-end region-name="cover-right-region" extent="
|
214
|
+
<fo:region-start region-name="cover-left-region" extent="{$marginLeftRight1}mm"/>
|
215
|
+
<fo:region-end region-name="cover-right-region" extent="{$marginLeftRight2}mm"/>
|
199
216
|
</fo:simple-page-master>
|
200
|
-
<fo:simple-page-master master-name="cover-page-publishedISO-even" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
201
|
-
<fo:region-body margin-top="12.7mm" margin-bottom="40mm" margin-left="
|
217
|
+
<fo:simple-page-master master-name="cover-page-publishedISO-even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
218
|
+
<fo:region-body margin-top="12.7mm" margin-bottom="40mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
|
202
219
|
<fo:region-before region-name="cover-page-header" extent="12.7mm"/>
|
203
220
|
<fo:region-after region-name="cover-page-footer" extent="40mm" display-align="after"/>
|
204
|
-
<fo:region-start region-name="cover-left-region" extent="
|
205
|
-
<fo:region-end region-name="cover-right-region" extent="
|
221
|
+
<fo:region-start region-name="cover-left-region" extent="{$marginLeftRight2}mm"/>
|
222
|
+
<fo:region-end region-name="cover-right-region" extent="{$marginLeftRight1}mm"/>
|
206
223
|
</fo:simple-page-master>
|
207
224
|
<fo:page-sequence-master master-name="cover-page-publishedISO">
|
208
225
|
<fo:repeatable-page-master-alternatives>
|
@@ -214,7 +231,7 @@
|
|
214
231
|
|
215
232
|
<!-- contents pages -->
|
216
233
|
<!-- odd pages -->
|
217
|
-
<fo:simple-page-master master-name="odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
234
|
+
<fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
218
235
|
<fo:region-body margin-top="27.4mm" margin-bottom="13mm" margin-left="19mm" margin-right="19mm"/>
|
219
236
|
<fo:region-before region-name="header-odd" extent="27.4mm"/> <!-- display-align="center" -->
|
220
237
|
<fo:region-after region-name="footer-odd" extent="13mm"/>
|
@@ -222,7 +239,7 @@
|
|
222
239
|
<fo:region-end region-name="right-region" extent="19mm"/>
|
223
240
|
</fo:simple-page-master>
|
224
241
|
<!-- even pages -->
|
225
|
-
<fo:simple-page-master master-name="even" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
242
|
+
<fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
226
243
|
<fo:region-body margin-top="27.4mm" margin-bottom="13mm" margin-left="19mm" margin-right="19mm"/>
|
227
244
|
<fo:region-before region-name="header-even" extent="27.4mm"/> <!-- display-align="center" -->
|
228
245
|
<fo:region-after region-name="footer-even" extent="13mm"/>
|
@@ -244,35 +261,35 @@
|
|
244
261
|
|
245
262
|
|
246
263
|
<!-- first page -->
|
247
|
-
<fo:simple-page-master master-name="first-publishedISO" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
248
|
-
<fo:region-body margin-top="
|
249
|
-
<fo:region-before region-name="header-first" extent="
|
250
|
-
<fo:region-after region-name="footer-odd" extent="
|
251
|
-
<fo:region-start region-name="left-region" extent="
|
252
|
-
<fo:region-end region-name="right-region" extent="
|
264
|
+
<fo:simple-page-master master-name="first-publishedISO" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
265
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
266
|
+
<fo:region-before region-name="header-first" extent="{$marginTop}mm"/> <!-- display-align="center" -->
|
267
|
+
<fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
|
268
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
|
269
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
|
253
270
|
</fo:simple-page-master>
|
254
271
|
<!-- odd pages -->
|
255
|
-
<fo:simple-page-master master-name="odd-publishedISO" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
256
|
-
<fo:region-body margin-top="
|
257
|
-
<fo:region-before region-name="header-odd" extent="
|
258
|
-
<fo:region-after region-name="footer-odd" extent="
|
259
|
-
<fo:region-start region-name="left-region" extent="
|
260
|
-
<fo:region-end region-name="right-region" extent="
|
272
|
+
<fo:simple-page-master master-name="odd-publishedISO" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
273
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
274
|
+
<fo:region-before region-name="header-odd" extent="{$marginTop}mm"/> <!-- display-align="center" -->
|
275
|
+
<fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
|
276
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
|
277
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
|
261
278
|
</fo:simple-page-master>
|
262
279
|
<!-- even pages -->
|
263
|
-
<fo:simple-page-master master-name="even-publishedISO" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
264
|
-
<fo:region-body margin-top="
|
265
|
-
<fo:region-before region-name="header-even" extent="
|
266
|
-
<fo:region-after region-name="footer-even" extent="
|
267
|
-
<fo:region-start region-name="left-region" extent="
|
268
|
-
<fo:region-end region-name="right-region" extent="
|
280
|
+
<fo:simple-page-master master-name="even-publishedISO" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
281
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
|
282
|
+
<fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
|
283
|
+
<fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
|
284
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
|
285
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
|
269
286
|
</fo:simple-page-master>
|
270
|
-
<fo:simple-page-master master-name="blankpage" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
271
|
-
<fo:region-body margin-top="
|
272
|
-
<fo:region-before region-name="header" extent="
|
273
|
-
<fo:region-after region-name="footer" extent="
|
274
|
-
<fo:region-start region-name="left" extent="
|
275
|
-
<fo:region-end region-name="right" extent="
|
287
|
+
<fo:simple-page-master master-name="blankpage" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
288
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
|
289
|
+
<fo:region-before region-name="header" extent="{$marginTop}mm"/>
|
290
|
+
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
|
291
|
+
<fo:region-start region-name="left" extent="{$marginLeftRight2}mm"/>
|
292
|
+
<fo:region-end region-name="right" extent="{$marginLeftRight1}mm"/>
|
276
293
|
</fo:simple-page-master>
|
277
294
|
<fo:page-sequence-master master-name="preface-publishedISO">
|
278
295
|
<fo:repeatable-page-master-alternatives>
|
@@ -291,17 +308,48 @@
|
|
291
308
|
</fo:repeatable-page-master-alternatives>
|
292
309
|
</fo:page-sequence-master>
|
293
310
|
|
294
|
-
<fo:simple-page-master master-name="last-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
295
|
-
<fo:region-body margin-top="
|
296
|
-
<fo:region-before region-name="header-even" extent="
|
297
|
-
<fo:region-after region-name="last-page-footer" extent="
|
298
|
-
<fo:region-start region-name="left-region" extent="
|
299
|
-
<fo:region-end region-name="right-region" extent="
|
311
|
+
<fo:simple-page-master master-name="last-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
312
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
|
313
|
+
<fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
|
314
|
+
<fo:region-after region-name="last-page-footer" extent="{$marginBottom}mm"/>
|
315
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
|
316
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
|
300
317
|
</fo:simple-page-master>
|
301
318
|
|
319
|
+
<!-- Index pages -->
|
320
|
+
<fo:simple-page-master master-name="index-odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
321
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm" column-count="2" column-gap="10mm"/>
|
322
|
+
<fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
|
323
|
+
<fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
|
324
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
|
325
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
|
326
|
+
</fo:simple-page-master>
|
327
|
+
<fo:simple-page-master master-name="index-even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
328
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm" column-count="2" column-gap="10mm"/>
|
329
|
+
<fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
|
330
|
+
<fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
|
331
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
|
332
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
|
333
|
+
</fo:simple-page-master>
|
334
|
+
<fo:page-sequence-master master-name="index">
|
335
|
+
<fo:repeatable-page-master-alternatives>
|
336
|
+
<fo:conditional-page-master-reference odd-or-even="even" master-reference="index-even"/>
|
337
|
+
<fo:conditional-page-master-reference odd-or-even="odd" master-reference="index-odd"/>
|
338
|
+
</fo:repeatable-page-master-alternatives>
|
339
|
+
</fo:page-sequence-master>
|
340
|
+
|
341
|
+
|
302
342
|
</fo:layout-master-set>
|
343
|
+
|
344
|
+
<fo:declarations>
|
345
|
+
<xsl:call-template name="addPDFUAmeta"/>
|
346
|
+
<xsl:for-each select="//*[local-name() = 'eref'][generate-id(.)=generate-id(key('attachments',@bibitemid)[1])]">
|
347
|
+
<xsl:variable name="url" select="concat('url(file:',$basepath, @bibitemid, ')')"/>
|
348
|
+
<pdf:embedded-file src="{$url}" filename="{@bibitemid}"/>
|
349
|
+
</xsl:for-each>
|
350
|
+
</fo:declarations>
|
303
351
|
|
304
|
-
|
352
|
+
|
305
353
|
|
306
354
|
<xsl:call-template name="addBookmarks">
|
307
355
|
<xsl:with-param name="contents" select="$contents"/>
|
@@ -900,22 +948,24 @@
|
|
900
948
|
/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:workgroup/@type, ' ',
|
901
949
|
/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:workgroup/@number)"/>
|
902
950
|
-->
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
<
|
907
|
-
<xsl:text
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
<xsl:
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
<xsl:
|
916
|
-
|
917
|
-
|
918
|
-
|
951
|
+
|
952
|
+
<xsl:if test="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:technical-committee[normalize-space(@number) != ''] or /iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:subcommittee[normalize-space(@number) != ''] or /iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:workgroup[normalize-space(@number) != '']">
|
953
|
+
<!-- ISO/TC 34/SC 4/WG 3 -->
|
954
|
+
<fo:block margin-bottom="12pt">
|
955
|
+
<xsl:text>ISO</xsl:text>
|
956
|
+
<xsl:for-each select="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:technical-committee[normalize-space(@number) != '']">
|
957
|
+
<xsl:text>/TC </xsl:text><xsl:value-of select="@number"/>
|
958
|
+
</xsl:for-each>
|
959
|
+
<xsl:for-each select="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:subcommittee[normalize-space(@number) != '']">
|
960
|
+
<xsl:text>/SC </xsl:text>
|
961
|
+
<xsl:value-of select="@number"/>
|
962
|
+
</xsl:for-each>
|
963
|
+
<xsl:for-each select="/iso:iso-standard/iso:bibdata/iso:ext/iso:editorialgroup/iso:workgroup[normalize-space(@number) != '']">
|
964
|
+
<xsl:text>/WG </xsl:text>
|
965
|
+
<xsl:value-of select="@number"/>
|
966
|
+
</xsl:for-each>
|
967
|
+
</fo:block>
|
968
|
+
</xsl:if>
|
919
969
|
<!-- Secretariat: AFNOR -->
|
920
970
|
|
921
971
|
<fo:block margin-bottom="100pt">
|
@@ -977,7 +1027,15 @@
|
|
977
1027
|
<fo:block font-size="11pt" margin-bottom="8pt"><xsl:value-of select="$linebreak"/></fo:block>
|
978
1028
|
<fo:block-container font-size="40pt" text-align="center" margin-bottom="12pt" border="0.5pt solid black">
|
979
1029
|
<xsl:variable name="stage-title" select="substring-after(substring-before($docidentifierISO, ' '), '/')"/>
|
980
|
-
<
|
1030
|
+
<xsl:choose>
|
1031
|
+
<xsl:when test="normalize-space($stage-title) != ''">
|
1032
|
+
<fo:block padding-top="2mm"><xsl:value-of select="$stage-title"/><xsl:text> stage</xsl:text></fo:block>
|
1033
|
+
</xsl:when>
|
1034
|
+
<xsl:otherwise>
|
1035
|
+
<xsl:attribute name="border">0pt solid white</xsl:attribute>
|
1036
|
+
<fo:block> </fo:block>
|
1037
|
+
</xsl:otherwise>
|
1038
|
+
</xsl:choose>
|
981
1039
|
</fo:block-container>
|
982
1040
|
<fo:block><xsl:value-of select="$linebreak"/></fo:block>
|
983
1041
|
|
@@ -1182,6 +1240,10 @@
|
|
1182
1240
|
</fo:flow>
|
1183
1241
|
</fo:page-sequence>
|
1184
1242
|
|
1243
|
+
|
1244
|
+
<!-- Index -->
|
1245
|
+
<xsl:apply-templates select="//iso:indexsect" mode="index"/>
|
1246
|
+
|
1185
1247
|
<xsl:if test="$isPublished = 'true'">
|
1186
1248
|
<fo:page-sequence master-reference="last-page" force-page-count="no-force">
|
1187
1249
|
<xsl:call-template name="insertHeaderEven"/>
|
@@ -1314,7 +1376,10 @@
|
|
1314
1376
|
</xsl:variable>
|
1315
1377
|
|
1316
1378
|
<xsl:variable name="type">
|
1317
|
-
<xsl:
|
1379
|
+
<xsl:choose>
|
1380
|
+
<xsl:when test="local-name() = 'indexsect'">index</xsl:when>
|
1381
|
+
<xsl:otherwise><xsl:value-of select="local-name()"/></xsl:otherwise>
|
1382
|
+
</xsl:choose>
|
1318
1383
|
</xsl:variable>
|
1319
1384
|
|
1320
1385
|
<xsl:variable name="display">
|
@@ -1347,10 +1412,15 @@
|
|
1347
1412
|
</xsl:variable>
|
1348
1413
|
|
1349
1414
|
<item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
|
1415
|
+
<xsl:if test="$type = 'index'">
|
1416
|
+
<xsl:attribute name="level">1</xsl:attribute>
|
1417
|
+
</xsl:if>
|
1350
1418
|
<title>
|
1351
1419
|
<xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
|
1352
1420
|
</title>
|
1353
|
-
<xsl:
|
1421
|
+
<xsl:if test="$type != 'index'">
|
1422
|
+
<xsl:apply-templates mode="contents"/>
|
1423
|
+
</xsl:if>
|
1354
1424
|
</item>
|
1355
1425
|
</xsl:if>
|
1356
1426
|
</xsl:template>
|
@@ -1588,6 +1658,15 @@
|
|
1588
1658
|
</xsl:choose>
|
1589
1659
|
</xsl:attribute>
|
1590
1660
|
<xsl:attribute name="margin-bottom">8pt</xsl:attribute>
|
1661
|
+
<xsl:if test="@id">
|
1662
|
+
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
|
1663
|
+
</xsl:if>
|
1664
|
+
<!-- bookmarks only in paragraph -->
|
1665
|
+
<xsl:if test="count(iso:bookmark) != 0 and count(*) = count(iso:bookmark) and normalize-space() = ''">
|
1666
|
+
<xsl:attribute name="font-size">0</xsl:attribute>
|
1667
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
1668
|
+
<xsl:attribute name="line-height">0</xsl:attribute>
|
1669
|
+
</xsl:if>
|
1591
1670
|
<xsl:apply-templates/>
|
1592
1671
|
</xsl:element>
|
1593
1672
|
<xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')">
|
@@ -1737,7 +1816,7 @@
|
|
1737
1816
|
</xsl:for-each>
|
1738
1817
|
</xsl:template>
|
1739
1818
|
|
1740
|
-
<xsl:template match="iso:ul
|
1819
|
+
<xsl:template match="iso:ul/iso:note | iso:ol/iso:note | iso:ul/iso:li/iso:note | iso:ol/iso:li/iso:note" priority="2"/>
|
1741
1820
|
|
1742
1821
|
<xsl:template match="iso:li">
|
1743
1822
|
<fo:list-item id="{@id}">
|
@@ -1749,7 +1828,10 @@
|
|
1749
1828
|
<fo:list-item-body start-indent="body-start()">
|
1750
1829
|
<fo:block>
|
1751
1830
|
<xsl:apply-templates/>
|
1752
|
-
<xsl:apply-templates select=".//iso:note" mode="process"/>
|
1831
|
+
<!-- <xsl:apply-templates select=".//iso:note" mode="process"/> -->
|
1832
|
+
<xsl:for-each select="./iso:note">
|
1833
|
+
<xsl:call-template name="note"/>
|
1834
|
+
</xsl:for-each>
|
1753
1835
|
</fo:block>
|
1754
1836
|
</fo:list-item-body>
|
1755
1837
|
</fo:list-item>
|
@@ -1759,6 +1841,10 @@
|
|
1759
1841
|
<xsl:call-template name="note"/>
|
1760
1842
|
</xsl:template>
|
1761
1843
|
|
1844
|
+
<xsl:template match="*" mode="process">
|
1845
|
+
<xsl:apply-templates select="."/>
|
1846
|
+
</xsl:template>
|
1847
|
+
|
1762
1848
|
<xsl:template match="iso:preferred">
|
1763
1849
|
<fo:block line-height="1.1">
|
1764
1850
|
<fo:block font-weight="bold" keep-with-next="always">
|
@@ -1840,20 +1926,6 @@
|
|
1840
1926
|
</xsl:template>
|
1841
1927
|
|
1842
1928
|
|
1843
|
-
<xsl:template match="mathml:math" priority="2">
|
1844
|
-
<fo:inline font-family="Cambria Math">
|
1845
|
-
<xsl:variable name="mathml">
|
1846
|
-
<xsl:apply-templates select="." mode="mathml"/>
|
1847
|
-
</xsl:variable>
|
1848
|
-
<fo:instream-foreign-object fox:alt-text="Math">
|
1849
|
-
<!-- <xsl:copy-of select="."/> -->
|
1850
|
-
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
1851
|
-
</fo:instream-foreign-object>
|
1852
|
-
</fo:inline>
|
1853
|
-
</xsl:template>
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
1929
|
<xsl:template match="iso:admonition">
|
1858
1930
|
<fo:block margin-bottom="12pt" font-weight="bold"> <!-- text-align="center" -->
|
1859
1931
|
<xsl:variable name="type">
|
@@ -1891,7 +1963,348 @@
|
|
1891
1963
|
</fo:block>
|
1892
1964
|
</xsl:template>
|
1893
1965
|
|
1966
|
+
<!-- =================== -->
|
1967
|
+
<!-- SVG images processing -->
|
1968
|
+
<!-- =================== -->
|
1969
|
+
<xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/>
|
1970
|
+
<xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2" name="image_svg">
|
1971
|
+
<xsl:param name="name"/>
|
1972
|
+
|
1973
|
+
<xsl:variable name="svg_content">
|
1974
|
+
<xsl:apply-templates select="." mode="svg_update"/>
|
1975
|
+
</xsl:variable>
|
1976
|
+
|
1977
|
+
<xsl:variable name="alt-text">
|
1978
|
+
<xsl:choose>
|
1979
|
+
<xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
|
1980
|
+
<xsl:value-of select="../*[local-name() = 'name']"/>
|
1981
|
+
</xsl:when>
|
1982
|
+
<xsl:when test="normalize-space($name) != ''">
|
1983
|
+
<xsl:value-of select="$name"/>
|
1984
|
+
</xsl:when>
|
1985
|
+
<xsl:otherwise>Figure</xsl:otherwise>
|
1986
|
+
</xsl:choose>
|
1987
|
+
</xsl:variable>
|
1988
|
+
|
1989
|
+
<xsl:choose>
|
1990
|
+
<xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
|
1991
|
+
<fo:block>
|
1992
|
+
<xsl:variable name="width" select="@width"/>
|
1993
|
+
<xsl:variable name="height" select="@height"/>
|
1994
|
+
|
1995
|
+
<xsl:variable name="scale_x">
|
1996
|
+
<xsl:choose>
|
1997
|
+
<xsl:when test="$width > $width_effective_px">
|
1998
|
+
<xsl:value-of select="$width_effective_px div $width"/>
|
1999
|
+
</xsl:when>
|
2000
|
+
<xsl:otherwise>1</xsl:otherwise>
|
2001
|
+
</xsl:choose>
|
2002
|
+
</xsl:variable>
|
2003
|
+
|
2004
|
+
<xsl:variable name="scale_y">
|
2005
|
+
<xsl:choose>
|
2006
|
+
<xsl:when test="$height * $scale_x > $height_effective_px">
|
2007
|
+
<xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
|
2008
|
+
</xsl:when>
|
2009
|
+
<xsl:otherwise>1</xsl:otherwise>
|
2010
|
+
</xsl:choose>
|
2011
|
+
</xsl:variable>
|
2012
|
+
|
2013
|
+
<xsl:variable name="scale">
|
2014
|
+
<xsl:choose>
|
2015
|
+
<xsl:when test="$scale_y != 1">
|
2016
|
+
<xsl:value-of select="$scale_x * $scale_y"/>
|
2017
|
+
</xsl:when>
|
2018
|
+
<xsl:otherwise>
|
2019
|
+
<xsl:value-of select="$scale_x"/>
|
2020
|
+
</xsl:otherwise>
|
2021
|
+
</xsl:choose>
|
2022
|
+
</xsl:variable>
|
2023
|
+
|
2024
|
+
<xsl:variable name="width_scale" select="round($width * $scale)"/>
|
2025
|
+
<xsl:variable name="height_scale" select="round($height * $scale)"/>
|
2026
|
+
|
2027
|
+
<fo:table table-layout="fixed" width="100%">
|
2028
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
2029
|
+
<fo:table-column column-width="{$width_scale}px"/>
|
2030
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
2031
|
+
<fo:table-body>
|
2032
|
+
<fo:table-row>
|
2033
|
+
<fo:table-cell column-number="2">
|
2034
|
+
<fo:block>
|
2035
|
+
<fo:block-container width="{$width_scale}px" height="{$height_scale}px">
|
2036
|
+
<xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
2037
|
+
<fo:block line-height="0" font-size="0">
|
2038
|
+
<xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
2039
|
+
<xsl:call-template name="bookmark"/>
|
2040
|
+
</xsl:for-each>
|
2041
|
+
</fo:block>
|
2042
|
+
</xsl:if>
|
2043
|
+
<fo:block text-depth="0" line-height="0" font-size="0">
|
2044
|
+
|
2045
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
2046
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
2047
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
2048
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
2049
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
2050
|
+
|
2051
|
+
<xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
|
2052
|
+
</fo:instream-foreign-object>
|
2053
|
+
</fo:block>
|
2054
|
+
|
2055
|
+
<xsl:apply-templates select=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]" mode="svg_imagemap_links">
|
2056
|
+
<xsl:with-param name="scale" select="$scale"/>
|
2057
|
+
</xsl:apply-templates>
|
2058
|
+
</fo:block-container>
|
2059
|
+
</fo:block>
|
2060
|
+
</fo:table-cell>
|
2061
|
+
</fo:table-row>
|
2062
|
+
</fo:table-body>
|
2063
|
+
</fo:table>
|
2064
|
+
</fo:block>
|
2065
|
+
|
2066
|
+
</xsl:when>
|
2067
|
+
<xsl:otherwise>
|
2068
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
2069
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
2070
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
2071
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
2072
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
2073
|
+
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
2074
|
+
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
2075
|
+
<!-- effective height / width = 1.48, 1.4 - with title -->
|
2076
|
+
<xsl:if test="@height > (@width * 1.4)"> <!-- for images with big height -->
|
2077
|
+
<xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
|
2078
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
2079
|
+
</xsl:if>
|
2080
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
2081
|
+
<xsl:copy-of select="$svg_content"/>
|
2082
|
+
</fo:instream-foreign-object>
|
2083
|
+
</fo:block>
|
2084
|
+
</xsl:otherwise>
|
2085
|
+
</xsl:choose>
|
2086
|
+
</xsl:template>
|
2087
|
+
|
2088
|
+
<xsl:template match="@*|node()" mode="svg_update">
|
2089
|
+
<xsl:copy>
|
2090
|
+
<xsl:apply-templates select="@*|node()" mode="svg_update"/>
|
2091
|
+
</xsl:copy>
|
2092
|
+
</xsl:template>
|
2093
|
+
|
2094
|
+
<xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
|
2095
|
+
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
2096
|
+
<xsl:value-of select="."/>
|
2097
|
+
</xsl:attribute>
|
2098
|
+
</xsl:template>
|
2099
|
+
|
2100
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
2101
|
+
<xsl:variable name="svg_content" select="document(@src)"/>
|
2102
|
+
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
2103
|
+
<xsl:for-each select="xalan:nodeset($svg_content)/node()">
|
2104
|
+
<xsl:call-template name="image_svg">
|
2105
|
+
<xsl:with-param name="name" select="$name"/>
|
2106
|
+
</xsl:call-template>
|
2107
|
+
</xsl:for-each>
|
2108
|
+
</xsl:template>
|
2109
|
+
|
2110
|
+
<xsl:template match="@*|node()" mode="svg_remove_a">
|
2111
|
+
<xsl:copy>
|
2112
|
+
<xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
|
2113
|
+
</xsl:copy>
|
2114
|
+
</xsl:template>
|
2115
|
+
|
2116
|
+
<xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
|
2117
|
+
<xsl:apply-templates mode="svg_remove_a"/>
|
2118
|
+
</xsl:template>
|
2119
|
+
|
2120
|
+
<xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
|
2121
|
+
<xsl:param name="scale"/>
|
2122
|
+
<xsl:variable name="dest">
|
2123
|
+
<xsl:choose>
|
2124
|
+
<xsl:when test="starts-with(@href, '#')">
|
2125
|
+
<xsl:value-of select="substring-after(@href, '#')"/>
|
2126
|
+
</xsl:when>
|
2127
|
+
<xsl:otherwise>
|
2128
|
+
<xsl:value-of select="@href"/>
|
2129
|
+
</xsl:otherwise>
|
2130
|
+
</xsl:choose>
|
2131
|
+
</xsl:variable>
|
2132
|
+
<xsl:for-each select="./*[local-name() = 'rect']">
|
2133
|
+
<xsl:call-template name="insertSVGMapLink">
|
2134
|
+
<xsl:with-param name="left" select="floor(@x * $scale)"/>
|
2135
|
+
<xsl:with-param name="top" select="floor(@y * $scale)"/>
|
2136
|
+
<xsl:with-param name="width" select="floor(@width * $scale)"/>
|
2137
|
+
<xsl:with-param name="height" select="floor(@height * $scale)"/>
|
2138
|
+
<xsl:with-param name="dest" select="$dest"/>
|
2139
|
+
</xsl:call-template>
|
2140
|
+
</xsl:for-each>
|
2141
|
+
|
2142
|
+
<xsl:for-each select="./*[local-name() = 'polygon']">
|
2143
|
+
<xsl:variable name="points">
|
2144
|
+
<xsl:call-template name="split">
|
2145
|
+
<xsl:with-param name="pText" select="@points"/>
|
2146
|
+
</xsl:call-template>
|
2147
|
+
</xsl:variable>
|
2148
|
+
<xsl:variable name="x_coords">
|
2149
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
|
2150
|
+
<xsl:sort select="." data-type="number"/>
|
2151
|
+
<x><xsl:value-of select="."/></x>
|
2152
|
+
</xsl:for-each>
|
2153
|
+
</xsl:variable>
|
2154
|
+
<xsl:variable name="y_coords">
|
2155
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
|
2156
|
+
<xsl:sort select="." data-type="number"/>
|
2157
|
+
<y><xsl:value-of select="."/></y>
|
2158
|
+
</xsl:for-each>
|
2159
|
+
</xsl:variable>
|
2160
|
+
<xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
|
2161
|
+
<xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
|
2162
|
+
<xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
|
2163
|
+
<xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
|
2164
|
+
<xsl:call-template name="insertSVGMapLink">
|
2165
|
+
<xsl:with-param name="left" select="floor($x * $scale)"/>
|
2166
|
+
<xsl:with-param name="top" select="floor($y * $scale)"/>
|
2167
|
+
<xsl:with-param name="width" select="floor($width * $scale)"/>
|
2168
|
+
<xsl:with-param name="height" select="floor($height * $scale)"/>
|
2169
|
+
<xsl:with-param name="dest" select="$dest"/>
|
2170
|
+
</xsl:call-template>
|
2171
|
+
</xsl:for-each>
|
2172
|
+
|
2173
|
+
<xsl:for-each select="./*[local-name() = 'circle']">
|
2174
|
+
<xsl:call-template name="insertSVGMapLink">
|
2175
|
+
<xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
|
2176
|
+
<xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
|
2177
|
+
<xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
|
2178
|
+
<xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
|
2179
|
+
<xsl:with-param name="dest" select="$dest"/>
|
2180
|
+
</xsl:call-template>
|
2181
|
+
</xsl:for-each>
|
2182
|
+
<xsl:for-each select="./*[local-name() = 'ellipse']">
|
2183
|
+
<xsl:call-template name="insertSVGMapLink">
|
2184
|
+
<xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
|
2185
|
+
<xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
|
2186
|
+
<xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
|
2187
|
+
<xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
|
2188
|
+
<xsl:with-param name="dest" select="$dest"/>
|
2189
|
+
</xsl:call-template>
|
2190
|
+
</xsl:for-each>
|
2191
|
+
</xsl:template>
|
2192
|
+
|
2193
|
+
<xsl:template name="insertSVGMapLink">
|
2194
|
+
<xsl:param name="left"/>
|
2195
|
+
<xsl:param name="top"/>
|
2196
|
+
<xsl:param name="width"/>
|
2197
|
+
<xsl:param name="height"/>
|
2198
|
+
<xsl:param name="dest"/>
|
2199
|
+
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
2200
|
+
<fo:block font-size="1pt">
|
2201
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
2202
|
+
<fo:inline-container inline-progression-dimension="100%">
|
2203
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
2204
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
2205
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
2206
|
+
</xsl:if> -->
|
2207
|
+
<fo:block> </fo:block></fo:block-container>
|
2208
|
+
</fo:inline-container>
|
2209
|
+
</fo:basic-link>
|
2210
|
+
</fo:block>
|
2211
|
+
</fo:block-container>
|
2212
|
+
</xsl:template>
|
2213
|
+
|
2214
|
+
<!-- =================== -->
|
2215
|
+
<!-- End SVG images processing -->
|
2216
|
+
<!-- =================== -->
|
2217
|
+
|
2218
|
+
<!-- For express listings PDF attachments -->
|
2219
|
+
<xsl:template match="*[local-name() = 'eref'][contains(@bibitemid, '.exp')]" priority="2">
|
2220
|
+
<fo:inline xsl:use-attribute-sets="eref-style">
|
2221
|
+
<xsl:variable name="url" select="concat('url(embedded-file:', @bibitemid, ')')"/>
|
2222
|
+
<fo:basic-link external-destination="{$url}" fox:alt-text="{@citeas}">
|
2223
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
2224
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
2225
|
+
</xsl:if>
|
2226
|
+
<xsl:apply-templates/>
|
2227
|
+
</fo:basic-link>
|
2228
|
+
</fo:inline>
|
2229
|
+
</xsl:template>
|
2230
|
+
|
1894
2231
|
|
2232
|
+
<!-- =================== -->
|
2233
|
+
<!-- Index processing -->
|
2234
|
+
<!-- =================== -->
|
2235
|
+
|
2236
|
+
<xsl:template match="iso:indexsect"/>
|
2237
|
+
<xsl:template match="iso:indexsect" mode="index">
|
2238
|
+
|
2239
|
+
<fo:page-sequence master-reference="index" force-page-count="no-force">
|
2240
|
+
<xsl:variable name="header-title">
|
2241
|
+
<xsl:choose>
|
2242
|
+
<xsl:when test="./iso:title[1]/*[local-name() = 'tab']">
|
2243
|
+
<xsl:apply-templates select="./iso:title[1]/*[local-name() = 'tab'][1]/following-sibling::node()" mode="header"/>
|
2244
|
+
</xsl:when>
|
2245
|
+
<xsl:otherwise>
|
2246
|
+
<xsl:apply-templates select="./iso:title[1]" mode="header"/>
|
2247
|
+
</xsl:otherwise>
|
2248
|
+
</xsl:choose>
|
2249
|
+
</xsl:variable>
|
2250
|
+
<xsl:call-template name="insertHeaderFooter">
|
2251
|
+
<xsl:with-param name="header-title" select="$header-title"/>
|
2252
|
+
</xsl:call-template>
|
2253
|
+
|
2254
|
+
<fo:flow flow-name="xsl-region-body">
|
2255
|
+
<fo:block id="{@id}" span="all">
|
2256
|
+
<xsl:apply-templates select="iso:title"/>
|
2257
|
+
</fo:block>
|
2258
|
+
<fo:block>
|
2259
|
+
<xsl:apply-templates select="*[not(local-name() = 'title')]"/>
|
2260
|
+
</fo:block>
|
2261
|
+
</fo:flow>
|
2262
|
+
</fo:page-sequence>
|
2263
|
+
</xsl:template>
|
2264
|
+
|
2265
|
+
<!-- <xsl:template match="iso:clause[@type = 'index']/iso:title" priority="4"> -->
|
2266
|
+
<xsl:template match="iso:indexsect/iso:title" priority="4">
|
2267
|
+
<fo:block font-size="16pt" font-weight="bold" margin-bottom="84pt">
|
2268
|
+
<!-- Index -->
|
2269
|
+
<xsl:apply-templates/>
|
2270
|
+
</fo:block>
|
2271
|
+
</xsl:template>
|
2272
|
+
|
2273
|
+
<!-- <xsl:template match="iso:clause[@type = 'index']/iso:clause/iso:title" priority="4"> -->
|
2274
|
+
<xsl:template match="iso:indexsect/iso:clause/iso:title" priority="4">
|
2275
|
+
<!-- Letter A, B, C, ... -->
|
2276
|
+
<fo:block font-size="10pt" font-weight="bold" margin-bottom="3pt" keep-with-next="always">
|
2277
|
+
<xsl:apply-templates/>
|
2278
|
+
</fo:block>
|
2279
|
+
</xsl:template>
|
2280
|
+
|
2281
|
+
<xsl:template match="iso:indexsect//iso:li/text()">
|
2282
|
+
<!-- to split by '_' and other chars -->
|
2283
|
+
<xsl:call-template name="add-zero-spaces-java"/>
|
2284
|
+
</xsl:template>
|
2285
|
+
|
2286
|
+
<xsl:template match="iso:xref" priority="2">
|
2287
|
+
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
2288
|
+
<xsl:choose>
|
2289
|
+
<xsl:when test="@pagenumber='true'">
|
2290
|
+
<fo:inline>
|
2291
|
+
<xsl:if test="@id">
|
2292
|
+
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
|
2293
|
+
</xsl:if>
|
2294
|
+
<fo:page-number-citation ref-id="{@target}"/>
|
2295
|
+
</fo:inline>
|
2296
|
+
</xsl:when>
|
2297
|
+
<xsl:otherwise>
|
2298
|
+
<xsl:apply-templates/>
|
2299
|
+
</xsl:otherwise>
|
2300
|
+
</xsl:choose>
|
2301
|
+
</fo:basic-link>
|
2302
|
+
</xsl:template>
|
2303
|
+
|
2304
|
+
<!-- =================== -->
|
2305
|
+
<!-- End of Index processing -->
|
2306
|
+
<!-- =================== -->
|
2307
|
+
|
1895
2308
|
|
1896
2309
|
<xsl:template name="insertHeaderFooter">
|
1897
2310
|
<xsl:param name="font-weight" select="'bold'"/>
|
@@ -2285,6 +2698,7 @@
|
|
2285
2698
|
</xsl:choose>
|
2286
2699
|
</xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'
'"/><xsl:attribute-set name="root-style">
|
2287
2700
|
|
2701
|
+
|
2288
2702
|
</xsl:attribute-set><xsl:attribute-set name="link-style">
|
2289
2703
|
|
2290
2704
|
<xsl:attribute name="color">blue</xsl:attribute>
|
@@ -2367,6 +2781,7 @@
|
|
2367
2781
|
|
2368
2782
|
|
2369
2783
|
<xsl:attribute name="padding-right">5mm</xsl:attribute>
|
2784
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
2370
2785
|
|
2371
2786
|
|
2372
2787
|
|
@@ -2393,6 +2808,9 @@
|
|
2393
2808
|
|
2394
2809
|
|
2395
2810
|
|
2811
|
+
<xsl:attribute name="text-align">justify</xsl:attribute>
|
2812
|
+
|
2813
|
+
|
2396
2814
|
|
2397
2815
|
|
2398
2816
|
|
@@ -2620,7 +3038,7 @@
|
|
2620
3038
|
|
2621
3039
|
</xsl:attribute-set><xsl:attribute-set name="admitted-style">
|
2622
3040
|
|
2623
|
-
|
3041
|
+
|
2624
3042
|
</xsl:attribute-set><xsl:attribute-set name="deprecates-style">
|
2625
3043
|
|
2626
3044
|
</xsl:attribute-set><xsl:attribute-set name="definition-style">
|
@@ -2628,7 +3046,27 @@
|
|
2628
3046
|
|
2629
3047
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
2630
3048
|
|
2631
|
-
</xsl:attribute-set><xsl:
|
3049
|
+
</xsl:attribute-set><xsl:variable name="color-added-text">
|
3050
|
+
<xsl:text>rgb(0, 255, 0)</xsl:text>
|
3051
|
+
</xsl:variable><xsl:attribute-set name="add-style">
|
3052
|
+
<xsl:attribute name="color">red</xsl:attribute>
|
3053
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
3054
|
+
<!-- <xsl:attribute name="color">black</xsl:attribute>
|
3055
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
|
3056
|
+
<xsl:attribute name="padding-top">1mm</xsl:attribute>
|
3057
|
+
<xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
|
3058
|
+
</xsl:attribute-set><xsl:variable name="color-deleted-text">
|
3059
|
+
<xsl:text>red</xsl:text>
|
3060
|
+
</xsl:variable><xsl:attribute-set name="del-style">
|
3061
|
+
<xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
|
3062
|
+
<xsl:attribute name="text-decoration">line-through</xsl:attribute>
|
3063
|
+
</xsl:attribute-set><xsl:attribute-set name="mathml-style">
|
3064
|
+
<xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
|
3065
|
+
|
3066
|
+
<xsl:attribute name="font-family">Cambria Math</xsl:attribute>
|
3067
|
+
|
3068
|
+
|
3069
|
+
</xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
|
2632
3070
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
2633
3071
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
2634
3072
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
|
@@ -2673,16 +3111,17 @@
|
|
2673
3111
|
<xsl:call-template name="add-zero-spaces-java"/>
|
2674
3112
|
</xsl:template><xsl:template match="*[local-name()='table']" name="table">
|
2675
3113
|
|
3114
|
+
<xsl:variable name="table-preamble">
|
3115
|
+
|
3116
|
+
|
3117
|
+
</xsl:variable>
|
3118
|
+
|
2676
3119
|
<xsl:variable name="table">
|
2677
3120
|
|
2678
3121
|
<xsl:variable name="simple-table">
|
2679
3122
|
<xsl:call-template name="getSimpleTable"/>
|
2680
3123
|
</xsl:variable>
|
2681
3124
|
|
2682
|
-
|
2683
|
-
|
2684
|
-
|
2685
|
-
|
2686
3125
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
2687
3126
|
<fo:block> </fo:block>
|
2688
3127
|
</xsl:if> -->
|
@@ -2693,7 +3132,7 @@
|
|
2693
3132
|
|
2694
3133
|
|
2695
3134
|
|
2696
|
-
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)
|
3135
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
|
2697
3136
|
|
2698
3137
|
<!-- <xsl:variable name="cols-count">
|
2699
3138
|
<xsl:choose>
|
@@ -2712,8 +3151,6 @@
|
|
2712
3151
|
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
2713
3152
|
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
2714
3153
|
|
2715
|
-
|
2716
|
-
|
2717
3154
|
<xsl:variable name="colwidths">
|
2718
3155
|
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
2719
3156
|
<xsl:call-template name="calculate-column-widths">
|
@@ -2741,6 +3178,7 @@
|
|
2741
3178
|
</xsl:choose>
|
2742
3179
|
</xsl:variable>
|
2743
3180
|
|
3181
|
+
|
2744
3182
|
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
2745
3183
|
|
2746
3184
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
@@ -2782,6 +3220,12 @@
|
|
2782
3220
|
</xsl:if>
|
2783
3221
|
|
2784
3222
|
|
3223
|
+
<xsl:if test="ancestor::*[local-name() = 'table']">
|
3224
|
+
<!-- for internal table in table cell -->
|
3225
|
+
<attribute name="border">0.5pt solid black</attribute>
|
3226
|
+
</xsl:if>
|
3227
|
+
|
3228
|
+
|
2785
3229
|
|
2786
3230
|
|
2787
3231
|
<attribute name="margin-left">0mm</attribute>
|
@@ -2876,7 +3320,8 @@
|
|
2876
3320
|
</fo:block-container>
|
2877
3321
|
</xsl:variable>
|
2878
3322
|
|
2879
|
-
|
3323
|
+
<xsl:variable name="isAdded" select="@added"/>
|
3324
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
2880
3325
|
|
2881
3326
|
<xsl:choose>
|
2882
3327
|
<xsl:when test="@width">
|
@@ -2890,7 +3335,14 @@
|
|
2890
3335
|
<fo:table-body>
|
2891
3336
|
<fo:table-row>
|
2892
3337
|
<fo:table-cell column-number="2">
|
2893
|
-
<
|
3338
|
+
<xsl:copy-of select="$table-preamble"/>
|
3339
|
+
<fo:block>
|
3340
|
+
<xsl:call-template name="setTrackChangesStyles">
|
3341
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
3342
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
3343
|
+
</xsl:call-template>
|
3344
|
+
<xsl:copy-of select="$table"/>
|
3345
|
+
</fo:block>
|
2894
3346
|
</fo:table-cell>
|
2895
3347
|
</fo:table-row>
|
2896
3348
|
</fo:table-body>
|
@@ -2901,7 +3353,22 @@
|
|
2901
3353
|
|
2902
3354
|
</xsl:when>
|
2903
3355
|
<xsl:otherwise>
|
2904
|
-
<xsl:
|
3356
|
+
<xsl:choose>
|
3357
|
+
<xsl:when test="$isAdded = 'true' or $isDeleted = 'true'">
|
3358
|
+
<xsl:copy-of select="$table-preamble"/>
|
3359
|
+
<fo:block>
|
3360
|
+
<xsl:call-template name="setTrackChangesStyles">
|
3361
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
3362
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
3363
|
+
</xsl:call-template>
|
3364
|
+
<xsl:copy-of select="$table"/>
|
3365
|
+
</fo:block>
|
3366
|
+
</xsl:when>
|
3367
|
+
<xsl:otherwise>
|
3368
|
+
<xsl:copy-of select="$table-preamble"/>
|
3369
|
+
<xsl:copy-of select="$table"/>
|
3370
|
+
</xsl:otherwise>
|
3371
|
+
</xsl:choose>
|
2905
3372
|
</xsl:otherwise>
|
2906
3373
|
</xsl:choose>
|
2907
3374
|
|
@@ -2964,7 +3431,7 @@
|
|
2964
3431
|
</xsl:for-each>
|
2965
3432
|
</xsl:when>
|
2966
3433
|
<xsl:otherwise>
|
2967
|
-
<xsl:for-each select="xalan:nodeset($table)
|
3434
|
+
<xsl:for-each select="xalan:nodeset($table)/*/tr">
|
2968
3435
|
<xsl:variable name="td_text">
|
2969
3436
|
<xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
|
2970
3437
|
|
@@ -3034,7 +3501,15 @@
|
|
3034
3501
|
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
|
3035
3502
|
<xsl:value-of select="@target"/>
|
3036
3503
|
</xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
|
3037
|
-
<xsl:variable name="
|
3504
|
+
<xsl:variable name="mathml">
|
3505
|
+
<xsl:for-each select="*">
|
3506
|
+
<xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
|
3507
|
+
<xsl:copy-of select="."/>
|
3508
|
+
</xsl:if>
|
3509
|
+
</xsl:for-each>
|
3510
|
+
</xsl:variable>
|
3511
|
+
|
3512
|
+
<xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
|
3038
3513
|
<xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
|
3039
3514
|
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
|
3040
3515
|
<xsl:param name="cols-count"/>
|
@@ -3354,7 +3829,8 @@
|
|
3354
3829
|
<xsl:attribute name="text-align">
|
3355
3830
|
<xsl:choose>
|
3356
3831
|
<xsl:when test="@align">
|
3357
|
-
<xsl:
|
3832
|
+
<xsl:call-template name="setAlignment"/>
|
3833
|
+
<!-- <xsl:value-of select="@align"/> -->
|
3358
3834
|
</xsl:when>
|
3359
3835
|
<xsl:otherwise>center</xsl:otherwise>
|
3360
3836
|
</xsl:choose>
|
@@ -3372,6 +3848,9 @@
|
|
3372
3848
|
|
3373
3849
|
|
3374
3850
|
|
3851
|
+
<xsl:if test="$lang = 'ar'">
|
3852
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3853
|
+
</xsl:if>
|
3375
3854
|
<xsl:if test="@colspan">
|
3376
3855
|
<xsl:attribute name="number-columns-spanned">
|
3377
3856
|
<xsl:value-of select="@colspan"/>
|
@@ -3403,11 +3882,15 @@
|
|
3403
3882
|
<xsl:attribute name="text-align">
|
3404
3883
|
<xsl:choose>
|
3405
3884
|
<xsl:when test="@align">
|
3406
|
-
<xsl:
|
3885
|
+
<xsl:call-template name="setAlignment"/>
|
3886
|
+
<!-- <xsl:value-of select="@align"/> -->
|
3407
3887
|
</xsl:when>
|
3408
3888
|
<xsl:otherwise>left</xsl:otherwise>
|
3409
3889
|
</xsl:choose>
|
3410
3890
|
</xsl:attribute>
|
3891
|
+
<xsl:if test="$lang = 'ar'">
|
3892
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3893
|
+
</xsl:if>
|
3411
3894
|
<!-- and ancestor::*[local-name() = 'thead'] -->
|
3412
3895
|
<xsl:attribute name="padding-top">0.5mm</xsl:attribute>
|
3413
3896
|
|
@@ -3425,6 +3908,9 @@
|
|
3425
3908
|
|
3426
3909
|
|
3427
3910
|
|
3911
|
+
<xsl:if test=".//*[local-name() = 'table']">
|
3912
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3913
|
+
</xsl:if>
|
3428
3914
|
<xsl:if test="@colspan">
|
3429
3915
|
<xsl:attribute name="number-columns-spanned">
|
3430
3916
|
<xsl:value-of select="@colspan"/>
|
@@ -3558,13 +4044,13 @@
|
|
3558
4044
|
</xsl:choose>
|
3559
4045
|
</xsl:variable>
|
3560
4046
|
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
3561
|
-
<xsl:element name="{$ns}:table">
|
4047
|
+
<!-- <xsl:element name="{$ns}:table"> -->
|
3562
4048
|
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
3563
4049
|
<tbody>
|
3564
4050
|
<xsl:apply-templates mode="dl"/>
|
3565
4051
|
</tbody>
|
3566
4052
|
</xsl:for-each>
|
3567
|
-
</xsl:element>
|
4053
|
+
<!-- </xsl:element> -->
|
3568
4054
|
</xsl:variable>
|
3569
4055
|
|
3570
4056
|
<xsl:call-template name="calculate-column-widths">
|
@@ -3661,6 +4147,8 @@
|
|
3661
4147
|
<xsl:apply-templates/>
|
3662
4148
|
</fo:inline>
|
3663
4149
|
</xsl:template><xsl:template match="*[local-name()='dl']">
|
4150
|
+
<xsl:variable name="isAdded" select="@added"/>
|
4151
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
3664
4152
|
<fo:block-container>
|
3665
4153
|
|
3666
4154
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
@@ -3677,6 +4165,12 @@
|
|
3677
4165
|
</xsl:attribute>
|
3678
4166
|
|
3679
4167
|
</xsl:if>
|
4168
|
+
|
4169
|
+
<xsl:call-template name="setTrackChangesStyles">
|
4170
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
4171
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
4172
|
+
</xsl:call-template>
|
4173
|
+
|
3680
4174
|
<fo:block-container>
|
3681
4175
|
|
3682
4176
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
@@ -3798,11 +4292,11 @@
|
|
3798
4292
|
</xsl:choose>
|
3799
4293
|
</xsl:variable>
|
3800
4294
|
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
3801
|
-
<xsl:element name="{$ns}:table">
|
4295
|
+
<!-- <xsl:element name="{$ns}:table"> -->
|
3802
4296
|
<tbody>
|
3803
4297
|
<xsl:apply-templates mode="dl"/>
|
3804
4298
|
</tbody>
|
3805
|
-
</xsl:element>
|
4299
|
+
<!-- </xsl:element> -->
|
3806
4300
|
</xsl:variable>
|
3807
4301
|
<!-- html-table<xsl:copy-of select="$html-table"/> -->
|
3808
4302
|
<xsl:variable name="colwidths">
|
@@ -4071,8 +4565,78 @@
|
|
4071
4565
|
<fo:inline text-decoration="underline">
|
4072
4566
|
<xsl:apply-templates/>
|
4073
4567
|
</fo:inline>
|
4568
|
+
</xsl:template><xsl:template match="*[local-name()='add']">
|
4569
|
+
<xsl:choose>
|
4570
|
+
<xsl:when test="@amendment">
|
4571
|
+
<fo:inline>
|
4572
|
+
<xsl:call-template name="insertTag">
|
4573
|
+
<xsl:with-param name="kind">A</xsl:with-param>
|
4574
|
+
<xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
|
4575
|
+
</xsl:call-template>
|
4576
|
+
<xsl:apply-templates/>
|
4577
|
+
<xsl:call-template name="insertTag">
|
4578
|
+
<xsl:with-param name="type">closing</xsl:with-param>
|
4579
|
+
<xsl:with-param name="kind">A</xsl:with-param>
|
4580
|
+
<xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
|
4581
|
+
</xsl:call-template>
|
4582
|
+
</fo:inline>
|
4583
|
+
</xsl:when>
|
4584
|
+
<xsl:when test="@corrigenda">
|
4585
|
+
<fo:inline>
|
4586
|
+
<xsl:call-template name="insertTag">
|
4587
|
+
<xsl:with-param name="kind">C</xsl:with-param>
|
4588
|
+
<xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
|
4589
|
+
</xsl:call-template>
|
4590
|
+
<xsl:apply-templates/>
|
4591
|
+
<xsl:call-template name="insertTag">
|
4592
|
+
<xsl:with-param name="type">closing</xsl:with-param>
|
4593
|
+
<xsl:with-param name="kind">C</xsl:with-param>
|
4594
|
+
<xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
|
4595
|
+
</xsl:call-template>
|
4596
|
+
</fo:inline>
|
4597
|
+
</xsl:when>
|
4598
|
+
<xsl:otherwise>
|
4599
|
+
<fo:inline xsl:use-attribute-sets="add-style">
|
4600
|
+
<xsl:apply-templates/>
|
4601
|
+
</fo:inline>
|
4602
|
+
</xsl:otherwise>
|
4603
|
+
</xsl:choose>
|
4604
|
+
|
4605
|
+
</xsl:template><xsl:template name="insertTag">
|
4606
|
+
<xsl:param name="type"/>
|
4607
|
+
<xsl:param name="kind"/>
|
4608
|
+
<xsl:param name="value"/>
|
4609
|
+
<xsl:variable name="add_width" select="string-length($value) * 20"/>
|
4610
|
+
<xsl:variable name="maxwidth" select="60 + $add_width"/>
|
4611
|
+
<fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
|
4612
|
+
<!-- <xsl:attribute name="width">7mm</xsl:attribute>
|
4613
|
+
<xsl:attribute name="content-height">100%</xsl:attribute> -->
|
4614
|
+
<xsl:attribute name="height">5mm</xsl:attribute>
|
4615
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
4616
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
4617
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
4618
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
|
4619
|
+
<g>
|
4620
|
+
<xsl:if test="$type = 'closing'">
|
4621
|
+
<xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
|
4622
|
+
</xsl:if>
|
4623
|
+
<polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
|
4624
|
+
<line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
|
4625
|
+
</g>
|
4626
|
+
<text font-family="Arial" x="15" y="57" font-size="40pt">
|
4627
|
+
<xsl:if test="$type = 'closing'">
|
4628
|
+
<xsl:attribute name="x">25</xsl:attribute>
|
4629
|
+
</xsl:if>
|
4630
|
+
<xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
|
4631
|
+
</text>
|
4632
|
+
</svg>
|
4633
|
+
</fo:instream-foreign-object>
|
4074
4634
|
</xsl:template><xsl:template match="*[local-name()='del']">
|
4075
|
-
<fo:inline
|
4635
|
+
<fo:inline xsl:use-attribute-sets="del-style">
|
4636
|
+
<xsl:apply-templates/>
|
4637
|
+
</fo:inline>
|
4638
|
+
</xsl:template><xsl:template match="*[local-name()='hi']">
|
4639
|
+
<fo:inline background-color="yellow">
|
4076
4640
|
<xsl:apply-templates/>
|
4077
4641
|
</fo:inline>
|
4078
4642
|
</xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
|
@@ -4409,12 +4973,30 @@
|
|
4409
4973
|
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
|
4410
4974
|
<xsl:value-of select="substring($str, 2)"/>
|
4411
4975
|
</xsl:template><xsl:template match="mathml:math">
|
4412
|
-
<
|
4976
|
+
<xsl:variable name="isAdded" select="@added"/>
|
4977
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
4978
|
+
|
4979
|
+
<fo:inline xsl:use-attribute-sets="mathml-style">
|
4980
|
+
|
4981
|
+
|
4982
|
+
<xsl:call-template name="setTrackChangesStyles">
|
4983
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
4984
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
4985
|
+
</xsl:call-template>
|
4413
4986
|
|
4414
4987
|
<xsl:variable name="mathml">
|
4415
4988
|
<xsl:apply-templates select="." mode="mathml"/>
|
4416
4989
|
</xsl:variable>
|
4417
4990
|
<fo:instream-foreign-object fox:alt-text="Math">
|
4991
|
+
|
4992
|
+
|
4993
|
+
<xsl:if test="count(ancestor::*[local-name() = 'table']) > 1">
|
4994
|
+
<xsl:attribute name="width">95%</xsl:attribute>
|
4995
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
4996
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
4997
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
4998
|
+
</xsl:if>
|
4999
|
+
|
4418
5000
|
<!-- <xsl:copy-of select="."/> -->
|
4419
5001
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
4420
5002
|
</fo:instream-foreign-object>
|
@@ -4433,7 +5015,7 @@
|
|
4433
5015
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
4434
5016
|
</xsl:copy>
|
4435
5017
|
<mathml:mspace width="0.5ex"/>
|
4436
|
-
</xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
5018
|
+
</xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
4437
5019
|
<xsl:variable name="target">
|
4438
5020
|
<xsl:choose>
|
4439
5021
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
@@ -4467,8 +5049,6 @@
|
|
4467
5049
|
</xsl:otherwise>
|
4468
5050
|
</xsl:choose>
|
4469
5051
|
</fo:inline>
|
4470
|
-
</xsl:template><xsl:template match="*[local-name()='bookmark']">
|
4471
|
-
<fo:inline id="{@id}"/>
|
4472
5052
|
</xsl:template><xsl:template match="*[local-name()='appendix']">
|
4473
5053
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
4474
5054
|
<xsl:apply-templates select="*[local-name()='title']" mode="process"/>
|
@@ -4662,8 +5242,15 @@
|
|
4662
5242
|
</fo:inline>
|
4663
5243
|
</xsl:if>
|
4664
5244
|
</xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
|
5245
|
+
<xsl:variable name="isAdded" select="@added"/>
|
5246
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
4665
5247
|
<fo:block-container id="{@id}">
|
4666
5248
|
|
5249
|
+
<xsl:call-template name="setTrackChangesStyles">
|
5250
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
5251
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
5252
|
+
</xsl:call-template>
|
5253
|
+
|
4667
5254
|
<fo:block>
|
4668
5255
|
<xsl:apply-templates/>
|
4669
5256
|
</fo:block>
|
@@ -4677,27 +5264,113 @@
|
|
4677
5264
|
<fo:block id="{@id}">
|
4678
5265
|
<xsl:apply-templates/>
|
4679
5266
|
</fo:block>
|
5267
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
4680
5268
|
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
|
4681
5269
|
<fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
|
4682
5270
|
<xsl:apply-templates/>
|
4683
5271
|
</fo:block>
|
4684
5272
|
</xsl:template><xsl:template match="*[local-name() = 'image']">
|
4685
|
-
<
|
4686
|
-
|
4687
|
-
|
4688
|
-
<xsl:
|
4689
|
-
<
|
4690
|
-
<xsl:
|
4691
|
-
<xsl:
|
4692
|
-
</xsl:
|
4693
|
-
<
|
4694
|
-
|
4695
|
-
|
4696
|
-
|
4697
|
-
|
4698
|
-
|
4699
|
-
|
4700
|
-
|
5273
|
+
<xsl:variable name="isAdded" select="../@added"/>
|
5274
|
+
<xsl:variable name="isDeleted" select="../@deleted"/>
|
5275
|
+
<xsl:choose>
|
5276
|
+
<xsl:when test="ancestor::*[local-name() = 'title']">
|
5277
|
+
<fo:inline padding-left="1mm" padding-right="1mm">
|
5278
|
+
<xsl:variable name="src">
|
5279
|
+
<xsl:call-template name="image_src"/>
|
5280
|
+
</xsl:variable>
|
5281
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/>
|
5282
|
+
</fo:inline>
|
5283
|
+
</xsl:when>
|
5284
|
+
<xsl:otherwise>
|
5285
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
5286
|
+
|
5287
|
+
<xsl:variable name="src">
|
5288
|
+
<xsl:call-template name="image_src"/>
|
5289
|
+
</xsl:variable>
|
5290
|
+
|
5291
|
+
<xsl:choose>
|
5292
|
+
<xsl:when test="$isDeleted = 'true'">
|
5293
|
+
<!-- enclose in svg -->
|
5294
|
+
<fo:instream-foreign-object fox:alt-text="Image {@alt}">
|
5295
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
5296
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
5297
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5298
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5299
|
+
|
5300
|
+
|
5301
|
+
<xsl:apply-templates select="." mode="cross_image"/>
|
5302
|
+
|
5303
|
+
</fo:instream-foreign-object>
|
5304
|
+
</xsl:when>
|
5305
|
+
<xsl:otherwise>
|
5306
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
|
5307
|
+
</xsl:otherwise>
|
5308
|
+
</xsl:choose>
|
5309
|
+
|
5310
|
+
</fo:block>
|
5311
|
+
</xsl:otherwise>
|
5312
|
+
</xsl:choose>
|
5313
|
+
</xsl:template><xsl:template name="image_src">
|
5314
|
+
<xsl:choose>
|
5315
|
+
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
5316
|
+
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
5317
|
+
</xsl:when>
|
5318
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
5319
|
+
<xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
|
5320
|
+
</xsl:when>
|
5321
|
+
<xsl:otherwise>
|
5322
|
+
<xsl:value-of select="@src"/>
|
5323
|
+
</xsl:otherwise>
|
5324
|
+
</xsl:choose>
|
5325
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']" mode="cross_image">
|
5326
|
+
<xsl:choose>
|
5327
|
+
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
5328
|
+
<xsl:variable name="src">
|
5329
|
+
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
5330
|
+
</xsl:variable>
|
5331
|
+
<xsl:variable name="width" select="document($src)/@width"/>
|
5332
|
+
<xsl:variable name="height" select="document($src)/@height"/>
|
5333
|
+
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
|
5334
|
+
<image xlink:href="{$src}" style="overflow:visible;"/>
|
5335
|
+
</svg>
|
5336
|
+
</xsl:when>
|
5337
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
5338
|
+
<xsl:variable name="src">
|
5339
|
+
<xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
|
5340
|
+
</xsl:variable>
|
5341
|
+
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
|
5342
|
+
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
|
5343
|
+
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
|
5344
|
+
<xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
|
5345
|
+
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
|
5346
|
+
<image xlink:href="{$src}" style="overflow:visible;"/>
|
5347
|
+
</svg>
|
5348
|
+
</xsl:when>
|
5349
|
+
<xsl:otherwise>
|
5350
|
+
<xsl:variable name="base64String" select="substring-after(@src, 'base64,')"/>
|
5351
|
+
<xsl:variable name="decoder" select="java:java.util.Base64.getDecoder()"/>
|
5352
|
+
<xsl:variable name="fileContent" select="java:decode($decoder, $base64String)"/>
|
5353
|
+
<xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/>
|
5354
|
+
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/>
|
5355
|
+
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
|
5356
|
+
<!-- width=<xsl:value-of select="$width"/> -->
|
5357
|
+
<xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
|
5358
|
+
<!-- height=<xsl:value-of select="$height"/> -->
|
5359
|
+
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
|
5360
|
+
<image xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/>
|
5361
|
+
<xsl:call-template name="svg_cross">
|
5362
|
+
<xsl:with-param name="width" select="$width"/>
|
5363
|
+
<xsl:with-param name="height" select="$height"/>
|
5364
|
+
</xsl:call-template>
|
5365
|
+
</svg>
|
5366
|
+
</xsl:otherwise>
|
5367
|
+
</xsl:choose>
|
5368
|
+
|
5369
|
+
</xsl:template><xsl:template name="svg_cross">
|
5370
|
+
<xsl:param name="width"/>
|
5371
|
+
<xsl:param name="height"/>
|
5372
|
+
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="0" x2="{$width}" y2="{$height}" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
5373
|
+
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="{$height}" x2="{$width}" y2="0" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
4701
5374
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
|
4702
5375
|
<xsl:apply-templates mode="contents"/>
|
4703
5376
|
<xsl:text> </xsl:text>
|
@@ -5216,8 +5889,8 @@
|
|
5216
5889
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
5217
5890
|
|
5218
5891
|
<xsl:variable name="element">
|
5219
|
-
|
5220
|
-
|
5892
|
+
|
5893
|
+
inline
|
5221
5894
|
<xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
|
5222
5895
|
</xsl:variable>
|
5223
5896
|
|
@@ -5240,6 +5913,7 @@
|
|
5240
5913
|
<xsl:variable name="element">
|
5241
5914
|
|
5242
5915
|
inline
|
5916
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
|
5243
5917
|
</xsl:variable>
|
5244
5918
|
<xsl:choose>
|
5245
5919
|
<xsl:when test="ancestor::*[local-name() = 'appendix']">
|
@@ -5247,7 +5921,7 @@
|
|
5247
5921
|
<xsl:apply-templates/>
|
5248
5922
|
</fo:inline>
|
5249
5923
|
</xsl:when>
|
5250
|
-
<xsl:when test="normalize-space($element)
|
5924
|
+
<xsl:when test="contains(normalize-space($element), 'block')">
|
5251
5925
|
<fo:block xsl:use-attribute-sets="example-name-style">
|
5252
5926
|
<xsl:apply-templates/>
|
5253
5927
|
</fo:block>
|
@@ -5260,9 +5934,15 @@
|
|
5260
5934
|
</xsl:choose>
|
5261
5935
|
|
5262
5936
|
</xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
|
5263
|
-
|
5937
|
+
<xsl:variable name="num"><xsl:number/></xsl:variable>
|
5264
5938
|
<xsl:variable name="element">
|
5265
|
-
|
5939
|
+
|
5940
|
+
|
5941
|
+
<xsl:choose>
|
5942
|
+
<xsl:when test="$num = 1">inline</xsl:when>
|
5943
|
+
<xsl:otherwise>block</xsl:otherwise>
|
5944
|
+
</xsl:choose>
|
5945
|
+
|
5266
5946
|
|
5267
5947
|
</xsl:variable>
|
5268
5948
|
<xsl:choose>
|
@@ -5367,29 +6047,47 @@
|
|
5367
6047
|
<xsl:text>— </xsl:text>
|
5368
6048
|
<xsl:apply-templates/>
|
5369
6049
|
</xsl:template><xsl:template match="*[local-name() = 'eref']">
|
5370
|
-
|
5371
|
-
|
5372
|
-
|
5373
|
-
|
5374
|
-
|
5375
|
-
|
5376
|
-
|
5377
|
-
|
5378
|
-
|
5379
|
-
|
5380
|
-
|
5381
|
-
|
5382
|
-
|
5383
|
-
|
5384
|
-
|
5385
|
-
|
5386
|
-
|
5387
|
-
|
5388
|
-
|
5389
|
-
|
5390
|
-
|
5391
|
-
|
5392
|
-
|
6050
|
+
|
6051
|
+
<xsl:variable name="bibitemid">
|
6052
|
+
<xsl:choose>
|
6053
|
+
<xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
|
6054
|
+
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
|
6055
|
+
<xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
|
6056
|
+
</xsl:choose>
|
6057
|
+
</xsl:variable>
|
6058
|
+
|
6059
|
+
<xsl:choose>
|
6060
|
+
<xsl:when test="normalize-space($bibitemid) != ''">
|
6061
|
+
<fo:inline xsl:use-attribute-sets="eref-style">
|
6062
|
+
<xsl:if test="@type = 'footnote'">
|
6063
|
+
|
6064
|
+
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
6065
|
+
<xsl:attribute name="font-size">80%</xsl:attribute>
|
6066
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
6067
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
6068
|
+
|
6069
|
+
|
6070
|
+
</xsl:if>
|
6071
|
+
|
6072
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
6073
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
6074
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
6075
|
+
</xsl:if>
|
6076
|
+
<xsl:if test="@type = 'inline'">
|
6077
|
+
|
6078
|
+
|
6079
|
+
|
6080
|
+
</xsl:if>
|
6081
|
+
|
6082
|
+
<xsl:apply-templates/>
|
6083
|
+
</fo:basic-link>
|
6084
|
+
|
6085
|
+
</fo:inline>
|
6086
|
+
</xsl:when>
|
6087
|
+
<xsl:otherwise>
|
6088
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
6089
|
+
</xsl:otherwise>
|
6090
|
+
</xsl:choose>
|
5393
6091
|
</xsl:template><xsl:template match="*[local-name() = 'tab']">
|
5394
6092
|
<!-- zero-space char -->
|
5395
6093
|
<xsl:variable name="depth">
|
@@ -5447,7 +6145,8 @@
|
|
5447
6145
|
</fo:inline>
|
5448
6146
|
</xsl:when>
|
5449
6147
|
<xsl:otherwise>
|
5450
|
-
<
|
6148
|
+
<xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
|
6149
|
+
<fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/></fo:inline>
|
5451
6150
|
</xsl:otherwise>
|
5452
6151
|
</xsl:choose>
|
5453
6152
|
|
@@ -5572,6 +6271,153 @@
|
|
5572
6271
|
</fo:block>
|
5573
6272
|
</xsl:otherwise>
|
5574
6273
|
</xsl:choose>
|
6274
|
+
</xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
|
6275
|
+
<xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
|
6276
|
+
<bookmark><xsl:value-of select="@id"/></bookmark>
|
6277
|
+
</xsl:for-each>
|
6278
|
+
</xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
|
6279
|
+
<xsl:copy>
|
6280
|
+
<xsl:apply-templates select="@*|node()" mode="index_add_id"/>
|
6281
|
+
</xsl:copy>
|
6282
|
+
</xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
|
6283
|
+
<xsl:variable name="id">
|
6284
|
+
<xsl:call-template name="generateIndexXrefId"/>
|
6285
|
+
</xsl:variable>
|
6286
|
+
<xsl:copy> <!-- add id to xref -->
|
6287
|
+
<xsl:apply-templates select="@*" mode="index_add_id"/>
|
6288
|
+
<xsl:attribute name="id">
|
6289
|
+
<xsl:value-of select="$id"/>
|
6290
|
+
</xsl:attribute>
|
6291
|
+
<xsl:apply-templates mode="index_add_id"/>
|
6292
|
+
</xsl:copy>
|
6293
|
+
<!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
|
6294
|
+
<xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
|
6295
|
+
<xsl:if test="@to">
|
6296
|
+
<xsl:value-of select="$dash"/>
|
6297
|
+
<xsl:copy>
|
6298
|
+
<xsl:copy-of select="@*"/>
|
6299
|
+
<xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
|
6300
|
+
<xsl:attribute name="id">
|
6301
|
+
<xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
|
6302
|
+
</xsl:attribute>
|
6303
|
+
<xsl:apply-templates mode="index_add_id"/>
|
6304
|
+
</xsl:copy>
|
6305
|
+
</xsl:if>
|
6306
|
+
</xsl:template><xsl:template match="@*|node()" mode="index_update">
|
6307
|
+
<xsl:copy>
|
6308
|
+
<xsl:apply-templates select="@*|node()" mode="index_update"/>
|
6309
|
+
</xsl:copy>
|
6310
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
|
6311
|
+
<xsl:copy>
|
6312
|
+
<xsl:apply-templates select="@*" mode="index_update"/>
|
6313
|
+
<xsl:apply-templates select="node()[1]" mode="process_li_element"/>
|
6314
|
+
</xsl:copy>
|
6315
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
|
6316
|
+
<xsl:param name="element"/>
|
6317
|
+
<xsl:param name="remove" select="'false'"/>
|
6318
|
+
<xsl:param name="target"/>
|
6319
|
+
<!-- <node></node> -->
|
6320
|
+
<xsl:choose>
|
6321
|
+
<xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
|
6322
|
+
<!-- skip text (i.e. remove it) and process next element -->
|
6323
|
+
<!-- [removed_<xsl:value-of select="."/>] -->
|
6324
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
6325
|
+
<xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
|
6326
|
+
</xsl:apply-templates>
|
6327
|
+
</xsl:when>
|
6328
|
+
<xsl:when test="self::text()">
|
6329
|
+
<xsl:value-of select="."/>
|
6330
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
6331
|
+
</xsl:when>
|
6332
|
+
<xsl:when test="self::* and local-name(.) = 'xref'">
|
6333
|
+
<xsl:variable name="id" select="@id"/>
|
6334
|
+
<xsl:variable name="page" select="$index//item[@id = $id]"/>
|
6335
|
+
<xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
|
6336
|
+
<xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
|
6337
|
+
|
6338
|
+
<xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
|
6339
|
+
<xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
|
6340
|
+
|
6341
|
+
<xsl:choose>
|
6342
|
+
<!-- 2nd pass -->
|
6343
|
+
<!-- if page is equal to page for next and page is not the end of range -->
|
6344
|
+
<xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
|
6345
|
+
<!-- skip element (i.e. remove it) and remove next text ',' -->
|
6346
|
+
<!-- [removed_xref] -->
|
6347
|
+
|
6348
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
6349
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
6350
|
+
<xsl:with-param name="target">
|
6351
|
+
<xsl:choose>
|
6352
|
+
<xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
|
6353
|
+
<xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
|
6354
|
+
</xsl:choose>
|
6355
|
+
</xsl:with-param>
|
6356
|
+
</xsl:apply-templates>
|
6357
|
+
</xsl:when>
|
6358
|
+
|
6359
|
+
<xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
|
6360
|
+
<!-- remove xref -->
|
6361
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
6362
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
6363
|
+
</xsl:apply-templates>
|
6364
|
+
</xsl:when>
|
6365
|
+
|
6366
|
+
<xsl:otherwise>
|
6367
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
6368
|
+
<xsl:with-param name="target" select="$target"/>
|
6369
|
+
</xsl:apply-templates>
|
6370
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
6371
|
+
</xsl:otherwise>
|
6372
|
+
</xsl:choose>
|
6373
|
+
</xsl:when>
|
6374
|
+
<xsl:when test="self::* and local-name(.) = 'ul'">
|
6375
|
+
<!-- ul -->
|
6376
|
+
<xsl:apply-templates select="." mode="index_update"/>
|
6377
|
+
</xsl:when>
|
6378
|
+
<xsl:otherwise>
|
6379
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
6380
|
+
<xsl:with-param name="target" select="$target"/>
|
6381
|
+
</xsl:apply-templates>
|
6382
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
6383
|
+
</xsl:otherwise>
|
6384
|
+
</xsl:choose>
|
6385
|
+
</xsl:template><xsl:template match="@*|node()" mode="xref_copy">
|
6386
|
+
<xsl:param name="target"/>
|
6387
|
+
<xsl:copy>
|
6388
|
+
<xsl:apply-templates select="@*" mode="xref_copy"/>
|
6389
|
+
<xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
|
6390
|
+
<xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
|
6391
|
+
</xsl:if>
|
6392
|
+
<xsl:apply-templates select="node()" mode="xref_copy"/>
|
6393
|
+
</xsl:copy>
|
6394
|
+
</xsl:template><xsl:template name="generateIndexXrefId">
|
6395
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
6396
|
+
|
6397
|
+
<xsl:variable name="docid">
|
6398
|
+
<xsl:call-template name="getDocumentId"/>
|
6399
|
+
</xsl:variable>
|
6400
|
+
<xsl:variable name="item_number">
|
6401
|
+
<xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
|
6402
|
+
</xsl:variable>
|
6403
|
+
<xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
|
6404
|
+
<xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
|
6405
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
|
6406
|
+
<xsl:apply-templates/>
|
6407
|
+
<fo:block>
|
6408
|
+
<xsl:if test="following-sibling::*[local-name() = 'clause']">
|
6409
|
+
<fo:block> </fo:block>
|
6410
|
+
</xsl:if>
|
6411
|
+
</fo:block>
|
6412
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
|
6413
|
+
<xsl:apply-templates/>
|
6414
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
|
6415
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
6416
|
+
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
6417
|
+
<xsl:apply-templates/>
|
6418
|
+
</fo:block>
|
6419
|
+
</xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
6420
|
+
<fo:inline id="{@id}" font-size="1pt"/>
|
5575
6421
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
5576
6422
|
<!-- <row>
|
5577
6423
|
<date>05-07-2013</date>
|
@@ -5788,70 +6634,68 @@
|
|
5788
6634
|
<xsl:variable name="lang">
|
5789
6635
|
<xsl:call-template name="getLang"/>
|
5790
6636
|
</xsl:variable>
|
5791
|
-
<
|
5792
|
-
|
5793
|
-
<pdf:
|
5794
|
-
|
5795
|
-
|
5796
|
-
|
5797
|
-
<
|
5798
|
-
<rdf:
|
5799
|
-
|
5800
|
-
|
5801
|
-
<
|
5802
|
-
<xsl:variable name="title">
|
5803
|
-
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
5804
|
-
|
5805
|
-
<xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
|
5806
|
-
|
5807
|
-
|
5808
|
-
|
5809
|
-
|
5810
|
-
|
5811
|
-
|
5812
|
-
</xsl:for-each>
|
5813
|
-
</xsl:variable>
|
5814
|
-
<xsl:choose>
|
5815
|
-
<xsl:when test="normalize-space($title) != ''">
|
5816
|
-
<xsl:value-of select="$title"/>
|
5817
|
-
</xsl:when>
|
5818
|
-
<xsl:otherwise>
|
5819
|
-
<xsl:text> </xsl:text>
|
5820
|
-
</xsl:otherwise>
|
5821
|
-
</xsl:choose>
|
5822
|
-
</dc:title>
|
5823
|
-
<dc:creator>
|
6637
|
+
<pdf:catalog>
|
6638
|
+
<pdf:dictionary type="normal" key="ViewerPreferences">
|
6639
|
+
<pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
|
6640
|
+
</pdf:dictionary>
|
6641
|
+
</pdf:catalog>
|
6642
|
+
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
6643
|
+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
6644
|
+
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
6645
|
+
<!-- Dublin Core properties go here -->
|
6646
|
+
<dc:title>
|
6647
|
+
<xsl:variable name="title">
|
5824
6648
|
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
5825
6649
|
|
5826
|
-
<xsl:
|
5827
|
-
<xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
|
5828
|
-
<xsl:if test="position() != last()">; </xsl:if>
|
5829
|
-
</xsl:for-each>
|
6650
|
+
<xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
|
5830
6651
|
|
5831
6652
|
|
5832
6653
|
|
5833
|
-
</xsl:for-each>
|
5834
|
-
</dc:creator>
|
5835
|
-
<dc:description>
|
5836
|
-
<xsl:variable name="abstract">
|
5837
6654
|
|
5838
|
-
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
|
5839
6655
|
|
5840
|
-
|
5841
|
-
</xsl:
|
5842
|
-
|
5843
|
-
|
5844
|
-
|
5845
|
-
|
5846
|
-
|
5847
|
-
|
5848
|
-
|
5849
|
-
|
5850
|
-
|
5851
|
-
</
|
5852
|
-
|
5853
|
-
|
5854
|
-
|
6656
|
+
|
6657
|
+
</xsl:for-each>
|
6658
|
+
</xsl:variable>
|
6659
|
+
<xsl:choose>
|
6660
|
+
<xsl:when test="normalize-space($title) != ''">
|
6661
|
+
<xsl:value-of select="$title"/>
|
6662
|
+
</xsl:when>
|
6663
|
+
<xsl:otherwise>
|
6664
|
+
<xsl:text> </xsl:text>
|
6665
|
+
</xsl:otherwise>
|
6666
|
+
</xsl:choose>
|
6667
|
+
</dc:title>
|
6668
|
+
<dc:creator>
|
6669
|
+
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
6670
|
+
|
6671
|
+
<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
6672
|
+
<xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
|
6673
|
+
<xsl:if test="position() != last()">; </xsl:if>
|
6674
|
+
</xsl:for-each>
|
6675
|
+
|
6676
|
+
|
6677
|
+
|
6678
|
+
</xsl:for-each>
|
6679
|
+
</dc:creator>
|
6680
|
+
<dc:description>
|
6681
|
+
<xsl:variable name="abstract">
|
6682
|
+
|
6683
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
|
6684
|
+
|
6685
|
+
|
6686
|
+
</xsl:variable>
|
6687
|
+
<xsl:value-of select="normalize-space($abstract)"/>
|
6688
|
+
</dc:description>
|
6689
|
+
<pdf:Keywords>
|
6690
|
+
<xsl:call-template name="insertKeywords"/>
|
6691
|
+
</pdf:Keywords>
|
6692
|
+
</rdf:Description>
|
6693
|
+
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
|
6694
|
+
<!-- XMP properties go here -->
|
6695
|
+
<xmp:CreatorTool/>
|
6696
|
+
</rdf:Description>
|
6697
|
+
</rdf:RDF>
|
6698
|
+
</x:xmpmeta>
|
5855
6699
|
</xsl:template><xsl:template name="getId">
|
5856
6700
|
<xsl:choose>
|
5857
6701
|
<xsl:when test="../@id">
|
@@ -6015,4 +6859,44 @@
|
|
6015
6859
|
<xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
|
6016
6860
|
</xsl:choose>
|
6017
6861
|
|
6862
|
+
</xsl:template><xsl:template name="setTrackChangesStyles">
|
6863
|
+
<xsl:param name="isAdded"/>
|
6864
|
+
<xsl:param name="isDeleted"/>
|
6865
|
+
<xsl:choose>
|
6866
|
+
<xsl:when test="local-name() = 'math'">
|
6867
|
+
<xsl:if test="$isAdded = 'true'">
|
6868
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
|
6869
|
+
</xsl:if>
|
6870
|
+
<xsl:if test="$isDeleted = 'true'">
|
6871
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
|
6872
|
+
</xsl:if>
|
6873
|
+
</xsl:when>
|
6874
|
+
<xsl:otherwise>
|
6875
|
+
<xsl:if test="$isAdded = 'true'">
|
6876
|
+
<xsl:attribute name="border"><xsl:value-of select="$border-block-added"/></xsl:attribute>
|
6877
|
+
<xsl:attribute name="padding">2mm</xsl:attribute>
|
6878
|
+
</xsl:if>
|
6879
|
+
<xsl:if test="$isDeleted = 'true'">
|
6880
|
+
<xsl:attribute name="border"><xsl:value-of select="$border-block-deleted"/></xsl:attribute>
|
6881
|
+
<xsl:if test="local-name() = 'table'">
|
6882
|
+
<xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute>
|
6883
|
+
</xsl:if>
|
6884
|
+
<!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> -->
|
6885
|
+
<xsl:attribute name="padding">2mm</xsl:attribute>
|
6886
|
+
</xsl:if>
|
6887
|
+
</xsl:otherwise>
|
6888
|
+
</xsl:choose>
|
6889
|
+
</xsl:template><xsl:variable name="LRM" select="''"/><xsl:variable name="RLM" select="''"/><xsl:template name="setWritingMode">
|
6890
|
+
<xsl:if test="$lang = 'ar'">
|
6891
|
+
<xsl:attribute name="writing-mode">rl-tb</xsl:attribute>
|
6892
|
+
</xsl:if>
|
6893
|
+
</xsl:template><xsl:template name="setAlignment">
|
6894
|
+
<xsl:param name="align" select="normalize-space(@align)"/>
|
6895
|
+
<xsl:choose>
|
6896
|
+
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
6897
|
+
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
6898
|
+
<xsl:when test="$align != ''">
|
6899
|
+
<xsl:value-of select="$align"/>
|
6900
|
+
</xsl:when>
|
6901
|
+
</xsl:choose>
|
6018
6902
|
</xsl:template></xsl:stylesheet>
|