metanorma-bipm 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1127,18 +1127,22 @@
1127
1127
  <fo:block-container font-size="18pt" font-weight="bold" text-align="center">
1128
1128
  <fo:block>
1129
1129
 
1130
- <xsl:variable name="title">
1131
- <xsl:choose>
1132
- <xsl:when test="$independentAppendix != ''">
1133
- <xsl:value-of select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='appendix']"/>
1134
- </xsl:when>
1135
- <xsl:otherwise> <!-- doctype = 'guide' -->
1136
- <xsl:value-of select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='main']"/>
1137
- </xsl:otherwise>
1138
- </xsl:choose>
1139
- </xsl:variable>
1130
+ <!-- <xsl:variable name="title"> -->
1131
+ <xsl:choose>
1132
+ <xsl:when test="$independentAppendix != ''">
1133
+ <xsl:apply-templates select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='appendix']" mode="title"/>
1134
+ <fo:block>
1135
+ <xsl:apply-templates select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='annex']" mode="title"/>
1136
+ </fo:block>
1137
+ </xsl:when>
1138
+ <xsl:otherwise> <!-- doctype = 'guide' -->
1139
+ <xsl:apply-templates select="//bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type='main']" mode="title"/>
1140
+ </xsl:otherwise>
1141
+ </xsl:choose>
1142
+ <!-- </xsl:variable> -->
1140
1143
 
1141
- <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1144
+
1145
+ <!-- <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1142
1146
 
1143
1147
  <xsl:choose>
1144
1148
  <xsl:when test="$curr_lang = 'en' and contains($title, $mep_text)">
@@ -1149,7 +1153,7 @@
1149
1153
  <xsl:otherwise>
1150
1154
  <xsl:value-of select="$title"/>
1151
1155
  </xsl:otherwise>
1152
- </xsl:choose>
1156
+ </xsl:choose> -->
1153
1157
 
1154
1158
  </fo:block>
1155
1159
 
@@ -1161,7 +1165,7 @@
1161
1165
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang=$curr_lang]),'#',$part_num)"/>
1162
1166
  </xsl:if>
1163
1167
  <xsl:text>: </xsl:text>
1164
- <xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part']"/>
1168
+ <xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part']" mode="title"/>
1165
1169
  </fo:block>
1166
1170
  </xsl:if>
1167
1171
  <xsl:variable name="subpart_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:subpart)"/>
@@ -1171,7 +1175,7 @@
1171
1175
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang=$curr_lang]),'#',$subpart_num)"/>
1172
1176
  </xsl:if>
1173
1177
  <xsl:text>: </xsl:text>
1174
- <xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart']"/>
1178
+ <xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart']" mode="title"/>
1175
1179
  </fo:block>
1176
1180
  </xsl:if>
1177
1181
 
@@ -1354,71 +1358,130 @@
1354
1358
  <fo:block font-size="14pt" font-weight="{$weight-bold}" margin-top="4mm"><xsl:value-of select="concat((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:edition, ' ', $edition_str, ' ', $copyrightYear)"/></fo:block>
1355
1359
  </fo:block-container>
1356
1360
 
1357
- <fo:block-container height="98%" display-align="center">
1361
+ <!-- <fo:block-container height="98%" display-align="center"> -->
1362
+ <fo:block-container absolute-position="fixed" left="12.5mm" top="92mm" height="170mm" width="144mm" display-align="center">
1358
1363
  <fo:block>
