metanorma-bipm 2.2.14 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,7 +32,7 @@
32
32
  <xsl:for-each select="//bipm:bipm-standard">
33
33
  <xsl:variable name="lang" select="*[local-name()='bibdata']/*[local-name()='language'][@current = 'true']"/>
34
34
  <xsl:variable name="num"><xsl:number level="any" count="bipm:bipm-standard"/></xsl:variable>
35
- <xsl:variable name="title-part"><xsl:value-of select="bipm:bibdata/bipm:title[@type = 'part']"/></xsl:variable>
35
+ <xsl:variable name="title-part"><xsl:value-of select="bipm:bibdata/bipm:title[@type = 'title-part']"/></xsl:variable>
36
36
  <xsl:variable name="current_document">
37
37
  <xsl:copy-of select="."/>
38
38
  </xsl:variable>
@@ -983,7 +983,7 @@
983
983
 
984
984
  <fo:block-container font-size="18pt" font-weight="bold" text-align="center">
985
985
  <fo:block role="H1">
986
- <xsl:value-of select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='cover']"/>
986
+ <xsl:value-of select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='title-cover']"/>
987
987
  </fo:block>
988
988
  </fo:block-container>
989
989
 
@@ -1076,7 +1076,7 @@
1076
1076
  <fo:block-container margin-left="-14mm" margin-right="0mm">
1077
1077
  <fo:block-container margin-left="0mm" margin-right="0mm">
1078
1078
  <fo:block font-family="Arial" font-size="16pt" font-weight="bold" text-align-last="justify" margin-bottom="82pt" role="H1">
1079
- <fo:inline><xsl:value-of select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='main']"/></fo:inline>
1079
+ <fo:inline><xsl:value-of select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='title-main']"/></fo:inline>
1080
1080
  <fo:inline keep-together.within-line="always">
1081
1081
  <fo:leader leader-pattern="space"/>
1082
1082
  <fo:inline>
@@ -1215,20 +1215,20 @@
1215
1215
 
1216
1216
  <xsl:choose>
1217
1217
  <xsl:when test="$independentAppendix != ''">
1218
- <xsl:apply-templates select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='appendix']" mode="title"/>
1218
+ <xsl:apply-templates select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='title-appendix']" mode="title"/>
1219
1219
  <fo:block>
1220
- <xsl:apply-templates select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='annex']" mode="title"/>
1220
+ <xsl:apply-templates select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='title-annex']" mode="title"/>
1221
1221
  </fo:block>
1222
1222
  </xsl:when>
1223
1223
  <xsl:otherwise> <!-- doctype = 'guide' -->
1224
- <xsl:apply-templates select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='main']" mode="title"/>
1224
+ <xsl:apply-templates select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='title-main']" mode="title"/>
1225
1225
  </xsl:otherwise>
1226
1226
  </xsl:choose>
1227
1227
 
1228
1228
  </fo:block>
1229
1229
 
1230
1230
  <!-- <xsl:variable name="part_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:part)"/> -->
1231
- <xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part-with-numbering']">
1231
+ <xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'title-part-with-numbering']">
1232
1232
  <fo:block role="H2">
1233
1233
  <!-- <xsl:if test="$part_num != ''">
1234
1234
  <xsl:call-template name="getLocalizedString">
@@ -1239,17 +1239,17 @@
1239
1239
  <xsl:value-of select="$part_num"/>
1240
1240
  </xsl:if>
1241
1241
  <xsl:text>: </xsl:text> -->
1242
- <xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part-with-numbering']" mode="title"/>
1242
+ <xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'title-part-with-numbering']" mode="title"/>
1243
1243
  </fo:block>
1244
1244
  </xsl:if>
1245
1245
  <!-- <xsl:variable name="subpart_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:subpart)"/> -->
1246
- <xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart-with-numbering']">
1246
+ <xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'title-subpart-with-numbering']">
1247
1247
  <fo:block role="H3">
1248
1248
  <!-- <xsl:if test="$subpart_num != ''">
1249
1249
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang=$curr_lang]),'#',$subpart_num)"/>
1250
1250
  </xsl:if>
1251
1251
  <xsl:text>: </xsl:text> -->
