metanorma-bipm 2.2.14 → 2.3.0

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">
@@ -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"/>
@@ -5,7 +5,7 @@ module IsoDoc
5
5
  return unless doc.at(ns("//bibdata/relation[@type = 'supersedes']"))
6
6
 
7
7
  clause = <<~DOCCONTROL
8
- <doccontrol>
8
+ <doccontrol displayorder="999">
9
9
  <title>Document Control</title>
10
10
  <table unnumbered="true"><tbody>
11
11
  <tr><th>Authors:</th><td/><td>#{list_authors(doc)}</td></tr>
@@ -41,7 +41,7 @@ module IsoDoc
41
41
  while list_draft(xml, i) != ["", ""]
42
42
  ret += "<tr>#{list_draft(xml, i).map do |x|
43
43
  "<td>#{x}</td>"
44
- end.join} "\
44
+ end.join} " \
45
45
  "<td/></tr>"
46
46
  i += 1
47
47
  end
@@ -49,7 +49,7 @@ module IsoDoc
49
49
  end
50
50
 
51
51
  def list_draft(xml, idx)
52
- d = xml.at(ns("//bibdata/relation[@type = 'supersedes'][#{idx}]"\
52
+ d = xml.at(ns("//bibdata/relation[@type = 'supersedes'][#{idx}]" \
53
53
  "/bibitem")) or return ["", ""]
54
54
 
55
55
  draft = d&.at(ns("./version/draft"))&.text and draft = "Draft #{draft}"
@@ -65,7 +65,7 @@ module IsoDoc
65
65
  end
66
66
 
67
67
  COCHAIR = "xmlns:role[contains(text(),'co-chair')]".freeze
68
- CHAIR = "[xmlns:role[contains(text(),'chair')]"\
68
+ CHAIR = "[xmlns:role[contains(text(),'chair')]" \
69
69
  "[not(contains(text(),'co-chair'))]]".freeze
70
70
 
71
71
  def list_cochairs(xml)
@@ -608,7 +608,7 @@ ul, ol {
608
608
  ul li {
609
609
  list-style: none; }
610
610
 
611
- ul li:before {
611
+ ul li::before {
612
612
  content: "—";
613
613
  display: inline-block;
614
614
  width: 1em;
@@ -632,7 +632,7 @@ ol ul > li:first-child {
632
632
  #toc-list li {
633
633
  list-style-type: none; }
634
634
 
635
- #toc li:before {
635
+ #toc li::before {
636
636
  content: " ";
637
637
  display: none; }
638
638
 
@@ -653,13 +653,13 @@ ol[class="alphabet"] > li {
653
653
  ol[class="alphabet"] ol[class="alphabet"] > li {
654
654
  list-style: inherit; }
655
655
 
656
- ol[class="alphabet"] > li:before {
656
+ ol[class="alphabet"] > li::before {
657
657
  counter-increment: alphabet;
658
658
  content: counter(alphabet, lower-alpha) ") ";
659
659
  position: absolute;
660
660
  left: -1.4em; }
661
661
 
662
- ol[class="alphabet"] ol[class="alphabet"] > li:before {
662
+ ol[class="alphabet"] ol[class="alphabet"] > li::before {
663
663
  counter-increment: none;
664
664
  content: initial; }
665
665
 
@@ -673,13 +673,13 @@ ol[class="roman"] > li {
673
673
  ol[class="roman"] ol[class="roman"] > li {
674
674
  list-style: inherit; }
675
675
 
676
- ol[class="roman"] > li:before {
676
+ ol[class="roman"] > li::before {
677
677
  counter-increment: roman;
678
678
  content: "(" counter(roman, lower-roman) ") ";
679
679
  position: absolute;
680
680
  left: -2.0em; }
681
681
 
682
- ol[class="roman"] ol[class="roman"] > li:before {
682
+ ol[class="roman"] ol[class="roman"] > li::before {
683
683
  counter-increment: none;
684
684
  content: initial; }
685
685