metanorma-itu 2.2.15 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab77aa6538e716fad3b632f16f92ab28b0149ec8252e57fa598a5cab87c4030e
4
- data.tar.gz: ed77a2cfe1cad5fd1a92ff1c5c8cfa0e9dd3586f84e6c62775f9229aa2cbc0e8
3
+ metadata.gz: dd7cb2a16590fe04f51e162637b7fc1be2b6e7b403d04118e8c82b2ad0e4eb66
4
+ data.tar.gz: 35a5dd96771972460f80fc0f0a83f4c6610b59bd659b08c771b89405ca719e62
5
5
  SHA512:
6
- metadata.gz: a37ca832fec8d03e30eb7a2f92553efd07d5e2d922c849591588c9e587dc0641b85395aa5a5addbe2d94ab41360102170e6e8c6a8fb5fb1131730eb271a081bb
7
- data.tar.gz: 0be40a2c8f7cd9aaf507df6cfc0e03bbc0433503925ef91a099c8ff76a39c88f1e567b675ea273704588757e6ce6c2dd3edd2b425ad7c5cd2a23c211d0e7aaac
6
+ metadata.gz: 78896c795984c2999c194e6cb21546880ed1df41cbabe7082f773d5086c1f354f5d342eec07f7ae697dd21ab9848aee3b035d4047db3af3c1c4efc9296ccf10f
7
+ data.tar.gz: 53894e2251b8a69d8c4ff9c37789b600b18907c8a718ac9a5dde34e351e4e36b7b27c1ae40b3808bc885dfa7d1b7cf458d2e3a0ca43474a9ec341bd07760cae8
@@ -1,9 +1,9 @@
1
1
  require "isodoc"
2
2
  require "fileutils"
3
- require_relative "./ref"
4
- require_relative "./xref"
5
- require_relative "./terms"
6
- require_relative "./cleanup"
3
+ require_relative "ref"
4
+ require_relative "xref"
5
+ require_relative "terms"
6
+ require_relative "cleanup"
7
7
 
8
8
  module IsoDoc
9
9
  module ITU
@@ -61,7 +61,6 @@ module IsoDoc
61
61
  end
62
62
 
63
63
  def annex_name(annex, name, div)
64
- # preceding_floating_titles(name, div)
65
64
  r_a = @meta.get[:doctype_original] == "recommendation-annex"
66
65
  div.h1 class: r_a ? "RecommendationAnnex" : "Annex" do |t|
67
66
  name&.children&.each { |c2| parse(c2, t) }
@@ -74,24 +73,22 @@ module IsoDoc
74
73
  info = annex["obligation"] == "informative"
75
74
  div.p class: "annex_obligation" do |p|
76
75
  p << (info ? @i18n.inform_annex : @i18n.norm_annex)
77
- .sub(/%/, @meta.get[:doctype] || "")
76
+ .sub("%", @meta.get[:doctype] || "")
78
77
  end
79
78
  end
80
79
 
81
- def annex(isoxml, out)
82
- isoxml.xpath(ns("//annex")).each do |c|
80
+ def annex(node, out)
83
81
  @meta.get[:doctype_original] == "recommendation-annex" or
84
82
  page_break(out)
85
- out.div **attr_code(id: c["id"], class: "Section3") do |s|
86
- annex_name(c, nil, s) unless c.at(ns("./title"))
87
- c.elements.each do |c1|
88
- if c1.name == "title" then annex_name(c, c1, s)
83
+ out.div **attr_code(id: node["id"], class: "Section3") do |s|
84
+ annex_name(node, nil, s) unless node.at(ns("./title"))
85
+ node.elements.each do |c1|
86
+ if c1.name == "title" then annex_name(node, c1, s)
89
87
  else
90
88
  parse(c1, s)
91
89
  end
92
90
  end
93
91
  end
94
- end
95
92
  end
96
93
 
97
94
  def info(isoxml, out)
@@ -100,54 +97,6 @@ module IsoDoc
100
97
  super
101
98
  end
102
99
 
