metanorma-bipm 0.0.5 → 1.0.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: acbf74f3d4254887e6ce398e2ffd5617b0761f01009fa4b1f320dc31d709d664
4
- data.tar.gz: 8c95ac2b9d1feebf1b51cc84bd9b7336c6ef3502789bf75fb66cdd4b8468a23e
3
+ metadata.gz: 1124fc9a829ea0ff6c013bbba40f1c24d3a3c832f032c3457618e5c111b80b1c
4
+ data.tar.gz: 0d321b641c701353e57d8f7666e769ef3eb4a429d14403682996ec908d434e96
5
5
  SHA512:
6
- metadata.gz: a47f5b9fe13ffda0d817d157c627282403055f14d6efaf4a2ba57462c883f8f6bf985b8ebb99ffed3f3fa5a3eac550d116087afaef0a12ccafa8783027a75c7c
7
- data.tar.gz: fb36934650d098544c1a338797ec1f368553aee70b43c1b0b141bad43a9193e549a9f2a78bf6ce053748aea27b00c369fcd4d0e2c16468f2fc5263db0d2e471e
6
+ metadata.gz: c6f9597091c23cfd4543d2a7c7085e464723344c46f321083dbabfb7e64ac00b55cf0104a76fe5c5f3b1904df2878656e036308dba3687574054ae4d9f3dcd52
7
+ data.tar.gz: f453d61d6c061490a1dd831c34350fb5aa98fef65766695c42c4c8e9534572d91a1d20324b9ba5b778a75cc3aa2fb0f73dca9bb3866462acf0338ada116d9b01
@@ -1,7 +1,7 @@
1
1
  <boilerplate>
2
2
  <copyright-statement>
3
3
  <clause>
4
- <p align="center"> © Bureau International des poids et mesures {{ docyear }} all rights reserved</p>
4
+ <p align="center"> © Bureau International des Poids et Mesures {{ docyear }} all rights reserved</p>
5
5
  </clause>
6
6
  </copyright-statement>
7
7
  <license-statement>
@@ -1,7 +1,7 @@
1
1
  <boilerplate>
2
2
  <copyright-statement>
3
3
  <clause>
4
- <p align="center"> © Bureau International des poids et mesures {{ docyear }} tous droits réservés</p>
4
+ <p align="center"> © Bureau international des poids et mesures {{ docyear }} tous droits réservés</p>
5
5
  </clause>
6
6
  </copyright-statement>
7
7
  <license-statement>
@@ -10,6 +10,18 @@ module Asciidoctor
10
10
  Metanorma::BIPM.configuration
11
11
  end
12
12
 
13
+ def org_name_long
14
+ configuration.organization_name_long[@lang]
15
+ end
16
+
17
+ def default_publisher
18
+ org_name_long
19
+ end
20
+
21
+ def org_abbrev
22
+ { org_name_long => configuration.organization_name_short }
23
+ end
24
+
13
25
  def metadata_committee(node, xml)
14
26
  return unless node.attr("committee-en") || node.attr("committee-fr")
15
27
  xml.editorialgroup do |a|
@@ -246,6 +246,9 @@
246
246
  <data type="boolean"/>
247
247
  </attribute>
248
248
  </optional>
249
+ <optional>
250
+ <ref name="colgroup"/>
251
+ </optional>
249
252
  <optional>
250
253
  <ref name="tname"/>
251
254
  </optional>
@@ -764,6 +767,18 @@
764
767
  </define>
765
768
  </include>
766
769
  <!-- end overrides -->
770
+ <define name="colgroup">
771
+ <element name="colgroup">
772
+ <oneOrMore>
773
+ <ref name="col"/>
774
+ </oneOrMore>
775
+ </element>
776
+ </define>
777
+ <define name="col">
778
+ <element name="col">
779
+ <attribute name="width"/>
780
+ </element>
781
+ </define>
767
782
  <define name="TextElement" combine="choice">
768
783
  <ref name="concept"/>
769
784
  </define>
@@ -101,7 +101,7 @@
101
101
 
102
102
 
103
103
 
104
- <xsl:variable name="independentAppendix" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix)"/>
104
+ <xsl:variable name="independentAppendix" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix)"/>
105
105
  <!-- <xsl:variable name="independentAppendix" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:title[@type = 'appendix'])"/> -->
