metanorma-bipm 2.2.14 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 562ebdd8e3b0d6bb6345c05c8944919c9e91a0b0a22fe0fd81d38de77ebe279e
4
- data.tar.gz: 3fbda2a4fa426942a2208388e1ce9aebd64f4a496e266aff7f1f7d94cd81a04b
3
+ metadata.gz: db333f4baa39d62ca122b46d87efaeaa37e260f003c4c10390f515bf81b0ae2c
4
+ data.tar.gz: 03b232eaa16fccc5405f47b957c289d754567c2de91a0040e7d19ec40eadff15
5
5
  SHA512:
6
- metadata.gz: 2b7bfa7a1fc50aa8befcff9364e7c9f3f22096d7fac415404fefb591df8d093ccaa0407ab5903336d61def56a9524fdb91c8a57e1a89126465690a5041ce370a
7
- data.tar.gz: 419395d1172f4b2d6e4f3eedf9a5e2078d1cf038d16c54832ae307ae58fda357d8288524de1b28cc6c308acd1512c62fd6d203f9e2d5a2c8873ac9a36546f547
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">
@@ -7878,6 +7878,9 @@
7878
7878
  <!-- END Definition List -->
7879
7879
  <!-- ===================== -->
7880
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
+
7881
7884
  <!-- ========================= -->
7882
7885
  <!-- Rich text formatting -->
7883
7886
  <!-- ========================= -->
@@ -10013,25 +10016,45 @@
10013
10016
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
10014
10017
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
10015
10018
 
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>
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>
10022
10024
 
10023
- <xsl:variable name="image_width_effective">
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>
10024
10030
 
10025
- <xsl:value-of select="$width_effective"/>
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>
10026
10036
 
10027
- </xsl:variable>
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>
10028
10043
 
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">
10044
+ <xsl:variable name="image_width_effective">
10031
10045
 
10032
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
10046
+ <xsl:value-of select="$width_effective"/>
10033
10047
 
10034
- </xsl:if>
10048
+ </xsl:variable>
10049
+
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">
10052
+
10053
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
10054
+
10055
+ </xsl:if>
10056
+ </xsl:otherwise>
10057
+ </xsl:choose>
10035
10058
 
10036
10059
  </xsl:if>
10037
10060
 
@@ -13701,7 +13724,7 @@
13701
13724
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
13702
13725
  <xsl:apply-templates mode="update_xml_step1"/>
13703
13726
  </xsl:template>
13704
- <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">
13705
13728
  <xsl:copy>
13706
13729
  <xsl:copy-of select="@*"/>
13707
13730
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -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">
@@ -7878,6 +7878,9 @@
7878
7878
  <!-- END Definition List -->
7879
7879
  <!-- ===================== -->
7880
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
+
7881
7884
  <!-- ========================= -->
7882
7885
  <!-- Rich text formatting -->
7883
7886
  <!-- ========================= -->
@@ -10013,25 +10016,45 @@
10013
10016
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
10014
10017
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
10015
10018
 
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>
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>
10022
10024
 
10023
- <xsl:variable name="image_width_effective">
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>
10024
10030
 
10025
- <xsl:value-of select="$width_effective"/>
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>
10026
10036
 
10027
- </xsl:variable>
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>
10028
10043
 
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">
10044
+ <xsl:variable name="image_width_effective">
10031
10045
 
10032
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
10046
+ <xsl:value-of select="$width_effective"/>
10033
10047
 
10034
- </xsl:if>
10048
+ </xsl:variable>
10049
+
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">
10052
+
10053
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
10054
+
10055
+ </xsl:if>
10056
+ </xsl:otherwise>
10057
+ </xsl:choose>
10035
10058
 
10036
10059
  </xsl:if>
10037
10060
 
@@ -13701,7 +13724,7 @@
13701
13724
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
13702
13725
  <xsl:apply-templates mode="update_xml_step1"/>
13703
13726
  </xsl:template>
13704
- <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">
13705
13728
  <xsl:copy>
13706
13729
  <xsl:copy-of select="@*"/>
13707
13730
  <xsl:apply-templates mode="update_xml_step1"/>