metanorma-bipm 2.2.13 → 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: d51662c5bd5119a4ac8a1e1f289b5d713e65ceaf9bdbe9d870d6363838719727
4
- data.tar.gz: ba913e8a28ed139b406155bebdc99bbcf013875f76b8bcc9cbd006655993e88f
3
+ metadata.gz: db333f4baa39d62ca122b46d87efaeaa37e260f003c4c10390f515bf81b0ae2c
4
+ data.tar.gz: 03b232eaa16fccc5405f47b957c289d754567c2de91a0040e7d19ec40eadff15
5
5
  SHA512:
6
- metadata.gz: d22d21e9523931d1e0872fe339d5f76fb51c5e2ac6e04c9c3ca1fcdf8a94d44097dd2810b5ef24d225945c4ea96882db10e12b037e218a12ddd65b2c34d8715d
7
- data.tar.gz: 81a50f67292600ced23fe851d5baf3e3fe9d128c1f57ac56c051c9b60ac3560d557c8d7352e38e62daadbcf5cf5561864fab136e3d3fcda311f9f36c35372148
6
+ metadata.gz: be2b513686ecdaca070cdc4898841f5ebe95981625f8bb159c9471be9729b244640b1250e16ec349f5d1613c288245144812994bdcd4948020b2b39475ac9d93
7
+ data.tar.gz: d8fd8eabacaeb7e25ce3b6918ea032cd2015af9d90972b6a693dcc2e5904a65fbcebfcdf8111e22c0eb395b23d01135f242545c0ad3cf6a0931b311f33c51ada
@@ -3,33 +3,27 @@ require "isodoc"
3
3
  module IsoDoc
4
4
  module BIPM
5
5
  module BaseConvert
6
+ attr_accessor :jcgm
7
+
6
8
  def configuration
7
9
  Metanorma::BIPM.configuration
8
10
  end
9
11
 
12
+ TOP_ELEMENTS = IsoDoc::Function::ToWordHtml::TOP_ELEMENTS +
13
+ " | //doccontrol[@displayorder]".freeze
14
+
10
15
  def convert1(docxml, filename, dir)
11
16
  @jcgm = docxml&.at(ns("//bibdata/ext/editorialgroup/committee/" \
12
17
  "@acronym"))&.value == "JCGM"
13
18
  super
14
19
  end
15
20
 
16
- def middle(isoxml, out)
21
+ def middle_clause(_docxml)
17
22
  if @jcgm
18
- super
23
+ "//clause[parent::sections][not(@type = 'scope')]" \
24
+ "[not(descendant::terms)][not(descendant::references)]"
19
25
  else
20
- middle_title(isoxml, out)
21
- middle_admonitions(isoxml, out)
22
- clause isoxml, out
23
- annex isoxml, out
24
- bibliography isoxml, out
25
- end
26
- end
27
-
28
- def middle_clause(docxml)
29
- if @jcgm
30
- super
31
- else
32
- "//sections/*"
26
+ "//sections/*[not(local-name() = 'references')][not(.//references)]"
33
27
  end
34
28
  end
35
29
 
@@ -64,6 +58,13 @@ module IsoDoc
64
58
  def blacksquare_parse(_node, out)
65
59
  out << "&#x25a0;"
66
60
  end
61
+
62
+ def top_element_render(elem, out)
63
+ case elem.name
64
+ when "doccontrol" then doccontrol elem, out
65
+ else super
66
+ end
67
+ end
67
68
  end
68
69
  end
69
70
  end
@@ -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">
@@ -4009,19 +4009,32 @@
4009
4009
  <xsl:variable name="titles_">
4010
4010
 
4011
4011
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
4012
- <title-toc lang="en">
4013
-
4014
- </title-toc>
4015
- <title-toc lang="fr">
4012
+ <!-- <title-toc lang="en">
4013
+ <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'">
4014
+ <xsl:text>Contents</xsl:text>
4015
+ </xsl:if>
4016
+ <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'">
4017
+ <xsl:text>Table of Contents</xsl:text>
4018
+ </xsl:if>
4019
+ <xsl:if test="$namespace = 'gb'">
4020
+ <xsl:text>Table of contents</xsl:text>
4021
+ </xsl:if>
4022
+ </title-toc> -->
4023
+ <title-toc lang="en">Table of contents</title-toc>
4024
+ <!-- <title-toc lang="fr">
4016
4025
  <xsl:text>Sommaire</xsl:text>