1364
+
1365
+ <xsl:variable name="title_appendix_fr">
1366
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'appendix']" mode="title"/>
1367
+ </xsl:variable>
1368
+ <xsl:variable name="title_appendix_en">
1369
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'appendix']" mode="title"/>
1370
+ </xsl:variable>
1371
+ <xsl:variable name="title_annex_fr">
1372
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'annex']" mode="title"/>
1373
+ </xsl:variable>
1374
+ <xsl:variable name="title_annex_en">
1375
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'annex']" mode="title"/>
1376
+ </xsl:variable>
1377
+ <xsl:variable name="title_part_fr">
1378
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'part']" mode="title"/>
1379
+ </xsl:variable>
1380
+ <xsl:variable name="title_part_en">
1381
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'part']" mode="title"/>
1382
+ </xsl:variable>
1383
+ <xsl:variable name="title_subpart_fr">
1384
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'subpart']" mode="title"/>
1385
+ </xsl:variable>
1386
+ <xsl:variable name="title_subpart_en">
1387
+ <xsl:apply-templates select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'subpart']" mode="title"/>
1388
+ </xsl:variable>
1389
+
1390
+ <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)"/>
1391
+
1392
+ <xsl:variable name="font-size-number-factor">
1393
+ <xsl:choose>
1394
+ <xsl:when test="$titles_length &gt; 350">0.7</xsl:when>
1395
+ <xsl:when test="$titles_length &gt; 250">0.85</xsl:when>
1396
+ <xsl:otherwise>1</xsl:otherwise>
1397
+ </xsl:choose>
1398
+ </xsl:variable>
1399
+
1400
+ <xsl:variable name="space-factor">
1401
+ <xsl:choose>
1402
+ <xsl:when test="$titles_length &gt; 250">0.3</xsl:when>
1403
+ <xsl:otherwise>1</xsl:otherwise>
1404
+ </xsl:choose>
1405
+ </xsl:variable>
1406
+
1407
+ <xsl:variable name="font-size-factor">
1408
+ <xsl:choose>
1409
+ <xsl:when test="$titles_length &gt; 350">0.5</xsl:when>
1410
+ <xsl:when test="$titles_length &gt; 250">0.65</xsl:when>
1411
+ <xsl:otherwise>1</xsl:otherwise>
1412
+ </xsl:choose>
1413
+ </xsl:variable>
1414
+
1359
1415
  <!-- Appendix titles processing -->
1360
1416
  <xsl:variable name="appendix_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix)"/>
1361
1417
  <xsl:if test="$appendix_num != ''">
1362
- <fo:block font-size="17pt" font-weight="{$weight-normal}">Annexe <xsl:value-of select="$appendix_num"/></fo:block>
1363
- <fo:block font-size="17pt" font-weight="{$weight-bold}">Appendix <xsl:value-of select="$appendix_num"/></fo:block>
1418
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-normal}">Annexe <xsl:value-of select="$appendix_num"/></fo:block>
1419
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-bold}">Appendix <xsl:value-of select="$appendix_num"/></fo:block>
1364
1420
  </xsl:if>
1365
-
1421
+
1422
+
1366
1423
  <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'appendix']">
1367
- <fo:block font-size="30.4pt">
1368
- <fo:block> </fo:block>
1369
- <fo:block font-weight="{$weight-normal}"><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'appendix']"/></fo:block>
1370
- <fo:block> </fo:block>
1424
+ <fo:block font-size="{$font-size-factor * 30.4}pt">
1425
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1426
+ <fo:block font-weight="{$weight-normal}"><xsl:copy-of select="$title_appendix_fr"/></fo:block>
1427
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1371
1428
  <fo:block font-weight="{$weight-bold}">
1372
- <xsl:variable name="title_en" select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'appendix']"/>
1373
- <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1374
- <xsl:choose>
1375
- <xsl:when test="contains($title_en, $mep_text)">
1376
- <xsl:value-of select="substring-before($title_en, $mep_text)"/>
1377
- <xsl:text> </xsl:text><fo:inline font-style="italic"><xsl:value-of select="$mep_text"/></fo:inline><xsl:text> </xsl:text>
1378
- <xsl:value-of select="substring-after($title_en, $mep_text)"/>
1379
- </xsl:when>
1380
- <xsl:otherwise>
1381
- <xsl:value-of select="$title_en"/>
1382
- </xsl:otherwise>
1383
- </xsl:choose>
1429
+ <xsl:copy-of select="$title_appendix_en"/>
1384
1430
  </fo:block>
1385
1431
  </fo:block>
1386
1432
  </xsl:if>
1387
1433
  <!-- End Appendix titles processing -->
1388
1434
 