103
- def middle_title(isoxml, out)
104
- if @meta.get[:doctype] == "Resolution"
105
- middle_title_resolution(isoxml, out)
106
- else
107
- middle_title_recommendation(isoxml, out)
108
- end
109
- end
110
-
111
- def middle_title_resolution(isoxml, out)
112
- res = isoxml.at(ns("//bibdata/title[@type = 'resolution']"))
113
- out.p(align: "center", style: "text-align:center;") do |p|
114
- res.children.each { |n| parse(n, p) }
115
- end
116
- out.p(class: "zzSTDTitle2") { |p| p << @meta.get[:doctitle] }
117
- middle_title_resolution_subtitle(isoxml, out)
118
- end
119
-
120
- def middle_title_resolution_subtitle(isoxml, out)
121
- out.p(align: "center", style: "text-align:center;") do |p|
122
- p.i do |i|
123
- i << "("
124
- isoxml.at(ns("//bibdata/title[@type = 'resolution-placedate']"))
125
- .children.each { |n| parse(n, i) }
126
- i << ")"
127
- end
128
- isoxml.xpath(ns("//note[@type = 'title-footnote']")).each do |f|
129
- footnote_parse(f, p)
130
- end
131
- end
132
- end
133
-
134
- def middle_title_recommendation(isoxml, out)
135
- out.p(class: "zzSTDTitle1") do |p|
136
- type = @meta.get[:doctype]
137
- @meta.get[:unpublished] && @meta.get[:draft_new_doctype] and
138
- type = @meta.get[:draft_new_doctype]
139
- id = @meta.get[:docnumber] and p << "#{type} #{id}"
140
- end
141
- out.p(class: "zzSTDTitle2") do |p|
142
- p << @meta.get[:doctitle]
143
- isoxml.xpath(ns("//note[@type = 'title-footnote']")).each do |f|
144
- footnote_parse(f, p)
145
- end
146
- end
147
- s = @meta.get[:docsubtitle] and
148
- out.p(class: "zzSTDTitle3") { |p| p << s }
149
- end
150
-
151
100
  def note_p_parse(node, div)
152
101
  name = node&.at(ns("./name"))&.remove
153
102
  div.p do |p|
@@ -180,14 +129,15 @@ module IsoDoc
180
129
  super
181
130
  end
182
131
 
183
- # can have supertitle in resolution
184
- def clause(isoxml, out)
185
- isoxml.xpath(ns(middle_clause(isoxml))).each do |c|
186
- clause_core(c, out)
132
+ def clause_attrs(node)
133
+ if node["type"] == "keyword"
134
+ super.merge(class: "Keyword")
135
+ else super
187
136
  end
188
137
  end
189
138
 
190
- def clause_core(clause, out)
139
+ # can have supertitle in resolution
140
+ def clause(clause, out)
191
141
  out.div **attr_code(clause_attrs(clause)) do |s|
192
142
  clause.elements.each do |c1|
193
143
  if c1.name == "title" then clause_name(clause, c1, s, nil)
@@ -198,6 +148,7 @@ module IsoDoc
198
148
  end
199
149
  end
200
150
 
151
+ =begin
201
152
  def scope(isoxml, out, num)
202
153
  return super unless @meta.get[:doctype_original] == "resolution"
203
154
 
@@ -205,6 +156,7 @@ module IsoDoc
205
156
  clause_core(f, out)
206
157
  num + 1
207
158
  end
159
+ =end
208
160
  end
209
161
  end
210
162
  end
@@ -57,16 +57,6 @@ module IsoDoc
57
57
  end
58
58
  end
59
59
 
60
- def make_body3(body, docxml)
61
- body.div **{ class: "main-section" } do |div3|
62
- boilerplate docxml, div3
63
- front docxml, div3
64
- middle docxml, div3
65
- footnotes div3
66
- comments div3
67
- end
68
- end
69
-
70
60
  def authority_cleanup(docxml)
71
61
  dest = docxml.at("//div[@id = 'draft-warning-destination']")
72
62
  auth = docxml.at("//div[@id = 'draft-warning']")
@@ -74,6 +64,11 @@ module IsoDoc
74
64
  super
75
65
  end
76
66
 
67
+ def clause(node, out)
68
+ node["type"] == "keyword" and return
69
+ super
70
+ end
71
+
77
72
  include BaseConvert
78
73
  include Init
79
74
  end
@@ -20,6 +20,7 @@ clause: فقرة
20
20
  section: قسم
21
21
  summary: ملخص
22
22
  annex_subclause: فقرة
23
+ keywords: الكلمات الدالة
23
24
  in: في
24
25
  to: إلى
25
26
  where: ":حيث,"
@@ -19,6 +19,7 @@ clause: Klausel
19
19
  section: Abschnitt
20
20
  summary: Zusammenfassung
21
21
  annex_subclause: Klausel
22
+ keywords: Schlüsselwörter
22
23
  in: in
23
24
  to: bis
24
25
  where: "wobei:"
@@ -20,6 +20,7 @@ inequality: Inequality
20
20
  clause: clause
21
21
  section: Section
22
22
  annex_subclause: clause
23
+ keywords: Keywords
23
24
  in: in