106
106
 
107
107
  <xsl:variable name="doctype" select="//bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:doctype"/>
@@ -726,7 +726,7 @@
726
726
  </xsl:choose>
727
727
  </xsl:variable>
728
728
 
729
- <xsl:number value="$start_value + $curr_value" format="{$format}"/>
729
+ <xsl:number value="$start_value + $curr_value" format="{$format}" lang="en"/>
730
730
 
731
731
  </xsl:otherwise>
732
732
  </xsl:choose>
@@ -832,13 +832,15 @@
832
832
  <xsl:apply-templates select="bipm:boilerplate/bipm:license-statement"/>
833
833
 
834
834
  <fo:block-container absolute-position="fixed" top="200mm" height="69mm" font-family="Times New Roman" text-align="center" display-align="after">
835
- <xsl:apply-templates select="bipm:boilerplate/bipm:feedback-statement"/>
836
- <xsl:variable name="ISBN" select="normalize-space(bipm:bibdata/bipm:docidentifier[@type='ISBN'])"/>
837
- <xsl:if test="$ISBN != ''">
838
- <fo:block margin-top="15mm">
839
- <xsl:text>ISBN </xsl:text><xsl:value-of select="$ISBN"/>
840
- </fo:block>
841
- </xsl:if>
835
+ <fo:block>
836
+ <xsl:apply-templates select="bipm:boilerplate/bipm:feedback-statement"/>
837
+ <xsl:variable name="ISBN" select="normalize-space(bipm:bibdata/bipm:docidentifier[@type='ISBN'])"/>
838
+ <xsl:if test="$ISBN != ''">
839
+ <fo:block margin-top="15mm">
840
+ <xsl:text>ISBN </xsl:text><xsl:value-of select="$ISBN"/>
841
+ </fo:block>
842
+ </xsl:if>
843
+ </fo:block>
842
844
  </fo:block-container>
843
845
 
844
846
  </fo:flow>
@@ -1236,8 +1238,8 @@
1236
1238
 
1237
1239
  <fo:block-container absolute-position="fixed" left="12.5mm" top="60mm">
1238
1240
 
1239
- <fo:block font-size="22.2pt" font-weight="{$weight-normal}"><xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'main']"/></fo:block>
1240
- <fo:block font-size="22.2pt" font-weight="{$weight-bold}" margin-top="1mm"><xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'en' and @type = 'main']"/></fo:block>
1241
+ <fo:block font-size="22.2pt" font-weight="{$weight-normal}"><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'main']"/></fo:block>
1242
+ <fo:block font-size="22.2pt" font-weight="{$weight-bold}" margin-top="1mm"><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'main']"/></fo:block>
1241
1243
 
1242
1244
  <xsl:variable name="edition_str">édition</xsl:variable>
1243
1245
  <!-- <xsl:choose>
@@ -1245,63 +1247,25 @@
1245
1247
  <xsl:otherwise>edition</xsl:otherwise>
1246
1248
  </xsl:choose>
1247
1249
  </xsl:variable> -->
1248
- <fo:block font-size="14pt" font-weight="{$weight-bold}" margin-top="4mm"><xsl:value-of select="concat(/bipm:bipm-standard/bipm:bibdata/bipm:edition, ' ', $edition_str, ' ', $copyrightYear)"/></fo:block>
1250
+ <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>
1249
1251
  </fo:block-container>
1250
1252
 
1251
1253
  <fo:block-container height="98%" display-align="center">