1252
- <xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart-with-numbering']" mode="title"/>
1252
+ <xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'title-subpart-with-numbering']" mode="title"/>
1253
1253
  </fo:block>
1254
1254
  </xsl:if>
1255
1255
 
@@ -1362,7 +1362,7 @@
1362
1362
  <xsl:for-each select="xalan:nodeset($languages)/lang">
1363
1363
  <xsl:variable name="title_num" select="position()"/>
1364
1364
  <xsl:variable name="curr_lang" select="."/>
1365
- <xsl:variable name="title-cover" select="xalan:nodeset($titles)//bipm:title[@language = $curr_lang and @type='main']"/>
1365
+ <xsl:variable name="title-cover" select="xalan:nodeset($titles)//bipm:title[@language = $curr_lang and @type='title-main']"/>
1366
1366
  <xsl:variable name="title-cover_" select="java:replaceAll(java:java.lang.String.new($title-cover),'( (of )| (and )| (or ))','#$2')"/>
1367
1367
  <xsl:variable name="titleParts">
1368
1368
  <xsl:call-template name="splitTitle">
@@ -1421,8 +1421,8 @@
1421
1421
 
1422
1422
  <fo:block-container absolute-position="fixed" left="12.5mm" top="60mm">
1423
1423
 
1424
- <fo:block font-size="22.2pt" font-weight="{$weight-normal}" role="H1"><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'main']"/></fo:block>
1425
- <fo:block font-size="22.2pt" font-weight="{$weight-bold}" margin-top="1mm" role="H1"><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'main']"/></fo:block>
1424
+ <fo:block font-size="22.2pt" font-weight="{$weight-normal}" role="H1"><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'title-main']"/></fo:block>
1425
+ <fo:block font-size="22.2pt" font-weight="{$weight-bold}" margin-top="1mm" role="H1"><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'title-main']"/></fo:block>
1426
1426
 
1427
1427
  <xsl:variable name="edition_str">édition</xsl:variable>
1428
1428
 
@@ -1433,28 +1433,28 @@
1433
1433
  <fo:block role="H1">
1434
1434
 
1435
1435
  <xsl:variable name="title_appendix_fr">
1436
- <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'appendix']" mode="title"/>
1436
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'title-appendix']" mode="title"/>
1437
1437
  </xsl:variable>
1438
1438
  <xsl:variable name="title_appendix_en">
1439
- <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'appendix']" mode="title"/>
1439
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'title-appendix']" mode="title"/>
1440
1440
  </xsl:variable>
1441
1441
  <xsl:variable name="title_annex_fr">
1442
- <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'annex']" mode="title"/>
1442
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'title-annex']" mode="title"/>
1443
1443
  </xsl:variable>
1444
1444
  <xsl:variable name="title_annex_en">
1445
- <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'annex']" mode="title"/>
1445
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'title-annex']" mode="title"/>
1446
1446
  </xsl:variable>
1447
1447
  <xsl:variable name="title_part_fr">
1448
- <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'part']" mode="title"/>
1448
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'title-part']" mode="title"/>
1449
1449
  </xsl:variable>
1450
1450
  <xsl:variable name="title_part_en">
1451
- <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'part']" mode="title"/>
1451
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'title-part']" mode="title"/>
1452
1452
  </xsl:variable>
1453
1453
  <xsl:variable name="title_subpart_fr">
1454
- <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'subpart']" mode="title"/>
1454
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'title-subpart']" mode="title"/>
1455
1455
  </xsl:variable>
1456
1456
  <xsl:variable name="title_subpart_en">
1457
- <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'subpart']" mode="title"/>
1457
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'title-subpart']" mode="title"/>
1458
1458
  </xsl:variable>
1459
1459
 
1460
1460
  <xsl:variable name="titles_length" select="string-length($title_appendix_fr) + string-length($title_appendix_en) + string-length($title_annex_fr) + string-length($title_annex_en) + string-length($title_part_fr) + string-length($title_part_en) + string-length($title_subpart_fr) + string-length($title_subpart_fr)"/>
@@ -1492,7 +1492,7 @@
1492
1492
  <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-bold}">Appendix <xsl:value-of select="$appendix_num"/></fo:block>
1493
1493
  </xsl:if>
1494
1494
 
