metanorma-bipm 2.5.9 → 2.5.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -1524,8 +1524,9 @@
1524
1524
  </xsl:template>
1525
1525
 
1526
1526
  <!-- allow cross-align for element title -->
1527
- <xsl:template match="jcgm:sections//jcgm:title | jcgm:annex//jcgm:title" mode="flatxml_step1">
1528
- <xsl:copy>
1527
+ <xsl:template match="jcgm:sections//jcgm:title | jcgm:annex//jcgm:title" mode="flatxml_step1"/>
1528
+ <xsl:template match="jcgm:sections//jcgm:fmt-title | jcgm:annex//jcgm:fmt-title" mode="flatxml_step1">
1529
+ <xsl:element name="title" namespace="{$namespace_full}">
1529
1530
  <xsl:apply-templates select="@*" mode="flatxml_step1"/>
1530
1531
  <xsl:call-template name="setCrossAlignAttributes"/>
1531
1532
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
@@ -1536,7 +1537,7 @@
1536
1537
  <xsl:copy-of select="../@inline-header"/>
1537
1538
  </xsl:if>
1538
1539
  <xsl:apply-templates mode="flatxml_step1"/>
1539
- </xsl:copy>
1540
+ </xsl:element>
1540
1541
  </xsl:template>
1541
1542
 
1542
1543
  <xsl:template match="*[local-name()='annex']" mode="flatxml_step1">
@@ -1613,7 +1614,8 @@
1613
1614
  <term><name>...</name></term>
1614
1615
  To:
1615
1616
  <term><term_name>...</term_name></term> -->
1616
- <xsl:template match="jcgm:term/jcgm:name" mode="flatxml_step1">
1617
+ <xsl:template match="jcgm:term/jcgm:name" mode="flatxml_step1"/>
1618
+ <xsl:template match="jcgm:term/jcgm:fmt-name" mode="flatxml_step1">
1617
1619
  <xsl:element name="term_name" namespace="https://www.metanorma.org/ns/bipm">
1618
1620
  <xsl:apply-templates select="@*" mode="flatxml_step1"/>
1619
1621
  <xsl:call-template name="setCrossAlignAttributes"/>
@@ -1640,7 +1642,8 @@
1640
1642
  </xsl:template>
1641
1643
 
1642
1644
  <!-- allow cross-align for element p, note, termsource, table, figure, li (and set label) -->
1643
- <xsl:template match="jcgm:sections//jcgm:p | jcgm:sections//jcgm:note | jcgm:sections//jcgm:termsource | jcgm:sections//jcgm:li | jcgm:table | jcgm:figure | jcgm:annex//jcgm:p | jcgm:annex//jcgm:note | jcgm:annex//jcgm:termsource | jcgm:annex//jcgm:li" mode="flatxml_step1">
1645
+ <xsl:template match="jcgm:sections//jcgm:termsource | jcgm:annex//jcgm:termsource" mode="flatxml_step1"/>
1646
+ <xsl:template match="jcgm:sections//jcgm:p | jcgm:sections//jcgm:note | jcgm:sections//jcgm:li | jcgm:table | jcgm:figure | jcgm:annex//jcgm:p | jcgm:annex//jcgm:note | jcgm:annex//jcgm:li" mode="flatxml_step1">
1644
1647
  <xsl:copy>
1645
1648
  <xsl:apply-templates select="@*" mode="flatxml_step1"/>
1646
1649
  <xsl:call-template name="setCrossAlignAttributes"/>
@@ -1650,6 +1653,66 @@
1650
1653
  <xsl:apply-templates mode="flatxml_step1"/>
1651
1654
  </xsl:copy>
1652
1655
  </xsl:template>