1252
-
1253
- <!-- Appendix titles processing -->
1254
- <xsl:variable name="appendix_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix)"/>
1255
- <xsl:if test="$appendix_num != ''">
1256
- <fo:block font-size="17pt" font-weight="{$weight-normal}">Annexe <xsl:value-of select="$appendix_num"/></fo:block>
1257
- <fo:block font-size="17pt" font-weight="{$weight-bold}">Appendix <xsl:value-of select="$appendix_num"/></fo:block>
1258
- </xsl:if>
1259
-
1260
- <xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@type = 'appendix']">
1261
- <fo:block font-size="30.4pt">
1262
- <fo:block> </fo:block>
1263
- <fo:block font-weight="{$weight-normal}"><xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'appendix']"/></fo:block>
1264
- <fo:block> </fo:block>
1265
- <fo:block font-weight="{$weight-bold}">
1266
- <xsl:variable name="title_en" select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'en' and @type = 'appendix']"/>
1267
- <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1268
- <xsl:choose>
1269
- <xsl:when test="contains($title_en, $mep_text)">
1270
- <xsl:value-of select="substring-before($title_en, $mep_text)"/>
1271
- <xsl:text> </xsl:text><fo:inline font-style="italic"><xsl:value-of select="$mep_text"/></fo:inline><xsl:text> </xsl:text>
1272
- <xsl:value-of select="substring-after($title_en, $mep_text)"/>
1273
- </xsl:when>
1274
- <xsl:otherwise>
1275
- <xsl:value-of select="$title_en"/>
1276
- </xsl:otherwise>
1277
- </xsl:choose>
1278
- </fo:block>
1279
- </fo:block>
1280
- </xsl:if>
1281
- <!-- End Appendix titles processing -->
1282
-
1283
-
1284
- <!-- Part titles processing -->
1285
- <xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@type = 'part']">
1286
- <xsl:variable name="part_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:part)"/>
1287
- <xsl:if test="$part_num != ''">
1288
- <!-- Part -->
1289
- <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>
1290
- <!-- Partie -->
1291
- <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>
1254
+ <fo:block>
1255
+ <!-- Appendix titles processing -->
1256
+ <xsl:variable name="appendix_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:appendix)"/>
1257
+ <xsl:if test="$appendix_num != ''">
1258
+ <fo:block font-size="17pt" font-weight="{$weight-normal}">Annexe <xsl:value-of select="$appendix_num"/></fo:block>
1259
+ <fo:block font-size="17pt" font-weight="{$weight-bold}">Appendix <xsl:value-of select="$appendix_num"/></fo:block>
1292
1260
  </xsl:if>
1293
-
1294
- <fo:block font-size="30.4pt">
1295
-
1296
- <xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'part']">
1261
+
1262
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'appendix']">
1263
+ <fo:block font-size="30.4pt">
1297
1264
  <fo:block> </fo:block>
1298
- <fo:block font-weight="{$weight-normal}"><xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'part']"/></fo:block>
1299
- </xsl:if>
1300
-
1301
- <xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'en' and @type = 'part']">
1265
+ <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>
1302
1266
  <fo:block> </fo:block>
1303
1267
  <fo:block font-weight="{$weight-bold}">
1304
- <xsl:variable name="title_en" select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'en' and @type = 'part']"/>
1268
+ <xsl:variable name="title_en" select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'appendix']"/>
1305
1269
  <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1306
1270
  <xsl:choose>
1307
1271
  <xsl:when test="contains($title_en, $mep_text)">
@@ -1314,50 +1278,88 @@
1314
1278
  </xsl:otherwise>
1315
1279
  </xsl:choose>
1316
1280
  </fo:block>
1317
- </xsl:if>
1318
- </fo:block>
1319
- </xsl:if>
1320
- <!-- End Part titles processing -->
1321
-
1322
- <!-- Sub-part titles processing -->
1323
- <xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@type = 'subpart']">
1324
- <xsl:variable name="subpart_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:subpart)"/>
1325
- <xsl:if test="$subpart_num != ''">
1326
- <!-- Sub-part -->
1327
- <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>
1328
- <!-- Partie de sub -->
1329
- <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>
1281
+ </fo:block>
1330
1282
  </xsl:if>
1331
-
1332
- <fo:block font-size="30.4pt">
1333
-
1334
- <xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'subpart']">
1335
- <fo:block> </fo:block>
1336
- <fo:block font-weight="{$weight-normal}"><xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'subpart']"/></fo:block>
1283
+ <!-- End Appendix titles processing -->
1284
+
1285
+
1286
+ <!-- Part titles processing -->
1287
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'part']">
1288
+ <xsl:variable name="part_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:part)"/>
1289
+ <xsl:if test="$part_num != ''">
1290
+ <!-- Part -->
1291
+ <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>
1292
+ <!-- Partie -->
1293
+ <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>
1337
1294
  </xsl:if>