1435
+ <!-- Annex title processing -->
1436
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'annex']">
1437
+ <xsl:variable name="annex_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:annexid)"/>
1438
+ <xsl:if test="$annex_num != ''">
1439
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1440
+ <!-- Annexe -->
1441
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-normal}">Annexe <xsl:value-of select="$annex_num"/></fo:block>
1442
+ <!-- Annex -->
1443
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-bold}">Annex <xsl:value-of select="$annex_num"/></fo:block>
1444
+ </xsl:if>
1445
+
1446
+ <fo:block font-size="{$font-size-factor * 30.4}pt">
1447
+
1448
+ <xsl:if test="normalize-space($title_annex_fr) != ''">
1449
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1450
+ <fo:block font-weight="{$weight-normal}"><xsl:copy-of select="$title_annex_fr"/></fo:block>
1451
+ </xsl:if>
1452
+
1453
+ <xsl:if test="normalize-space($title_annex_en) != ''">
1454
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1455
+ <fo:block font-weight="{$weight-bold}">
1456
+ <xsl:copy-of select="$title_annex_en"/>
1457
+ </fo:block>
1458
+ </xsl:if>
1459
+ </fo:block>
1460
+ </xsl:if>
1461
+ <!-- End Annex titles processing -->
1389
1462
 
1390
- <!-- Part titles processing -->
1463
+ <!-- Part titles processing -->
1391
1464
  <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'part']">
1392
1465
  <xsl:variable name="part_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:part)"/>
1393
1466
  <xsl:if test="$part_num != ''">
1467
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1394
1468
  <!-- Part -->
1395
- <fo:block font-size="17pt" font-weight="{$weight-normal}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='fr']),'#',$part_num)"/></fo:block>
1469
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-normal}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='fr']),'#',$part_num)"/></fo:block>
1396
1470
  <!-- Partie -->
1397
- <fo:block font-size="17pt" font-weight="{$weight-bold}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='en']),'#',$part_num)"/></fo:block>
1471
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-bold}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='en']),'#',$part_num)"/></fo:block>
1398
1472
  </xsl:if>
1399
1473
 
1400
- <fo:block font-size="30.4pt">
1474
+ <fo:block font-size="{$font-size-factor * 30.4}pt">
1401
1475
 
1402
- <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'part']">
1403
- <fo:block> </fo:block>
1404
- <fo:block font-weight="{$weight-normal}"><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'part']"/></fo:block>
1476
+ <xsl:if test="normalize-space($title_part_fr) != ''">
1477
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1478
+ <fo:block font-weight="{$weight-normal}"><xsl:copy-of select="$title_part_fr"/></fo:block>
1405
1479
  </xsl:if>
1406
1480
 
1407
- <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'part']">
1408
- <fo:block> </fo:block>
1481
+ <xsl:if test="normalize-space($title_part_en) != ''">
1482
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1409
1483
  <fo:block font-weight="{$weight-bold}">
1410
- <xsl:variable name="title_en" select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'part']"/>
1411
- <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1412
- <xsl:choose>
1413
- <xsl:when test="contains($title_en, $mep_text)">
1414
- <xsl:value-of select="substring-before($title_en, $mep_text)"/>
1415
- <xsl:text> </xsl:text><fo:inline font-style="italic"><xsl:value-of select="$mep_text"/></fo:inline><xsl:text> </xsl:text>
1416
- <xsl:value-of select="substring-after($title_en, $mep_text)"/>
1417
- </xsl:when>
1418
- <xsl:otherwise>
1419
- <xsl:value-of select="$title_en"/>
1420
- </xsl:otherwise>
1421
- </xsl:choose>
1484
+ <xsl:copy-of select="$title_part_en"/>
1422
1485
  </fo:block>
1423
1486
  </xsl:if>
1424
1487
  </fo:block>
@@ -1429,34 +1492,25 @@
1429
1492
  <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'subpart']">
1430
1493
  <xsl:variable name="subpart_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:subpart)"/>
1431
1494
  <xsl:if test="$subpart_num != ''">
1495
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1432
1496
  <!-- Sub-part -->
1433
- <fo:block font-size="17pt" font-weight="{$weight-normal}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang='fr']),'#',$subpart_num)"/> <xsl:value-of select="$subpart_num"/></fo:block>
1497
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-normal}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang='fr']),'#',$subpart_num)"/> <xsl:value-of select="$subpart_num"/></fo:block>
1434
1498
  <!-- Partie de sub -->
1435
- <fo:block font-size="17pt" font-weight="{$weight-bold}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang='en']),'#',$subpart_num)"/> <xsl:value-of select="$subpart_num"/></fo:block>
1499
+ <fo:block font-size="{$font-size-number-factor * 17}pt" font-weight="{$weight-bold}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang='en']),'#',$subpart_num)"/> <xsl:value-of select="$subpart_num"/></fo:block>
1436
1500
  </xsl:if>
1437
1501
 