1656
+ <xsl:template match="jcgm:sections//jcgm:fmt-termsource | jcgm:annex//jcgm:fmt-termsource" mode="flatxml_step1">
1657
+ <xsl:element name="termsource" namespace="{$namespace_full}">
1658
+ <xsl:apply-templates select="@*" mode="flatxml_step1"/>
1659
+ <xsl:call-template name="setCrossAlignAttributes"/>
1660
+ <xsl:if test="local-name() = 'li'">
1661
+ <xsl:call-template name="setListItemLabel"/>
1662
+ </xsl:if>
1663
+ <xsl:apply-templates mode="flatxml_step1"/>
1664
+ </xsl:element>
1665
+ </xsl:template>
1666
+
1667
+ <xsl:template match="*[local-name() = 'preferred']" mode="flatxml_step1"/>
1668
+ <xsl:template match="*[local-name() = 'admitted']" mode="flatxml_step1"/>
1669
+ <xsl:template match="*[local-name() = 'deprecates']" mode="flatxml_step1"/>
1670
+ <xsl:template match="*[local-name() = 'related']" mode="flatxml_step1"/>
1671
+ <xsl:template match="*[local-name() = 'definition']" mode="flatxml_step1"/>
1672
+
1673
+ <xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="flatxml_step1">
1674
+ <xsl:apply-templates mode="flatxml_step1"/>
1675
+ </xsl:template>
1676
+ <xsl:template match="*[local-name() = 'fmt-preferred'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-preferred']/*[local-name() = 'p']" mode="flatxml_step1">
1677
+ <xsl:element name="preferred" namespace="{$namespace_full}">
1678
+ <xsl:copy-of select="@*"/>
1679
+ <xsl:apply-templates mode="flatxml_step1"/>
1680
+ </xsl:element>
1681
+ </xsl:template>
1682
+ <xsl:template match="*[local-name() = 'fmt-admitted'][*[local-name() = 'p']]" mode="flatxml_step1">
1683
+ <xsl:apply-templates mode="flatxml_step1"/>
1684
+ </xsl:template>
1685
+ <xsl:template match="*[local-name() = 'fmt-admitted'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-admitted']/*[local-name() = 'p']" mode="flatxml_step1">
1686
+ <xsl:element name="admitted" namespace="{$namespace_full}">
1687
+ <xsl:copy-of select="@*"/>
1688
+ <xsl:apply-templates mode="flatxml_step1"/>
1689
+ </xsl:element>
1690
+ </xsl:template>
1691
+ <xsl:template match="*[local-name() = 'fmt-deprecates'][*[local-name() = 'p']]" mode="flatxml_step1">
1692
+ <xsl:apply-templates mode="flatxml_step1"/>
1693
+ </xsl:template>
1694
+ <xsl:template match="*[local-name() = 'fmt-deprecates'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-deprecates']/*[local-name() = 'p']" mode="flatxml_step1">
1695
+ <xsl:element name="deprecates" namespace="{$namespace_full}">
1696
+ <xsl:copy-of select="@*"/>
1697
+ <xsl:apply-templates mode="flatxml_step1"/>
1698
+ </xsl:element>
1699
+ </xsl:template>
1700
+ <xsl:template match="*[local-name() = 'fmt-definition']" mode="flatxml_step1">
1701
+ <xsl:element name="definition" namespace="{$namespace_full}">
1702
+ <xsl:copy-of select="@*"/>
1703
+ <xsl:apply-templates mode="flatxml_step1"/>
1704
+ </xsl:element>
1705
+ </xsl:template>
1706
+
1707
+ <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="flatxml_step1" priority="3">
1708
+ <xsl:apply-templates mode="flatxml_step1"/>
1709
+ </xsl:template>
1710
+
1711
+ <xsl:template match="*[local-name() = 'semx']" mode="flatxml_step1">
1712
+ <xsl:apply-templates mode="flatxml_step1"/>
1713
+ </xsl:template>
1714
+
1715
+ <xsl:template match="*[local-name() = 'fmt-xref-label']" mode="flatxml_step1"/>
1653
1716
 
1654
1717
  <xsl:template name="setCrossAlignAttributes">
1655
1718
  <xsl:variable name="is_cross_aligned">
@@ -1798,8 +1861,21 @@
1798
1861
 
1799
1862
  <!-- <xsl:strip-space elements="jcgm:xref"/> -->