1338
-
1339
- <xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'en' and @type = 'subpart']">
1340
- <fo:block> </fo:block>
1341
- <fo:block font-weight="{$weight-bold}">
1342
- <xsl:variable name="title_en" select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = 'en' and @type = 'subpart']"/>
1343
- <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1344
- <xsl:choose>
1345
- <xsl:when test="contains($title_en, $mep_text)">
1346
- <xsl:value-of select="substring-before($title_en, $mep_text)"/>
1347
- <xsl:text> </xsl:text><fo:inline font-style="italic"><xsl:value-of select="$mep_text"/></fo:inline><xsl:text> </xsl:text>
1348
- <xsl:value-of select="substring-after($title_en, $mep_text)"/>
1349
- </xsl:when>
1350
- <xsl:otherwise>
1351
- <xsl:value-of select="$title_en"/>
1352
- </xsl:otherwise>
1353
- </xsl:choose>
1354
- </fo:block>
1295
+
1296
+ <fo:block font-size="30.4pt">
1297
+
1298
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'part']">
1299
+ <fo:block> </fo:block>
1300
+ <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>
1301
+ </xsl:if>
1302
+
1303
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'part']">
1304
+ <fo:block> </fo:block>
1305
+ <fo:block font-weight="{$weight-bold}">
1306
+ <xsl:variable name="title_en" select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'part']"/>
1307
+ <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1308
+ <xsl:choose>
1309
+ <xsl:when test="contains($title_en, $mep_text)">
1310
+ <xsl:value-of select="substring-before($title_en, $mep_text)"/>
1311
+ <xsl:text> </xsl:text><fo:inline font-style="italic"><xsl:value-of select="$mep_text"/></fo:inline><xsl:text> </xsl:text>
1312
+ <xsl:value-of select="substring-after($title_en, $mep_text)"/>
1313
+ </xsl:when>
1314
+ <xsl:otherwise>
1315
+ <xsl:value-of select="$title_en"/>
1316
+ </xsl:otherwise>
1317
+ </xsl:choose>
1318
+ </fo:block>
1319
+ </xsl:if>
1320
+ </fo:block>
1321
+ </xsl:if>
1322
+ <!-- End Part titles processing -->
1323
+
1324
+ <!-- Sub-part titles processing -->
1325
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@type = 'subpart']">
1326
+ <xsl:variable name="subpart_num" select="normalize-space((//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:subpart)"/>
1327
+ <xsl:if test="$subpart_num != ''">
1328
+ <!-- Sub-part -->
1329
+ <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>
1330
+ <!-- Partie de sub -->
1331
+ <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>
1355
1332
  </xsl:if>
1356
- </fo:block>
1357
- </xsl:if>
1358
- <!-- End Sub-part titles processing -->
1333
+
1334
+ <fo:block font-size="30.4pt">
1335
+
1336
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'fr' and @type = 'subpart']">
1337
+ <fo:block> </fo:block>
1338
+ <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>
1339
+ </xsl:if>
1340
+
1341
+ <xsl:if test="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'subpart']">
1342
+ <fo:block> </fo:block>
1343
+ <fo:block font-weight="{$weight-bold}">
1344
+ <xsl:variable name="title_en" select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:title[@language = 'en' and @type = 'subpart']"/>
1345
+ <xsl:variable name="mep_text" select="'Mise en pratique'"/>
1346
+ <xsl:choose>
1347
+ <xsl:when test="contains($title_en, $mep_text)">
1348
+ <xsl:value-of select="substring-before($title_en, $mep_text)"/>
1349
+ <xsl:text> </xsl:text><fo:inline font-style="italic"><xsl:value-of select="$mep_text"/></fo:inline><xsl:text> </xsl:text>
1350
+ <xsl:value-of select="substring-after($title_en, $mep_text)"/>
1351
+ </xsl:when>
1352
+ <xsl:otherwise>
1353
+ <xsl:value-of select="$title_en"/>
1354
+ </xsl:otherwise>
1355
+ </xsl:choose>
1356
+ </fo:block>
1357
+ </xsl:if>
1358
+ </fo:block>
1359
+ </xsl:if>
1360
+ <!-- End Sub-part titles processing -->
1359
1361
 
1360
-
1362
+ </fo:block>
1361
1363
  </fo:block-container>
1362
1364
 
1363
1365
  <!-- <fo:block-container>
@@ -1388,19 +1390,19 @@
1388
1390
 
1389
1391
  <fo:block-container absolute-position="fixed" left="12mm" top="242mm" height="42mm" width="140mm" display-align="after">