4017
- </title-toc>
4018
- <title-toc lang="zh">
4019
-
4026
+ </title-toc> -->
4027
+ <!-- <title-toc lang="zh">
4028
+ <xsl:choose>
4029
+ <xsl:when test="$namespace = 'gb'">
4030
+ <xsl:text>目次</xsl:text>
4031
+ </xsl:when>
4032
+ <xsl:otherwise>
4020
4033
  <xsl:text>Contents</xsl:text>
4021
-
4022
- </title-toc>
4023
-
4024
- <title-descriptors lang="en">Descriptors</title-descriptors>
4034
+ </xsl:otherwise>
4035
+ </xsl:choose>
4036
+ </title-toc> -->
4037
+ <title-toc lang="zh">目次</title-toc>
4025
4038
 
4026
4039
  <title-part lang="en">
4027
4040
 
@@ -4041,20 +4054,6 @@
4041
4054
  <title-subpart lang="en">Sub-part #</title-subpart>
4042
4055
  <title-subpart lang="fr">Partie de sub #</title-subpart>
4043
4056
 
4044
- <title-list-tables lang="en">List of Tables</title-list-tables>
4045
-
4046
- <title-list-figures lang="en">List of Figures</title-list-figures>
4047
-
4048
- <title-table-figures lang="en">Table of Figures</title-table-figures>
4049
-
4050
- <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
4051
-
4052
- <title-summary lang="en">Summary</title-summary>
4053
-
4054
- <title-continued lang="ru">(продолжение)</title-continued>
4055
- <title-continued lang="en">(continued)</title-continued>
4056
- <title-continued lang="fr">(continué)</title-continued>
4057
-
4058
4057
  </xsl:variable>
4059
4058
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
4060
4059
 
@@ -4062,8 +4061,8 @@
4062
4061
  <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
4063
4062
  <xsl:value-of select="$toc_table_title"/>
4064
4063
  <xsl:if test="normalize-space($toc_table_title) = ''">
4065
- <xsl:call-template name="getTitle">
4066
- <xsl:with-param name="name" select="'title-list-tables'"/>
4064
+ <xsl:call-template name="getLocalizedString">
4065
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
4067
4066
  </xsl:call-template>
4068
4067
  </xsl:if>
4069
4068
  </xsl:variable>
@@ -4072,8 +4071,8 @@
4072
4071
  <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
4073
4072
  <xsl:value-of select="$toc_figure_title"/>
4074
4073
  <xsl:if test="normalize-space($toc_figure_title) = ''">
4075
- <xsl:call-template name="getTitle">
4076
- <xsl:with-param name="name" select="'title-list-figures'"/>
4074
+ <xsl:call-template name="getLocalizedString">
4075
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
4077
4076
  </xsl:call-template>
4078
4077
  </xsl:if>
4079
4078
  </xsl:variable>
@@ -4082,8 +4081,8 @@
4082
4081
  <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
4083
4082
  <xsl:value-of select="$toc_requirement_title"/>
4084
4083
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
4085
- <xsl:call-template name="getTitle">
4086
- <xsl:with-param name="name" select="'title-list-recommendations'"/>
4084
+ <xsl:call-template name="getLocalizedString">
4085
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
4087
4086
  </xsl:call-template>
4088
4087
  </xsl:if>
4089
4088
  </xsl:variable>
@@ -7879,6 +7878,9 @@
7879
7878
  <!-- END Definition List -->
7880
7879
  <!-- ===================== -->
7881
7880
 
7881
+ <!-- default: ignore title in sections/p -->
7882
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
7883
+
7882
7884
  <!-- ========================= -->
7883
7885
  <!-- Rich text formatting -->
7884
7886
  <!-- ========================= -->
@@ -7954,7 +7956,7 @@
7954
7956
  <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
7955
7957
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
7956
7958
  <xsl:choose>
7957
- <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
7959
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''">
7958
7960
  <!-- url -->
7959
7961
  <xsl:call-template name="add-zero-spaces-link-java"/>
7960
7962
  </xsl:when>
@@ -8416,10 +8418,13 @@
8416
8418
  </xsl:choose>
8417
8419
  </xsl:variable>
8418
8420
 