1800
1863
 
1801
- <xsl:variable name="namespace_full" select="namespace-uri(/*)"/> <!-- example: https://www.metanorma.org/ns/iso -->
1802
- <xsl:variable name="root_element" select="local-name(/*)"/> <!-- example: iso-standard -->
1864
+ <xsl:variable name="namespace_full_">
1865
+ <xsl:choose>
1866
+ <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="namespace-uri(//*[contains(local-name(), '-standard')][1])"/></xsl:when>
1867
+ <xsl:otherwise><xsl:value-of select="namespace-uri(/*)"/></xsl:otherwise><!-- example: https://www.metanorma.org/ns/iso -->
1868
+ </xsl:choose>
1869
+ </xsl:variable>
1870
+ <xsl:variable name="namespace_full" select="normalize-space($namespace_full_)"/>
1871
+
1872
+ <xsl:variable name="root_element_">
1873
+ <xsl:choose>
1874
+ <xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="local-name(//*[contains(local-name(), '-standard')][1])"/></xsl:when>
1875
+ <xsl:otherwise><xsl:value-of select="local-name(/*)"/></xsl:otherwise><!-- example: iso-standard -->
1876
+ </xsl:choose>
1877
+ </xsl:variable>
1878
+ <xsl:variable name="root_element" select="normalize-space($root_element_)"/>
1803
1879
 
1804
1880
  <xsl:variable name="document_scheme" select="normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'document-scheme']/*[local-name() = 'value'])"/>
1805
1881
 
@@ -2993,6 +3069,9 @@
2993
3069
 
2994
3070
  </xsl:attribute-set>
2995
3071
 
3072
+ <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
3073
+ </xsl:attribute-set>
3074
+
2996
3075
  <xsl:attribute-set name="definition-style">
2997
3076
 
2998
3077
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -5286,7 +5365,9 @@
5286
5365
  <xsl:with-param name="element">
5287
5366
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> <!-- note: role="Lbl" removed in https://github.com/metanorma/mn2pdf/issues/291 -->
5288
5367
  <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
5368
+
5289
5369
  <xsl:copy-of select="$current_fn_number_text"/>
5370
+
5290
5371
  </fo:inline>
5291
5372
  </fo:basic-link>
5292
5373
  </xsl:with-param>
@@ -5305,8 +5386,7 @@
5305
5386
 
5306
5387
  <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
5307
5388
 
5308
- <fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
5309
-
5389
+ <xsl:variable name="fn_block">
5310
5390
  <xsl:call-template name="refine_fn-body-style"/>
5311
5391
 
5312
5392
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style" role="Lbl">
@@ -5314,9 +5394,15 @@
5314
5394
  <xsl:call-template name="refine_fn-body-num-style"/>
5315
5395
 
5316
5396
  <xsl:value-of select="$current_fn_number_text"/>
5397
+
5317
5398
  </fo:inline>
5318
5399
  <xsl:apply-templates/>
5319
- </fo:block>
5400
+ </xsl:variable>
5401
+
5402
+ <fo:block xsl:use-attribute-sets="fn-body-style" role="SKIP">
5403
+ <xsl:copy-of select="$fn_block"/>
5404
+ </fo:block>
5405
+
5320
5406
  </fo:block-container>
5321
5407
  </fo:footnote-body>
5322
5408
  </fo:footnote>
@@ -6719,6 +6805,12 @@
6719
6805
  </xsl:if>
6720
6806
  </xsl:template>
6721
6807
 
6808
+ <xsl:template match="*[local-name()='strike']">
6809
+ <fo:inline text-decoration="line-through">
6810
+ <xsl:apply-templates/>
6811
+ </fo:inline>
6812
+ </xsl:template>
6813
+
6722
6814
  <xsl:template match="*[local-name() = 'pagebreak']">
6723
6815
  <fo:block break-after="page"/>
6724
6816
  <fo:block> </fo:block>
@@ -11372,14 +11464,17 @@
11372
11464
  </fo:block>
11373
11465
  </xsl:template>
11374
11466
 