24
25
  to: to
25
26
  where: "where:"
@@ -20,6 +20,7 @@ inequality: Inecuación
20
20
  clause: cláusula
21
21
  section: Sección
22
22
  annex_subclause: cláusula
23
+ keywords: Palabras clave
23
24
  in: en
24
25
  to: a
25
26
  where: "donde:"
@@ -20,6 +20,7 @@ inequality: Inégalité
20
20
  clause: article
21
21
  section: Section
22
22
  annex_subclause: article
23
+ keywords: Mots clés
23
24
  in: dans
24
25
  to: à
25
26
  where: "où:"
@@ -20,6 +20,7 @@ inequality: Неравенство
20
20
  clause: пункт
21
21
  section: Раздел
22
22
  annex_subclause: пункт
23
+ keywords: Ключевые слова
23
24
  in: в
24
25
  to: до
25
26
  where: "где:"
@@ -20,6 +20,7 @@ inequality: 不等式
20
20
  clause: 条款
21
21
  section: 节
22
22
  annex_subclause: 条款
23
+ keywords: 关键词
23
24
  in: in
24
25
  to: to
25
26
  where: 式中:
@@ -34,17 +34,19 @@
34
34
  <xsl:variable name="contents_">
35
35
  <contents>
36
36
  <!-- <xsl:apply-templates select="/itu:itu-standard/itu:preface/node()" mode="contents"/> -->
37
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']" mode="contents"/> <!-- @id = 'scope' -->
37
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']" mode="contents" /> -->
38
38
 
39
39
  <!-- Normative references -->
40
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']" mode="contents"/> <!-- @id = 'references' -->
41
-
42
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]" mode="contents"/> <!-- @id != 'scope' -->
43
-
44
- <xsl:apply-templates select="/itu:itu-standard/itu:annex" mode="contents"/>
40
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']" mode="contents" />
41
+
42
+ <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]" mode="contents" />
43
+
44
+ <xsl:apply-templates select="/itu:itu-standard/itu:annex" mode="contents"/> -->
45
45
 
46
46
  <!-- Bibliography -->
47
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]" mode="contents"/> <!-- @id = 'bibliography' -->
47
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]" mode="contents"/> -->
48
+
49
+ <xsl:call-template name="processMainSectionsDefault_Contents"/>
48
50
 
49
51
  <xsl:apply-templates select="//itu:table" mode="contents"/>
50
52
 
@@ -1069,16 +1071,16 @@
1069
1071
 
1070
1072
  <fo:flow flow-name="xsl-region-body">
1071
1073
 
1072
- <xsl:if test="$doctype != 'service-publication'">
1073
- <fo:block-container font-size="14pt">
1074
+ <!-- <xsl:if test="$doctype != 'service-publication' and 1 = 2">
1075
+ <fo:block-container font-size="14pt" >
1074
1076
  <xsl:choose>
1075
1077
  <xsl:when test="$doctype = 'resolution'">
1076
1078
  <fo:block text-align="center">
1077
1079
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type='resolution' and @language = $lang]"/>
1078
1080
  </fo:block>
1079
1081
  </xsl:when>
1080
- <xsl:when test="$doctype = 'implementers-guide'"/>
1081
- <xsl:when test="$doctype = 'recommendation-supplement'">
1082
+ <xsl:when test="$doctype = 'implementers-guide'"></xsl:when>
1083
+ <xsl:when test="$doctype = 'recommendation-supplement'">
1082
1084
  <fo:block font-weight="bold">
1083
1085
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU-Supplement-Internal']"/>
1084
1086
  </fo:block>
@@ -1086,30 +1088,30 @@
1086
1088
  <xsl:otherwise>
1087
1089
  <fo:block font-weight="bold">
1088
1090
  <xsl:value-of select="$doctypeTitle"/>
1089
- <xsl:text> </xsl:text>
1091
+ <xsl:text>&#xA0;</xsl:text>
1090
1092
  <xsl:value-of select="$docname"/>
1091
1093
  </fo:block>
1092
1094
  </xsl:otherwise>
1093
1095
  </xsl:choose>
1094
-
1096
+
1095
1097
  <fo:block font-weight="bold" text-align="center" margin-top="15pt" margin-bottom="15pt" role="H1">
1096
1098
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'main' and @language = $lang]"/>
1097
-
1099
+
1098
1100
  <xsl:variable name="subtitle" select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'subtitle' and @language = $lang]"/>
1099
1101
  <xsl:if test="$subtitle != ''">
1100
1102
  <fo:block margin-top="18pt" font-weight="normal" font-style="italic">