1438
- <fo:block font-size="30.4pt">
1502
+ <fo:block font-size="{$font-size-factor * 30.4}pt">
1439
1503
 
1440
- <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'subpart']">
1441
- <fo:block> </fo:block>
1442
- <fo:block font-weight="{$weight-normal}"><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'subpart']"/></fo:block>
1504
+ <xsl:if test="normalize-space($title_subpart_fr) != ''">
1505
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1506
+ <fo:block font-weight="{$weight-normal}"><xsl:copy-of select="$title_subpart_fr"/></fo:block>
1443
1507
  </xsl:if>
1444
1508
 
1445
- <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'subpart']">
1446
- <fo:block> </fo:block>
1509
+ <xsl:if test="normalize-space($title_subpart_en) != ''">
1510
+ <fo:block font-size="{$space-factor * 30.4}pt"> </fo:block>
1447
1511
  <fo:block font-weight="{$weight-bold}">
1448
- <xsl:variable name="title_en" select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'subpart']"/>
1449
- <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1450
- <xsl:choose>
1451
- <xsl:when test="contains($title_en, $mep_text)">
1452
- <xsl:value-of select="substring-before($title_en, $mep_text)"/>
1453
- <xsl:text> </xsl:text><fo:inline font-style="italic"><xsl:value-of select="$mep_text"/></fo:inline><xsl:text> </xsl:text>
1454
- <xsl:value-of select="substring-after($title_en, $mep_text)"/>
1455
- </xsl:when>
1456
- <xsl:otherwise>
1457
- <xsl:value-of select="$title_en"/>
1458
- </xsl:otherwise>
1459
- </xsl:choose>
1512
+ <xsl:copy-of select="$title_subpart_en"/>
1513
+
1460
1514
  </fo:block>
1461
1515
  </xsl:if>
1462
1516
  </fo:block>
@@ -1619,6 +1673,24 @@
1619
1673
  </xsl:template>
1620
1674
  <!-- End Cover Pages -->
1621
1675
 
1676
+
1677
+ <xsl:template match="bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'en']/text()" priority="3">
1678
+ <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1679
+ <xsl:choose>
1680
+ <xsl:when test="contains(., $mep_text)">
1681
+ <xsl:value-of select="substring-before(., $mep_text)"/>
1682
+ <xsl:text> </xsl:text><fo:inline font-style="italic"><xsl:value-of select="$mep_text"/></fo:inline><xsl:text> </xsl:text>
1683
+ <xsl:value-of select="substring-after(., $mep_text)"/>
1684
+ </xsl:when>
1685
+ <xsl:otherwise>
1686
+ <xsl:value-of select="."/>
1687
+ </xsl:otherwise>
1688
+ </xsl:choose>
1689
+ </xsl:template>
1690
+
1691
+
1692
+
1693
+
1622
1694
  <xsl:template name="insertSeparatorPage">
1623
1695
  <!-- 3 Pages with BIPM Metro logo -->
1624
1696
  <fo:page-sequence master-reference="document" force-page-count="no-force">
@@ -4578,7 +4650,12 @@
4578
4650
 
4579
4651
  <xsl:variable name="table_attributes">
4580
4652
  <attribute name="table-layout">fixed</attribute>
4581
- <attribute name="width">100%</attribute>
4653
+ <attribute name="width">
4654
+ <xsl:choose>
4655
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
4656
+ <xsl:otherwise>100%</xsl:otherwise>
4657
+ </xsl:choose>
4658
+ </attribute>
4582
4659
  <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
4583
4660
  <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
4584
4661
 
@@ -5111,7 +5188,7 @@
5111
5188
 
5112
5189
  <xsl:attribute name="font-weight">normal</xsl:attribute>
5113
5190
  <xsl:attribute name="border">solid black 0pt</xsl:attribute>
5114
- <xsl:attribute name="border-top">solid black 0.5pt</xsl:attribute>
5191
+ <!-- <xsl:attribute name="border-top">solid black 0.5pt</xsl:attribute> -->
5115
5192
  <xsl:attribute name="border-bottom">solid black 0.5pt</xsl:attribute>
5116
5193
  <xsl:attribute name="height">8mm</xsl:attribute>
5117
5194
  <xsl:attribute name="padding-top">2mm</xsl:attribute>
@@ -5826,6 +5903,10 @@
5826
5903
  </xsl:if>
5827
5904
  <xsl:apply-templates/>