11375
- <xsl:template match="*[local-name() = 'domain']">
11467
+ <!-- <xsl:template match="*[local-name() = 'domain']"> -->
11376
11468
  <!-- https://github.com/metanorma/isodoc/issues/607
11377
11469
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
11378
11470
  <xsl:text> </xsl:text> -->
11379
- <xsl:if test="not(@hidden = 'true')">
11471
+ <!-- <xsl:if test="not(@hidden = 'true')">
11380
11472
  <xsl:apply-templates/>
11381
11473
  </xsl:if>
11382
- </xsl:template>
11474
+ </xsl:template> -->
11475
+
11476
+ <!-- https://github.com/metanorma/isodoc/issues/632#issuecomment-2567163931 -->
11477
+ <xsl:template match="*[local-name() = 'domain']"/>
11383
11478
 
11384
11479
  <xsl:template match="*[local-name() = 'admitted']">
11385
11480
  <fo:block xsl:use-attribute-sets="admitted-style">
@@ -11394,9 +11489,11 @@
11394
11489
  </xsl:template>
11395
11490
 
11396
11491
  <xsl:template name="setStyle_preferred">
11397
- <xsl:if test="*[local-name() = 'strong']">
11398
- <xsl:attribute name="font-weight">normal</xsl:attribute>
11399
- </xsl:if>
11492
+
11493
+ <xsl:if test="*[local-name() = 'strong']">
11494
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
11495
+ </xsl:if>
11496
+
11400
11497
  </xsl:template>
11401
11498
 
11402
11499
  <!-- regarding ISO 10241-1:2011, If there is more than one preferred term, each preferred term follows the previous one on a new line. -->
@@ -11406,6 +11503,17 @@
11406
11503
  </xsl:template>
11407
11504
  <!-- End Preferred, admitted, deprecated -->
11408
11505
 
11506
+ <xsl:template match="*[local-name() = 'fmt-related']">
11507
+ <fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
11508
+ <xsl:apply-templates/>
11509
+ </fo:block>
11510
+ </xsl:template>
11511
+ <xsl:template match="*[local-name() = 'fmt-related']/*[local-name() = 'p']" priority="4">
11512
+ <fo:block>
11513
+ <xsl:apply-templates/>
11514
+ </fo:block>
11515
+ </xsl:template>
11516
+
11409
11517
  <!-- ========== -->
11410
11518
  <!-- definition -->
11411
11519
  <!-- ========== -->
@@ -12314,6 +12422,7 @@
12314
12422
 
12315
12423
  <!-- Normative references -->
12316
12424
  <xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
12425
+ <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
12317
12426
 
12318
12427
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
12319
12428
 
@@ -13040,7 +13149,8 @@
13040
13149
  <!-- add @id - first element with @id plus '_element_name' -->
13041
13150
  <xsl:variable name="prefix_id_" select="(.//*[@id])[1]/@id"/>
13042
13151
  <xsl:variable name="prefix_id"><xsl:value-of select="$prefix_id_"/><xsl:if test="normalize-space($prefix_id_) = ''"><xsl:value-of select="generate-id()"/></xsl:if></xsl:variable>
13043
- <xsl:attribute name="id"><xsl:value-of select="$prefix_id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
13152
+ <xsl:variable name="document_suffix" select="ancestor::*[contains(local-name(), '-standard')]/@document_suffix"/>
13153
+ <xsl:attribute name="id"><xsl:value-of select="concat($prefix_id, '_', local-name(), '_', $document_suffix)"/></xsl:attribute>
13044
13154
  </xsl:if>
13045
13155
  </xsl:template>
13046
13156
 
@@ -13097,6 +13207,31 @@
13097
13207
  <xsl:template match="*[local-name() = 'name'][following-sibling::*[1][local-name() = 'fmt-name']]" mode="update_xml_pres"/>
13098
13208
  <xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
13099
13209
  <xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_pres"/>