1101
- <xsl:if test="$lang = 'ar'"> <!-- to prevent rendering `###` due the missing Arabic glyphs in the italic font (Times New Roman) -->
1103
+ <xsl:if test="$lang = 'ar'">
1102
1104
  <xsl:attribute name="font-style">normal</xsl:attribute>
1103
1105
  </xsl:if>
1104
1106
  <xsl:value-of select="$subtitle"/>
1105
- </fo:block>
1107
+ </fo:block>
1106
1108
  </xsl:if>
1107
-
1109
+
1108
1110
  <xsl:variable name="resolution-placedate" select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'resolution-placedate' and @language = $lang]"/>
1109
1111
  <xsl:if test="$doctype = 'resolution' and $resolution-placedate != ''">
1110
1112
  <fo:block font-size="11pt" margin-top="6pt" font-weight="normal">
1111
1113
  <fo:inline font-style="italic">
1112
- <xsl:if test="$lang = 'ar'"> <!-- to prevent rendering `###` due the missing Arabic glyphs in the italic font (Times New Roman) -->
1114
+ <xsl:if test="$lang = 'ar'">
1113
1115
  <xsl:attribute name="font-style">normal</xsl:attribute>
1114
1116
  </xsl:if>
1115
1117
  <xsl:text>(</xsl:text><xsl:value-of select="$resolution-placedate"/><xsl:text>)</xsl:text>
@@ -1119,22 +1121,25 @@
1119
1121
  </xsl:if>
1120
1122
  </fo:block>
1121
1123
  </fo:block-container>
1122
- </xsl:if>
1124
+ </xsl:if> -->
1123
1125
 
1124
1126
  <!-- Clause(s) -->
1125
1127
  <fo:block>
1126
1128
  <!-- Scope -->
1127
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']"/> <!-- @id = 'scope' -->
1129
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']" /> -->
1128
1130
 
1129
1131
  <!-- Normative references -->
1130
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']"/> <!-- @id = 'references' -->
1132
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']" />
1133
+
1134
+ <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]" />
1135
+
1136
+ <xsl:apply-templates select="/itu:itu-standard/itu:annex"/> -->
1131
1137
 
1132
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]"/> <!-- @id != 'scope' -->
1138
+ <!-- Bibliography -->
1139
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]"/> -->
1133
1140
 
1134
- <xsl:apply-templates select="/itu:itu-standard/itu:annex"/>
1141
+ <xsl:call-template name="processMainSectionsDefault"/>
1135
1142
 
1136
- <!-- Bibliography -->
1137
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]"/> <!-- @id = 'bibliography' -->
1138
1143
  </fo:block>
1139
1144
 
1140
1145
  </fo:flow>
@@ -1286,6 +1291,37 @@
1286
1291
  </fo:block>
1287
1292
  </xsl:template>
1288
1293
 
1294
+ <xsl:template match="itu:clause[@type = 'keyword']" priority="4"/>
1295
+
1296
+ <xsl:template match="itu:sections/itu:p[@class = 'zzSTDTitle1']" priority="4">
1297
+ <fo:block font-size="14pt">
1298
+ <xsl:choose>
1299
+ <xsl:when test="$doctype = 'resolution'">
1300
+ <xsl:attribute name="text-align">center</xsl:attribute>
1301
+ </xsl:when>
1302
+ <xsl:otherwise>
1303
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1304
+ </xsl:otherwise>
1305
+ </xsl:choose>
1306
+ <xsl:apply-templates/>
1307
+ </fo:block>
1308
+ </xsl:template>
1309
+
1310
+ <xsl:template match="itu:sections/itu:p[@class = 'zzSTDTitle2']" priority="4">
1311
+ <fo:block font-size="14pt" font-weight="bold" text-align="center" margin-top="15pt" margin-bottom="15pt" role="H1">
1312
+ <xsl:if test="$lang = 'ar'"> <!-- to prevent rendering `###` due the missing Arabic glyphs in the italic font (Times New Roman) -->
1313
+ <xsl:attribute name="font-style">normal</xsl:attribute>
1314
+ </xsl:if>
1315
+ <!-- Example: <p align="center" class="zzSTDTitle2" displayorder="4"><em>(Hammamet, 2016</em>) -->
1316
+ <xsl:if test="@align = 'center'">
1317
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1318
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1319
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1320
+ </xsl:if>
1321
+ <xsl:apply-templates/>
1322
+ </fo:block>
1323
+ </xsl:template>
1324
+
1289
1325
  <xsl:template match="node()">
1290
1326
  <xsl:apply-templates/>
1291
1327
  </xsl:template>