5828
5905
  </fo:inline>
5906
+ </xsl:template><xsl:template match="*[local-name()='underline']">
5907
+ <fo:inline text-decoration="underline">
5908
+ <xsl:apply-templates/>
5909
+ </fo:inline>
5829
5910
  </xsl:template><xsl:template match="*[local-name()='del']">
5830
5911
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
5831
5912
  <xsl:apply-templates/>
@@ -7454,6 +7535,8 @@
7454
7535
  <xsl:value-of select="translate(.,'. ','')"/>
7455
7536
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
7456
7537
  <xsl:value-of select="substring(.,1,1)"/>
7538
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
7539
+ <fo:inline><xsl:apply-templates/></fo:inline>
7457
7540
  </xsl:template><xsl:template name="convertDate">
7458
7541
  <xsl:param name="date"/>
7459
7542
  <xsl:param name="format" select="'short'"/>
@@ -7733,6 +7816,11 @@
7733
7816
  <xsl:call-template name="getLang"/>
7734
7817
  </xsl:variable>
7735
7818
 
7736
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
7819
+ <xsl:choose>
7820
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
7821
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
7822
+ </xsl:when>
7823
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
7824
+ </xsl:choose>
7737
7825
 
7738
7826
  </xsl:template></xsl:stylesheet>
@@ -37,6 +37,8 @@
37
37
  {% if subpartsubtitle %}<span class="title-second">{{ subpartsubtitle }}</span><br/>{% endif %}
38
38
  {% if appendixid %}<span class="title-first">{{ appendixid}}: {{ appendixtitle }}</span><br/>{% endif %}
39
39
  {% if appendixid_alt %}<span class="title-second">{{ appendixid_alt}}: {{ appendixsubtitle }}</span>{% endif %}
40
+ {% if annexid %}<span class="title-first">{{ annexid}}: {{ annextitle }}</span><br/>{% endif %}
41
+ {% if annexid_alt %}<span class="title-second">{{ annexid_alt}}: {{ annexsubtitle }}</span>{% endif %}
40
42
  {% else %}
41
43
  <span class="title-first">{{ doctitle }}</span><br/>
42
44
  <span class="title-second">{{ docsubtitle }}</span>
@@ -29,7 +29,7 @@ module IsoDoc
29
29
  ns("#{TITLE}[@type='main'][@language='#{lang1}']"))&.text || ""))
30
30
  set(:docsubtitle, @c.encode(isoxml&.at(
31
31
  ns("#{TITLE}[@type='main'][@language='#{lang2}']"))&.text || ""))
32
- %w(appendix part subtitle).each do |e|
32
+ %w(appendix annex part subtitle).each do |e|
33
33
  set("#{e}title".to_sym, @c.encode(isoxml&.at(
34
34
  ns("#{TITLE}[@type='#{e}'][@language='#{lang1}']"))&.text || ""))