13210
+ <!-- <xsl:template match="*[local-name() = 'preferred'][following-sibling::*[not(local-name() = 'preferred')][1][local-name() = 'fmt-preferred']]" mode="update_xml_step1"/> -->
13211
+ <xsl:template match="*[local-name() = 'preferred']" mode="update_xml_step1"/>
13212
+ <!-- <xsl:template match="*[local-name() = 'preferred'][following-sibling::*[not(local-name() = 'preferred')][1][local-name() = 'fmt-preferred']]" mode="update_xml_pres"/> -->
13213
+ <xsl:template match="*[local-name() = 'preferred']" mode="update_xml_pres"/>
13214
+ <!-- <xsl:template match="*[local-name() = 'admitted'][following-sibling::*[not(local-name() = 'admitted')][1][local-name() = 'fmt-admitted']]" mode="update_xml_step1"/> -->
13215
+ <xsl:template match="*[local-name() = 'admitted']" mode="update_xml_step1"/>
13216
+ <!-- <xsl:template match="*[local-name() = 'admitted'][following-sibling::*[not(local-name() = 'admitted')][1][local-name() = 'fmt-admitted']]" mode="update_xml_pres"/> -->
13217
+ <xsl:template match="*[local-name() = 'admitted']" mode="update_xml_pres"/>
13218
+ <!-- <xsl:template match="*[local-name() = 'deprecates'][following-sibling::*[not(local-name() = 'deprecates')][1][local-name() = 'fmt-deprecates']]" mode="update_xml_step1"/> -->
13219
+ <xsl:template match="*[local-name() = 'deprecates']" mode="update_xml_step1"/>
13220
+ <xsl:template match="*[local-name() = 'related']" mode="update_xml_step1"/>
13221
+ <!-- <xsl:template match="*[local-name() = 'deprecates'][following-sibling::*[not(local-name() = 'deprecates')][1][local-name() = 'fmt-deprecates']]" mode="update_xml_pres"/> -->
13222
+ <xsl:template match="*[local-name() = 'deprecates']" mode="update_xml_pres"/>
13223
+ <xsl:template match="*[local-name() = 'related']" mode="update_xml_pres"/>
13224
+ <!-- <xsl:template match="*[local-name() = 'definition'][following-sibling::*[1][local-name() = 'fmt-definition']]" mode="update_xml_step1"/> -->
13225
+ <xsl:template match="*[local-name() = 'definition']" mode="update_xml_step1"/>
13226
+ <!-- <xsl:template match="*[local-name() = 'definition'][following-sibling::*[1][local-name() = 'fmt-definition']]" mode="update_xml_pres"/> -->
13227
+ <xsl:template match="*[local-name() = 'definition']" mode="update_xml_pres"/>
13228
+ <!-- <xsl:template match="*[local-name() = 'termsource'][following-sibling::*[1][local-name() = 'fmt-termsource']]" mode="update_xml_step1"/> -->
13229
+ <xsl:template match="*[local-name() = 'termsource']" mode="update_xml_step1"/>
13230
+ <!-- <xsl:template match="*[local-name() = 'termsource'][following-sibling::*[1][local-name() = 'fmt-termsource']]" mode="update_xml_pres"/> -->
13231
+ <xsl:template match="*[local-name() = 'termsource']" mode="update_xml_pres"/>
13232
+
13233
+ <xsl:template match="*[local-name() = 'term'][@unnumbered = 'true'][not(.//*[starts-with(local-name(), 'fmt-')])]" mode="update_xml_step1"/>
13234
+ <xsl:template match="*[local-name() = 'term'][@unnumbered = 'true'][not(.//*[starts-with(local-name(), 'fmt-')])]" mode="update_xml_pres"/>
13100
13235
 
13101
13236
  <xsl:template match="*[local-name() = 'p'][@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][local-name() = 'section-title']]" mode="update_xml_step1">
13102
13237
  <xsl:copy>
@@ -13141,6 +13276,94 @@
13141
13276
  </xsl:element>
13142
13277
  </xsl:template>
13143
13278
 