8421
+ <!-- replace sequence #x200B to one &#x200B -->
8422
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/>
8423
+
8419
8424
  <!-- replace sequence #x200B and space TO space -->
8420
- <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
8425
+ <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/>
8421
8426
 
8422
- <xsl:value-of select="$text10"/>
8427
+ <xsl:value-of select="$text11"/>
8423
8428
  </xsl:template>
8424
8429
 
8425
8430
  <xsl:template name="add-zero-spaces-link-java">
@@ -8429,8 +8434,12 @@
8429
8434
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
8430
8435
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ -->
8431
8436
  <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/>
8437
+
8438
+ <!-- replace sequence #x200B to one &#x200B -->
8439
+ <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/>
8440
+
8432
8441
  <!-- remove zero-width space at the end -->
8433
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
8442
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/>
8434
8443
  </xsl:template>
8435
8444
 
8436
8445
  <!-- add zero space after dash character (for table's entries) -->
@@ -9725,7 +9734,7 @@
9725
9734
 
9726
9735
  <xsl:call-template name="refine_note_block_style"/>
9727
9736
 
9728
- <fo:inline xsl:use-attribute-sets="note-name-style">
9737
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
9729
9738
 
9730
9739
  <xsl:call-template name="refine_note-name-style"/>
9731
9740
 
@@ -9769,12 +9778,12 @@
9769
9778
  <xsl:variable name="num"><xsl:number/></xsl:variable>
9770
9779
  <xsl:choose>
9771
9780
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
9772
- <fo:inline xsl:use-attribute-sets="note-p-style">
9781
+ <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
9773
9782
  <xsl:apply-templates/>
9774
9783
  </fo:inline>
9775
9784
  </xsl:when>
9776
9785
  <xsl:otherwise>
9777
- <fo:block xsl:use-attribute-sets="note-p-style">
9786
+ <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
9778
9787
  <xsl:apply-templates/>
9779
9788
  </fo:block>
9780
9789
  </xsl:otherwise>
@@ -10007,25 +10016,45 @@
10007
10016
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
10008
10017
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
10009
10018
 
10010
- <xsl:variable name="img_src">
10011
- <xsl:choose>
10012
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
10013
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
10014
- </xsl:choose>
10015
- </xsl:variable>
10019
+ <xsl:if test="@width != '' and @width != 'auto'">
10020
+ <xsl:attribute name="width">
10021
+ <xsl:value-of select="@width"/>
10022
+ </xsl:attribute>
10023
+ </xsl:if>
10024
+
10025
+ <xsl:if test="@height != '' and @height != 'auto'">
10026
+ <xsl:attribute name="height">
10027
+ <xsl:value-of select="@height"/>
10028
+ </xsl:attribute>
10029
+ </xsl:if>
10030
+
10031
+ <xsl:choose>
10032
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
10033
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
10034
+ </xsl:when>
10035
+ <xsl:otherwise>
10016
10036
 
10017
- <xsl:variable name="image_width_effective">
10037
+ <xsl:variable name="img_src">
10038
+ <xsl:choose>
10039
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
10040
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
10041
+ </xsl:choose>
10042
+ </xsl:variable>
10018
10043
 
10019
- <xsl:value-of select="$width_effective"/>
10044
+ <xsl:variable name="image_width_effective">
10020
10045
 
10021
- </xsl:variable>
10046
+ <xsl:value-of select="$width_effective"/>
10022
10047
 
10023
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
10024
- <xsl:if test="number($scale) &lt; 100">
10048
+ </xsl:variable>
10025
10049
 
10026
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
10050
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
10051
+ <xsl:if test="number($scale) &lt; 100">
10027
10052
 
10028
- </xsl:if>
10053
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
10054
+
10055
+ </xsl:if>
10056
+ </xsl:otherwise>
10057
+ </xsl:choose>
10029
10058
 
10030
10059
  </xsl:if>
10031
10060
 
@@ -13695,7 +13724,7 @@
13695
13724
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
13696
13725
  <xsl:apply-templates mode="update_xml_step1"/>
13697
13726
  </xsl:template>
13698
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
13727
+ <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">
13699
13728
  <xsl:copy>
13700
13729
  <xsl:copy-of select="@*"/>
13701
13730
  <xsl:apply-templates mode="update_xml_step1"/>