1495
- <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'appendix']">
1495
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'title-appendix']">
1496
1496
  <fo:block font-size="{$font-size-factor * 30.4}pt">
1497
1497
  <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1498
1498
  <fo:block font-weight="{$weight-normal}"><xsl:copy-of select="$title_appendix_fr"/></fo:block>
@@ -1505,7 +1505,7 @@
1505
1505
  <!-- End Appendix titles processing -->
1506
1506
 
1507
1507
  <!-- Annex title processing -->
1508
- <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'annex']">
1508
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'title-annex']">
1509
1509
  <xsl:variable name="annex_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:annexid)"/>
1510
1510
  <xsl:if test="$annex_num != ''">
1511
1511
  <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
@@ -1533,7 +1533,7 @@
1533
1533
  <!-- End Annex titles processing -->
1534
1534
 
1535
1535
  <!-- Part titles processing -->
1536
- <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'part']">
1536
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'title-part']">
1537
1537
  <xsl:variable name="part_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:part)"/>
1538
1538
  <xsl:if test="$part_num != ''">
1539
1539
  <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
@@ -1565,7 +1565,7 @@
1565
1565
  <!-- End Part titles processing -->
1566
1566
 
1567
1567
  <!-- Sub-part titles processing -->
1568
- <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'subpart']">
1568
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'title-subpart']">
1569
1569
  <xsl:variable name="subpart_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:subpart)"/>
1570
1570
  <xsl:if test="$subpart_num != ''">
1571
1571
  <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
@@ -1657,7 +1657,7 @@
1657
1657
 
1658
1658
  <xsl:template name="insertInnerCoverPage">
1659
1659
 
1660
- <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type='cover']">
1660
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type='title-cover']">
1661
1661
 
1662
1662
  <fo:page-sequence master-reference="title-page" format="1" initial-page-number="1" force-page-count="even">
1663
1663
 
@@ -1677,7 +1677,7 @@
1677
1677
 
1678
1678
  <xsl:for-each select="xalan:nodeset($languages)/lang">
1679
1679
  <xsl:variable name="curr_lang" select="."/>
1680
- <xsl:variable name="title" select="xalan:nodeset($titles)//bipm:title[@language = $curr_lang and @type='cover']"/>
1680
+ <xsl:variable name="title" select="xalan:nodeset($titles)//bipm:title[@language = $curr_lang and @type='title-cover']"/>
1681
1681
  <xsl:choose>
1682
1682
  <xsl:when test="position() = 1">
1683
1683
  <fo:block-container font-size="12pt" font-weight="bold" width="55mm">
@@ -4188,11 +4188,26 @@
4188
4188
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
4189
4189
  </xsl:if>
4190
4190
 
4191
- <xsl:value-of select="."/>
4191
+ <xsl:variable name="font_family" select="."/>
4192
4192
 
4193
- <xsl:if test="$additional_fonts != ''">
4194
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
4195
- </xsl:if>
4193
+ <xsl:choose>
4194
+ <xsl:when test="$additional_fonts = ''">
4195
+ <xsl:value-of select="$font_family"/>
4196
+ </xsl:when>
4197
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
4198
+ <xsl:choose>
4199
+ <xsl:when test="contains($font_family, ',')">
4200
+ <xsl:value-of select="substring-before($font_family, ',')"/>
4201
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
4202
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
4203
+ </xsl:when>
4204
+ <xsl:otherwise>
4205
+ <xsl:value-of select="$font_family"/>
4206
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
4207
+ </xsl:otherwise>
4208
+ </xsl:choose>
4209
+ </xsl:otherwise>
4210
+ </xsl:choose>
4196
4211
  </xsl:attribute>
4197
4212
  </xsl:when>
4198
4213
  <xsl:otherwise>
@@ -6786,25 +6801,25 @@
6786
6801
 
6787
6802
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
6788
6803
 
6789
- <fo:block xsl:use-attribute-sets="table-note-style">
6804
+ <fo:block xsl:use-attribute-sets="table-note-style">
6790
6805
 
6791
- <xsl:call-template name="refine_table-note-style"/>
6806
+ <xsl:call-template name="refine_table-note-style"/>
6792
6807
 