13279
+ <xsl:template match="*[local-name() = 'fmt-preferred']"/>
13280
+ <xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
13281
+ <xsl:apply-templates mode="update_xml_step1"/>
13282
+ </xsl:template>
13283
+ <xsl:template match="*[local-name() = 'fmt-preferred'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-preferred']/*[local-name() = 'p']" mode="update_xml_step1">
13284
+ <xsl:element name="preferred" namespace="{$namespace_full}">
13285
+ <xsl:copy-of select="@*"/>
13286
+ <xsl:apply-templates mode="update_xml_step1"/>
13287
+ </xsl:element>
13288
+ </xsl:template>
13289
+ <xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_pres">
13290
+ <xsl:apply-templates mode="update_xml_pres"/>
13291
+ </xsl:template>
13292
+ <xsl:template match="*[local-name() = 'fmt-preferred'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-preferred']/*[local-name() = 'p']" mode="update_xml_pres">
13293
+ <xsl:element name="preferred" namespace="{$namespace_full}">
13294
+ <xsl:copy-of select="@*"/>
13295
+ <xsl:apply-templates mode="update_xml_pres"/>
13296
+ </xsl:element>
13297
+ </xsl:template>
13298
+
13299
+ <xsl:template match="*[local-name() = 'fmt-admitted']"/>
13300
+ <xsl:template match="*[local-name() = 'fmt-admitted'][*[local-name() = 'p']]" mode="update_xml_step1">
13301
+ <xsl:apply-templates mode="update_xml_step1"/>
13302
+ </xsl:template>
13303
+ <xsl:template match="*[local-name() = 'fmt-admitted'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-admitted']/*[local-name() = 'p']" mode="update_xml_step1">
13304
+ <xsl:element name="admitted" namespace="{$namespace_full}">
13305
+ <xsl:copy-of select="@*"/>
13306
+ <xsl:apply-templates mode="update_xml_step1"/>
13307
+ </xsl:element>
13308
+ </xsl:template>
13309
+ <xsl:template match="*[local-name() = 'fmt-admitted'][*[local-name() = 'p']]" mode="update_xml_pres">
13310
+ <xsl:apply-templates mode="update_xml_pres"/>
13311
+ </xsl:template>
13312
+ <xsl:template match="*[local-name() = 'fmt-admitted'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-admitted']/*[local-name() = 'p']" mode="update_xml_pres">
13313
+ <xsl:element name="admitted" namespace="{$namespace_full}">
13314
+ <xsl:copy-of select="@*"/>
13315
+ <xsl:apply-templates mode="update_xml_pres"/>
13316
+ </xsl:element>
13317
+ </xsl:template>
13318
+
13319
+ <xsl:template match="*[local-name() = 'fmt-deprecates']"/>
13320
+ <xsl:template match="*[local-name() = 'fmt-deprecates'][*[local-name() = 'p']]" mode="update_xml_step1">
13321
+ <xsl:apply-templates mode="update_xml_step1"/>
13322
+ </xsl:template>
13323
+ <xsl:template match="*[local-name() = 'fmt-deprecates'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-deprecates']/*[local-name() = 'p']" mode="update_xml_step1">
13324
+ <xsl:element name="deprecates" namespace="{$namespace_full}">
13325
+ <xsl:copy-of select="@*"/>
13326
+ <xsl:apply-templates mode="update_xml_step1"/>
13327
+ </xsl:element>
13328
+ </xsl:template>
13329
+ <xsl:template match="*[local-name() = 'fmt-deprecates'][*[local-name() = 'p']]" mode="update_xml_pres">
13330
+ <xsl:apply-templates mode="update_xml_pres"/>
13331
+ </xsl:template>
13332
+ <xsl:template match="*[local-name() = 'fmt-deprecates'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-deprecates']/*[local-name() = 'p']" mode="update_xml_pres">
13333
+ <xsl:element name="deprecates" namespace="{$namespace_full}">
13334
+ <xsl:copy-of select="@*"/>
13335
+ <xsl:apply-templates mode="update_xml_pres"/>
13336
+ </xsl:element>
13337
+ </xsl:template>
13338
+
13339
+ <xsl:template match="*[local-name() = 'fmt-definition']"/>
13340
+ <xsl:template match="*[local-name() = 'fmt-definition']" mode="update_xml_step1">
13341
+ <xsl:element name="definition" namespace="{$namespace_full}">
13342
+ <xsl:copy-of select="@*"/>
13343
+ <xsl:apply-templates mode="update_xml_step1"/>
13344
+ </xsl:element>
13345
+ </xsl:template>
13346
+ <xsl:template match="*[local-name() = 'fmt-definition']" mode="update_xml_pres">
13347
+ <xsl:element name="definition" namespace="{$namespace_full}">
13348
+ <xsl:copy-of select="@*"/>
13349
+ <xsl:apply-templates mode="update_xml_pres"/>
13350
+ </xsl:element>
13351
+ </xsl:template>
13352
+
13353
+ <xsl:template match="*[local-name() = 'fmt-termsource']"/>
13354
+ <xsl:template match="*[local-name() = 'fmt-termsource']" mode="update_xml_step1">
13355
+ <xsl:element name="termsource" namespace="{$namespace_full}">
13356
+ <xsl:copy-of select="@*"/>
13357
+ <xsl:apply-templates mode="update_xml_step1"/>
13358
+ </xsl:element>
13359
+ </xsl:template>
13360
+ <xsl:template match="*[local-name() = 'fmt-termsource']" mode="update_xml_pres">
13361
+ <xsl:element name="termsource" namespace="{$namespace_full}">
13362
+ <xsl:copy-of select="@*"/>
13363
+ <xsl:apply-templates mode="update_xml_pres"/>
13364
+ </xsl:element>
13365
+ </xsl:template>
13366
+
13144
13367
  <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