@@ -1740,25 +1776,25 @@
1740
1776
  </xsl:template> -->
1741
1777
 
1742
1778
  <!-- footnotes for title -->
1743
- <xsl:template match="itu:bibdata/itu:note[@type = 'title-footnote']" mode="title_footnote">
1779
+ <!-- <xsl:template match="itu:bibdata/itu:note[@type = 'title-footnote']" mode="title_footnote">
1744
1780
  <xsl:variable name="number" select="position()"/>
1745
1781
  <fo:footnote>
1746
1782
  <fo:inline font-size="60%" keep-with-previous.within-line="always" vertical-align="super">
1747
1783
  <fo:basic-link internal-destination="title_footnote_{$number}" fox:alt-text="titlefootnote {$number}">
1748
1784
  <xsl:value-of select="$number"/>
1749
1785
  </fo:basic-link>
1750
- <xsl:if test="position() != last()">,</xsl:if><!-- <fo:inline baseline-shift="20%">,</fo:inline> -->
1786
+ <xsl:if test="position() != last()">,</xsl:if>
1751
1787
  </fo:inline>
1752
1788
  <fo:footnote-body>
1753
1789
  <fo:block font-size="11pt" margin-bottom="12pt" text-align="justify">
1754
1790
  <fo:inline id="title_footnote_{$number}" font-size="85%" padding-right="2mm" keep-with-next.within-line="always" baseline-shift="30%">
1755
1791
  <xsl:value-of select="$number"/>
1756
1792
  </fo:inline>
1757
- <xsl:apply-templates/>
1793
+ <xsl:apply-templates />
1758
1794
  </fo:block>
1759
1795
  </fo:footnote-body>
1760
1796
  </fo:footnote>
1761
- </xsl:template>
1797
+ </xsl:template> -->
1762
1798
 
1763
1799
  <xsl:template match="*[local-name()='tt']" priority="2">
1764
1800
  <xsl:variable name="element-name">
@@ -6114,6 +6150,9 @@
6114
6150
  <!-- END Definition List -->
6115
6151
  <!-- ===================== -->
6116
6152
 
6153
+ <!-- default: ignore title in sections/p -->
6154
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
6155
+
6117
6156
  <!-- ========================= -->
6118
6157
  <!-- Rich text formatting -->
6119
6158
  <!-- ========================= -->
@@ -8204,25 +8243,45 @@
8204
8243
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
8205
8244
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
8206
8245
 
8207
- <xsl:variable name="img_src">
8208
- <xsl:choose>
8209
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
8210
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
8211
- </xsl:choose>
8212
- </xsl:variable>
8246
+ <xsl:if test="@width != '' and @width != 'auto'">
8247
+ <xsl:attribute name="width">
8248
+ <xsl:value-of select="@width"/>
8249
+ </xsl:attribute>
8250
+ </xsl:if>
8251
+
8252
+ <xsl:if test="@height != '' and @height != 'auto'">
8253
+ <xsl:attribute name="height">
8254
+ <xsl:value-of select="@height"/>
8255
+ </xsl:attribute>
8256
+ </xsl:if>
8213
8257
 
8214
- <xsl:variable name="image_width_effective">
8258
+ <xsl:choose>
8259
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
8260
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
8261
+ </xsl:when>
8262
+ <xsl:otherwise>
8215
8263
 
8216
- <xsl:value-of select="$width_effective"/>
8264
+ <xsl:variable name="img_src">
8265
+ <xsl:choose>
8266
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
8267
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
8268
+ </xsl:choose>
8269
+ </xsl:variable>
8217
8270
 
8218
- </xsl:variable>
8271
+ <xsl:variable name="image_width_effective">
8219
8272
 
8220
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
8221
- <xsl:if test="number($scale) &lt; 100">
8273
+ <xsl:value-of select="$width_effective"/>
8222
8274
 
8223
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
8275
+ </xsl:variable>
8224
8276
 
8225
- </xsl:if>
8277
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
8278
+ <xsl:if test="number($scale) &lt; 100">
8279
+
8280
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
8281
+
8282
+ </xsl:if>
8283
+ </xsl:otherwise>
8284
+ </xsl:choose>
8226
8285
 
8227
8286
  </xsl:if>
8228
8287
 
@@ -11911,7 +11970,7 @@
11911
11970
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
11912
11971
  <xsl:apply-templates mode="update_xml_step1"/>
11913
11972
  </xsl:template>
11914
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11973
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11915
11974
  <xsl:copy>
11916
11975
  <xsl:copy-of select="@*"/>
11917
11976
  <xsl:apply-templates mode="update_xml_step1"/>