1390
1392
  <fo:block font-size="12pt">
1391
- <fo:block><xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:editorialgroup/bipm:committee/bipm:variant[@language = 'fr']"/></fo:block>
1392
- <fo:block><xsl:value-of select="/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:editorialgroup/bipm:committee/bipm:variant[@language = 'en']"/></fo:block>
1393
+ <fo:block><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:editorialgroup/bipm:committee/bipm:variant[@language = 'fr']"/></fo:block>
1394
+ <fo:block><xsl:value-of select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:ext/bipm:editorialgroup/bipm:committee/bipm:variant[@language = 'en']"/></fo:block>
1393
1395
  <fo:block> </fo:block>
1394
1396
  <!-- <fo:block>BIPM SI MEP S1</fo:block> -->
1395
1397
  <fo:block>
1396
1398
  <xsl:call-template name="printRevisionDate">
1397
- <xsl:with-param name="date" select="/bipm:bipm-standard/bipm:bibdata/bipm:version/bipm:revision-date"/>
1399
+ <xsl:with-param name="date" select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:version/bipm:revision-date"/>
1398
1400
  <xsl:with-param name="lang" select="'en'"/>
1399
1401
  </xsl:call-template>
1400
1402
  </fo:block>
1401
1403
  <fo:block>
1402
1404
  <xsl:call-template name="printRevisionDate">
1403
- <xsl:with-param name="date" select="/bipm:bipm-standard/bipm:bibdata/bipm:version/bipm:revision-date"/>
1405
+ <xsl:with-param name="date" select="(//bipm:bipm-standard)[1]/bipm:bibdata/bipm:version/bipm:revision-date"/>
1404
1406
  <xsl:with-param name="lang" select="'fr'"/>
1405
1407
  </xsl:call-template>
1406
1408
  </fo:block>
@@ -2852,8 +2854,8 @@
2852
2854
  <xsl:if test=".//bipm:fn">
2853
2855
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
2854
2856
  </xsl:if>
2855
- <!-- <xsl:call-template name="processBibitem"/> -->
2856
- <xsl:apply-templates/>
2857
+ <xsl:call-template name="processBibitem"/>
2858
+ <!-- <xsl:apply-templates /> -->
2857
2859
  </fo:block>
2858
2860
  </xsl:template>
2859
2861
 
@@ -2905,14 +2907,22 @@
2905
2907
  <fo:list-item-label end-indent="label-end()">
2906
2908
  <fo:block>
2907
2909
  <fo:inline>
2908
- <xsl:number format="1."/>
2910
+ <!-- <xsl:number format="1."/> -->
2911
+ <xsl:choose>
2912
+ <xsl:when test="bipm:docidentifier[@type='metanorma']">
2913
+ <xsl:value-of select="bipm:docidentifier[@type='metanorma']"/>
2914
+ </xsl:when>
2915
+ <xsl:otherwise>
2916
+ <xsl:number format="[1]"/>
2917
+ </xsl:otherwise>
2918
+ </xsl:choose>
2909
2919
  </fo:inline>
2910
2920
  </fo:block>
2911
2921
  </fo:list-item-label>
2912
2922
  <fo:list-item-body start-indent="body-start()">
2913
2923
  <fo:block>
2914
- <!-- <xsl:call-template name="processBibitem"/> -->
2915
- <xsl:apply-templates/>
2924
+ <xsl:call-template name="processBibitem"/>
2925
+ <!-- <xsl:apply-templates /> -->
2916
2926
  </fo:block>
2917
2927
  </fo:list-item-body>
2918
2928
  </fo:list-item>
@@ -2928,6 +2938,9 @@
2928
2938
  </fo:inline>
2929
2939
  </xsl:template>
2930
2940
 
2941
+ <xsl:template match="bipm:references/bipm:bibitem/bipm:docidentifier[@type='metanorma' and ../bipm:formattedref]"/>
2942
+
2943
+
2931
2944
  <xsl:template match="bipm:pagebreak">
2932
2945
  <fo:block break-after="page"/>
2933
2946
  <!-- <fo:block>&#xA0;</fo:block>
@@ -3047,7 +3060,7 @@
3047
3060
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
3048
3061
  </xsl:copy>
3049
3062
  <!-- <xsl:copy-of select="."/> -->