13145
13368
  <xsl:apply-templates mode="update_xml_step1"/>
13146
13369
  </xsl:template>
@@ -14270,7 +14493,7 @@
14270
14493
  </xsl:template>
14271
14494
 
14272
14495
  <xsl:template name="namespaceCheck">
14273
- <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
14496
+ <xsl:variable name="documentNS" select="$namespace_full"/> <!-- namespace-uri(/*) -->
14274
14497
  <xsl:variable name="XSLNS">
14275
14498
 
14276
14499
  <xsl:value-of select="document('')//*/namespace::bipm"/>
@@ -14360,6 +14583,9 @@
14360
14583
  <xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != ''">
14361
14584
  <xsl:apply-templates select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
14362
14585
  </xsl:when>
14586
+ <xsl:when test="string-length($bibdata_updated) != ''">
14587
+ <xsl:value-of select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
14588
+ </xsl:when>
14363
14589
  <xsl:when test="$formatted = 'true'">
14364
14590
  <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
14365
14591
  </xsl:when>
@@ -128,7 +128,7 @@ module IsoDoc
128
128
  def extract_brackets(node)
129
129
  start = node.at("./text()[1]")
130
130
  finish = node.at("./text()[last()]")
131
- (/^\[/.match?(start.text) && /\]$/.match?(finish.text)) or return
131
+ (/^\[/.match?(start&.text) && /\]$/.match?(finish&.text)) or return
132
132
  start.replace(start.text[1..-1])
133
133
  node.previous = "["
134
134
  finish = node.at("./text()[last()]")
@@ -143,7 +143,8 @@ module IsoDoc
143
143
  end
144
144
  end
145
145
 
146
- def termsource1(elem)
146
+ # KILL
147
+ def termsource1_xx(elem)
147
148
  # elem["status"] == "modified" and return super
148
149
  while elem&.next_element&.name == "termsource"
149
150
  elem << "; #{to_xml(elem.next_element.remove.children)}"
@@ -152,6 +153,10 @@ module IsoDoc
152
153
  "#{to_xml(elem.children).strip}]")
153
154
  end
154
155
 
156
+ def termsource_label(elem, sources)
157
+ elem.replace(l10n("[#{termsource_adapt(elem['status'])} #{sources}]"))
158
+ end
159
+
155
160
  def termsource_adapt(status)