35
35
  set("#{e}subtitle".to_sym, @c.encode(isoxml&.at(
@@ -51,6 +51,10 @@ module IsoDoc
51
51
  dn = isoxml.at(ns("//bibdata/ext/structuredidentifier/appendix"))
52
52
  dn and set(:appendixid, @i18n.l10n("#{label1} #{dn&.text}"))
53
53
  dn and set(:appendixid_alt, @i18n.l10n("#{label2} #{dn&.text}"))
54
+ label1, label2 = @lang == "fr" ? %w(Appendice Annex) : %w(Annex Appendice)
55
+ dn = isoxml.at(ns("//bibdata/ext/structuredidentifier/annexid"))
56
+ dn and set(:annexid, @i18n.l10n("#{label1} #{dn&.text}"))
57
+ dn and set(:annexid_alt, @i18n.l10n("#{label2} #{dn&.text}"))
54
58
  label1, label2 = @lang == "fr" ? %w(Partie Part) : %w(Part Partie)
55
59
  dn = isoxml.at(ns("//bibdata/ext/structuredidentifier/part"))
56
60
  dn and set(:partid, @i18n.l10n("#{label1} #{dn&.text}"))
@@ -1,17 +1,20 @@
1
1
  module IsoDoc
2
2
  module BIPM
3
+ class Counter < IsoDoc::XrefGen::Counter
4
+ end
5
+
3
6
  class Xref < IsoDoc::Xref
4
7
  def initialize(lang, script, klass, i18n, options = {})
5
8
  super
6
9
  end
7
10
 
8
11
  def clause_names(docxml, sect_num)
9
- sect_num = 0
12
+ n = Counter.new
10
13
  docxml.xpath(ns("//sections/clause[not(@unnumbered = 'true')] | "\
11
14
  "//sections/terms[not(@unnumbered = 'true')] | "\
12
15
  "//sections/definitions[not(@unnumbered = 'true')]")).
13
- each_with_index do |c, i|
14
- section_names(c, (i + sect_num), 1)
16
+ each do |c|
17
+ section_names(c, n, 1)
15
18
  end
16
19
  docxml.xpath(ns("//sections/clause[@unnumbered = 'true'] | "\
17
20
  "//sections/terms[@unnumbered = 'true'] | "\
@@ -35,12 +38,14 @@ module IsoDoc
35
38
 
36
39
  def section_names(clause, num, lvl)
37
40
  return num if clause.nil?
38
- num = num + 1
41
+ num.increment(clause)
39
42
  @anchors[clause["id"]] =
40
- { label: num.to_s, xref: l10n("#{@labels["clause"]} #{num}"),
43
+ { label: num.print, xref: l10n("#{@labels["clause"]} #{num.print}"),
41
44
  level: lvl, type: "clause" }
42
- clause.xpath(ns(NUMBERED_SUBCLAUSES)).each_with_index do |c, i|
43
- section_names1(c, "#{num}.#{i + 1}", lvl + 1)
45
+ i = Counter.new
46
+ clause.xpath(ns(NUMBERED_SUBCLAUSES)).each do |c|
47
+ i.increment(c)
48
+ section_names1(c, "#{num.print}.#{i.print}", lvl + 1)
44
49
  end
45
50
  clause.xpath(ns(UNNUMBERED_SUBCLAUSES)).each_with_index do |c, i|
46
51
  unnumbered_section_names1(c, lvl + 1)
@@ -62,8 +67,10 @@ module IsoDoc
62
67
  @anchors[clause["id"]] =
63
68
  { label: num, level: level, xref: l10n("#{@labels["subclause"]} #{num}"),
64
69
  type: "clause" }
65
- clause.xpath(ns(NUMBERED_SUBCLAUSES)).each_with_index do |c, i|
66
- section_names1(c, "#{num}.#{i + 1}", level + 1)
70
+ i = Counter.new
71
+ clause.xpath(ns(NUMBERED_SUBCLAUSES)).each do |c|
72
+ i.increment(c)
73
+ section_names1(c, "#{num}.#{i.print}", level + 1)
67
74
  end
68
75
  clause.xpath(ns(UNNUMBERED_SUBCLAUSES)).each_with_index do |c, i|
69
76
  unnumbered_section_names1(c, lvl + 1)
@@ -96,8 +103,10 @@ module IsoDoc
96
103
  if a = single_annex_special_section(clause)
97
104
  annex_names1(a, "#{num}", 1)
98
105
  else
99
- clause.xpath(ns(NUMBERED_SUBCLAUSES)).each_with_index do |c, i|
100
- annex_names1(c, "#{num}.#{i + 1}", 2)
106
+ i = Counter.new
107
+ clause.xpath(ns(NUMBERED_SUBCLAUSES)).each do |c|
108
+ i.increment(c)
109
+ annex_names1(c, "#{num}.#{i.print}", 2)
101
110
  end
102
111
  clause.xpath(ns(UNNUMBERED_SUBCLAUSES)).each do |c|
103
112
  unnumbered_annex_names1(c, 2)
@@ -125,8 +134,10 @@ module IsoDoc
125
134
  @anchors[clause["id"]] =
126
135
  { label: num, xref: l10n("#{@annexlbl} #{num}"),
127
136
  level: level, type: "clause" }
128
- clause.xpath(ns(NUMBERED_SUBCLAUSES)).each_with_index do |c, i|
129
- annex_names1(c, "#{num}.#{i + 1}", level + 1)
137
+ i = Counter.new
138
+ clause.xpath(ns(NUMBERED_SUBCLAUSES)).each do |c|
139
+ i.increment(c)
140
+ annex_names1(c, "#{num}.#{i.print}", level + 1)
130
141
  end
131
142
  clause.xpath(ns(UNNUMBERED_SUBCLAUSES)).each do |c|
132
143
  unnumbered_annex_names1(c, level + 1)