3050
- <mathml:mspace height="1.4ex"/>
3063
+ <mathml:mspace height="1.47ex"/>
3051
3064
  </xsl:template>
3052
3065
 
3053
3066
  <!-- set script minimal font-size -->
@@ -3579,7 +3592,7 @@
3579
3592
  </xsl:apply-templates>
3580
3593
  <xsl:choose>
3581
3594
  <xsl:when test="$ignoreReferenceFrom = 'true'"><xsl:value-of select="."/></xsl:when>
3582
- <xsl:otherwise><xsl:value-of select="."/>_<xsl:value-of select="$lang"/></xsl:otherwise>
3595
+ <xsl:otherwise><xsl:value-of select="."/>_<xsl:value-of select="$lang"/><xsl:if test="$doctype = 'guide'">_<xsl:number count="bipm:bipm-standard" level="any"/></xsl:if></xsl:otherwise>
3583
3596
  </xsl:choose>
3584
3597
  </xsl:copy>
3585
3598
  </xsl:template>
@@ -3595,7 +3608,7 @@
3595
3608
  </xsl:when>
3596
3609
  <xsl:when test="local-name() = 'id' or local-name() = 'bibitemid' or (local-name() = 'target' and local-name(..) = 'xref')">
3597
3610
  <xsl:attribute name="{local-name()}">
3598
- <xsl:value-of select="."/>_<xsl:value-of select="$lang"/>
3611
+ <xsl:value-of select="."/>_<xsl:value-of select="$lang"/><xsl:if test="$doctype = 'guide'">_<xsl:number count="bipm:bipm-standard" level="any"/></xsl:if>
3599
3612
  </xsl:attribute>
3600
3613
  </xsl:when>
3601
3614
  <xsl:otherwise>
@@ -4157,10 +4170,12 @@
4157
4170
 
4158
4171
 
4159
4172
  <xsl:variable name="colwidths">
4160
- <xsl:call-template name="calculate-column-widths">
4161
- <xsl:with-param name="cols-count" select="$cols-count"/>
4162
- <xsl:with-param name="table" select="$simple-table"/>
4163
- </xsl:call-template>
4173
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
4174
+ <xsl:call-template name="calculate-column-widths">
4175
+ <xsl:with-param name="cols-count" select="$cols-count"/>
4176
+ <xsl:with-param name="table" select="$simple-table"/>
4177
+ </xsl:call-template>
4178
+ </xsl:if>
4164
4179
  </xsl:variable>
4165
4180
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
4166
4181
 
@@ -4247,16 +4262,25 @@
4247
4262
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
4248
4263
  </xsl:if>
4249
4264
 
4250
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
4251
- <xsl:choose>
4252
- <xsl:when test=". = 1 or . = 0">
4253
- <fo:table-column column-width="proportional-column-width(2)"/>
4254
- </xsl:when>
4255
- <xsl:otherwise>
4256
- <fo:table-column column-width="proportional-column-width({.})"/>
4257
- </xsl:otherwise>
4258
- </xsl:choose>
4259
- </xsl:for-each>
4265
+ <xsl:choose>
4266
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
4267
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
4268
+ <fo:table-column column-width="{@width}"/>
4269
+ </xsl:for-each>
4270
+ </xsl:when>
4271
+ <xsl:otherwise>
4272
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
4273
+ <xsl:choose>
4274
+ <xsl:when test=". = 1 or . = 0">
4275
+ <fo:table-column column-width="proportional-column-width(2)"/>
4276
+ </xsl:when>
4277
+ <xsl:otherwise>
4278
+ <fo:table-column column-width="proportional-column-width({.})"/>
4279
+ </xsl:otherwise>
4280
+ </xsl:choose>
4281
+ </xsl:for-each>
4282
+ </xsl:otherwise>
4283
+ </xsl:choose>
4260
4284
 
4261
4285
  <xsl:choose>
4262
4286
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -4269,10 +4293,12 @@
4269
4293
 
4270
4294
  </fo:table>
4271
4295
 
4296
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
4272
4297
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
4273
4298
  <xsl:call-template name="insertTableFooterInSeparateTable">
4274
4299
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
4275
4300
  <xsl:with-param name="colwidths" select="$colwidths"/>
4301
+ <xsl:with-param name="colgroup" select="$colgroup"/>
4276
4302
  </xsl:call-template>