156
161
  case status
157
162
  when "adapted" then @i18n.adapted_from
@@ -267,11 +267,11 @@ Detailed in https://www.relaton.org/model/creator/</a:documentation>
267
267
  <a:documentation>An identifier of the person according to an international identifier scheme</a:documentation>
268
268
  </ref>
269
269
  </zeroOrMore>
270
- <zeroOrMore>
270
+ <optional>
271
271
  <ref name="contact">
272
272
  <a:documentation>Contact information for the person, including URI, address, phone number, and email</a:documentation>
273
273
  </ref>
274
- </zeroOrMore>
274
+ </optional>
275
275
  </element>
276
276
  </define>
277
277
  <define name="fullname">
@@ -454,11 +454,11 @@ real names (if the person is named with a pseudonym or user name); previous lega
454
454
  <a:documentation>An identifier of the organization according to an international identifier scheme</a:documentation>
455
455
  </ref>
456
456
  </zeroOrMore>
457
- <zeroOrMore>
457
+ <optional>
458
458
  <ref name="contact">
459
459
  <a:documentation>Contact information for the organization, including address, phone number, and email</a:documentation>
460
460
  </ref>
461
- </zeroOrMore>
461
+ </optional>
462
462
  <optional>
463
463
  <ref name="logo">
464
464
  <a:documentation>A logo for the organization</a:documentation>
@@ -540,12 +540,18 @@ real names (if the person is named with a pseudonym or user name); previous lega
540
540
  <!-- TODO may change -->
541
541
  <define name="contact">
542
542
  <a:documentation>Contact information for a person or organization</a:documentation>
543
- <choice>
543
+ <zeroOrMore>
544
544
  <ref name="address"/>
545
+ </zeroOrMore>
546
+ <zeroOrMore>
545
547
  <ref name="phone"/>
548
+ </zeroOrMore>
549
+ <zeroOrMore>
546
550
  <ref name="email"/>
551
+ </zeroOrMore>
552
+ <zeroOrMore>
547
553
  <ref name="uri"/>
548
- </choice>
554
+ </zeroOrMore>
549
555
  </define>
550
556
  <define name="phone">
551
557
  <a:documentation>The phone number associated with a person or organization</a:documentation>
@@ -1271,17 +1277,17 @@ for which this claim of validity is made, if applicable</a:documentation>
1271
1277
  </define>
1272
1278
  <define name="validityBegins">
1273
1279
  <element name="validityBegins">
1274
- <ref name="ISO8601DateTime"/>
1280
+ <ref name="ISO8601Date"/>
1275
1281
  </element>
1276
1282
  </define>
1277
1283
  <define name="validityEnds">
1278
1284
  <element name="validityEnds">
1279
- <ref name="ISO8601DateTime"/>
1285
+ <ref name="ISO8601Date"/>
1280
1286
  </element>
1281
1287
  </define>
1282
1288
  <define name="validityRevision">
1283
1289
  <element name="revision">
1284
- <ref name="ISO8601DateTime"/>
1290
+ <ref name="ISO8601Date"/>
1285
1291
  </element>
1286
1292
  </define>
1287
1293
  <define name="TypedTitleString">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Bipm
3
- VERSION = "2.5.9".freeze
3
+ VERSION = "2.5.11".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-bipm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.9
4
+ version: 2.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-23 00:00:00.000000000 Z
11
+ date: 2025-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -300,7 +300,7 @@ homepage: https://github.com/metanorma/metanorma-bipm
300
300
  licenses:
301
301
  - BSD-2-Clause
302
302
  metadata: {}
303
- post_install_message:
303
+ post_install_message:
304
304
  rdoc_options: []
305
305
  require_paths:
306
306
  - lib
@@ -316,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
316
  version: '0'
317
317
  requirements: []
318
318
  rubygems_version: 3.3.27
319
- signing_key:
319
+ signing_key:
320
320
  specification_version: 4
321
321
  summary: metanorma-bipm lets you write BIPM standards in Metanorma.
322
322
  test_files: []