6793
- <!-- Table's note/example name (NOTE, for example) -->
6794
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
6808
+ <!-- Table's note/example name (NOTE, for example) -->
6809
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
6795
6810
 
6796
- <xsl:call-template name="refine_table-note-name-style"/>
6811
+ <xsl:call-template name="refine_table-note-name-style"/>
6797
6812
 
6798
- <xsl:apply-templates select="*[local-name() = 'name']"/>
6813
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
6799
6814
 
6800
- </fo:inline>
6815
+ </fo:inline>
6801
6816
 
6802
- <xsl:if test="ancestor::bipm:preface">
6803
- <fo:block> </fo:block>
6804
- </xsl:if>
6817
+ <xsl:if test="ancestor::bipm:preface">
6818
+ <fo:block> </fo:block>
6819
+ </xsl:if>
6805
6820
 
6806
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6807
- </fo:block>
6821
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6822
+ </fo:block>
6808
6823
 
6809
6824
  </xsl:template> <!-- table/note -->
6810
6825
 
@@ -7878,6 +7893,9 @@
7878
7893
  <!-- END Definition List -->
7879
7894
  <!-- ===================== -->
7880
7895
 
7896
+ <!-- default: ignore title in sections/p -->
7897
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
7898
+
7881
7899
  <!-- ========================= -->
7882
7900
  <!-- Rich text formatting -->
7883
7901
  <!-- ========================= -->
@@ -9979,8 +9997,12 @@
9979
9997
  <xsl:variable name="isAdded" select="../@added"/>
9980
9998
  <xsl:variable name="isDeleted" select="../@deleted"/>
9981
9999
  <xsl:choose>
9982
- <xsl:when test="ancestor::*[local-name() = 'title']">
10000
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
9983
10001
  <fo:inline padding-left="1mm" padding-right="1mm">
10002
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
10003
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
10004
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
10005
+ </xsl:if>
9984
10006
  <xsl:variable name="src">
9985
10007
  <xsl:call-template name="image_src"/>
9986
10008
  </xsl:variable>
@@ -10013,25 +10035,45 @@
10013
10035
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
10014
10036
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
10015
10037
 
10016
- <xsl:variable name="img_src">
10017
- <xsl:choose>
10018
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
10019
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
10020
- </xsl:choose>
10021
- </xsl:variable>
10038
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
10039
+ <xsl:attribute name="width">
10040
+ <xsl:value-of select="@width"/>
10041
+ </xsl:attribute>
10042
+ </xsl:if>
10022
10043
 
10023
- <xsl:variable name="image_width_effective">
10044
+ <xsl:if test="@height != '' and @height != 'auto'">
10045
+ <xsl:attribute name="height">
10046
+ <xsl:value-of select="@height"/>
10047
+ </xsl:attribute>
10048
+ </xsl:if>
10024
10049
 
10025
- <xsl:value-of select="$width_effective"/>
10050
+ <xsl:choose>
10051
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
10052
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
10053
+ </xsl:when>
10054
+ <xsl:otherwise>
10026
10055
 
10027
- </xsl:variable>
10056
+ <xsl:variable name="img_src">
10057
+ <xsl:choose>
10058
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
10059
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
10060
+ </xsl:choose>
10061
+ </xsl:variable>
10028
10062
 
10029
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
10030
- <xsl:if test="number($scale) &lt; 100">
10063
+ <xsl:variable name="image_width_effective">
10031
10064
 
10032
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
10065
+ <xsl:value-of select="$width_effective"/>
10033
10066
 
10034
- </xsl:if>
10067
+ </xsl:variable>
10068
+
10069
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
10070
+ <xsl:if test="number($scale) &lt; 100">
10071
+
10072
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
10073
+
10074
+ </xsl:if>
10075
+ </xsl:otherwise>
10076
+ </xsl:choose>
10035
10077
 
10036
10078
  </xsl:if>
10037
10079
 
@@ -13701,7 +13743,7 @@
13701
13743
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
13702
13744
  <xsl:apply-templates mode="update_xml_step1"/>
13703
13745
  </xsl:template>
13704
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
13746
+ <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">
13705
13747
  <xsl:copy>
13706
13748
  <xsl:copy-of select="@*"/>
13707
13749
  <xsl:apply-templates mode="update_xml_step1"/>