4277
4303
  </xsl:for-each>
4278
4304
 
@@ -4532,12 +4558,22 @@
4532
4558
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
4533
4559
  <xsl:param name="table_attributes"/>
4534
4560
  <xsl:param name="colwidths"/>
4561
+ <xsl:param name="colgroup"/>
4535
4562
 
4536
4563
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
4537
4564
 
4538
4565
  <xsl:if test="$isNoteOrFnExist = 'true'">
4539
4566
 
4540
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
4567
+ <xsl:variable name="cols-count">
4568
+ <xsl:choose>
4569
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
4570
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
4571
+ </xsl:when>
4572
+ <xsl:otherwise>
4573
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
4574
+ </xsl:otherwise>
4575
+ </xsl:choose>
4576
+ </xsl:variable>
4541
4577
 
4542
4578
  <fo:table keep-with-previous="always">
4543
4579
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -4555,16 +4591,25 @@
4555
4591
  </xsl:choose>
4556
4592
  </xsl:for-each>
4557
4593
 
4558
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
4559
- <xsl:choose>
4560
- <xsl:when test=". = 1 or . = 0">
4561
- <fo:table-column column-width="proportional-column-width(2)"/>
4562
- </xsl:when>
4563
- <xsl:otherwise>
4564
- <fo:table-column column-width="proportional-column-width({.})"/>
4565
- </xsl:otherwise>
4566
- </xsl:choose>
4567
- </xsl:for-each>
4594
+ <xsl:choose>
4595
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
4596
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
4597
+ <fo:table-column column-width="{@width}"/>
4598
+ </xsl:for-each>
4599
+ </xsl:when>
4600
+ <xsl:otherwise>
4601
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
4602
+ <xsl:choose>
4603
+ <xsl:when test=". = 1 or . = 0">
4604
+ <fo:table-column column-width="proportional-column-width(2)"/>
4605
+ </xsl:when>
4606
+ <xsl:otherwise>
4607
+ <fo:table-column column-width="proportional-column-width({.})"/>
4608
+ </xsl:otherwise>
4609
+ </xsl:choose>
4610
+ </xsl:for-each>
4611
+ </xsl:otherwise>
4612
+ </xsl:choose>
4568
4613
 
4569
4614
  <fo:table-body>
4570
4615
  <fo:table-row>
@@ -6852,7 +6897,8 @@
6852
6897
  <fo:table-column column-width="107mm"/>
6853
6898
  <fo:table-column column-width="15mm"/>
6854
6899
  <fo:table-body>
6855
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
6900
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
6901
+
6856
6902
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
6857
6903
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
6858
6904
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -6870,6 +6916,38 @@
6870
6916
  <fo:block><xsl:apply-templates/></fo:block>
6871
6917
  </fo:table-cell>
6872
6918
  </xsl:template><xsl:template name="processBibitem">
6919
+
6920
+
6921
+ <!-- start BIPM bibtem processing -->
6922
+ <xsl:choose>
6923
+ <xsl:when test="*[local-name() = 'formattedref']">
6924
+ <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
6925
+ </xsl:when>
6926
+ <xsl:otherwise>
6927
+ <xsl:variable name="docidentifier" select="*[local-name() = 'docidentifier'][not(@type = 'URN' or @type = 'metanorma' or @type = 'BIPM' or @type = 'ISBN' or @type = 'ISSN')]"/>
6928
+
6929
+ <xsl:value-of select="$docidentifier"/>
6930
+ <xsl:if test="$docidentifier != '' and *[local-name() = 'title']">, </xsl:if>
6931
+
6932
+ <xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language"/>
6933
+
6934
+ <xsl:choose>
6935
+ <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = $curr_lang]">
6936
+ <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = $curr_lang]"/>
6937
+ </xsl:when>
6938
+ <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']">
6939
+ <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/>
6940
+ </xsl:when>
6941
+ <xsl:otherwise>
6942
+ <xsl:apply-templates select="*[local-name() = 'title']"/>
6943
+ </xsl:otherwise>
6944
+ </xsl:choose>
6945
+
6946
+ </xsl:otherwise>
6947
+ </xsl:choose>
6948
+
6949
+ <!-- end BIPM bibitem processing-->
6950
+
6873
6951
 
6874
6952
 
6875
6953