metanorma-iec 2.7.7 → 2.7.9

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: 7851d201effbf69a844d095c15e05c8a908d9e3194039cc5fd45db37764d2ace
4
- data.tar.gz: ca193df8e10c7690b75cc18543c945b2f636bf36264ca119131bfb3444da52b3
3
+ metadata.gz: bffe3dc7f47a6224338384ab6f340cf8f7aeaeceb35d285b62cd6164b903cf17
4
+ data.tar.gz: 51bf729e3384078f31137aad3ce4957215f8587414773701fbf49f9ece90a8cd
5
5
  SHA512:
6
- metadata.gz: 477843a017e58b1c7dc4884defdf415f8b34a1cb4aadb77811c0fd1e6f9e42941cc445181024f88f64bc4f4d09ad0b1f1e56f413dc5614ad2b78d7f0721273e0
7
- data.tar.gz: 5fcfd2957e76e08352cd940b8f0723121729f41e9398ba786805f773fd73117a4a407c6c9c8417f3aafaf08ac85038c21472894c6c643f4e9be09633d6631bb3
6
+ metadata.gz: 0e590c6b1bee11faf37e90981be854eadf793c85f24973589b497539f881a2b5628896b496592c273fc1f6a692afab578ef4f6addfc5de77066d5f9c8a97219c
7
+ data.tar.gz: b2298ce01b023231d8736215e77c2e6c5d2e95da65dce72436b19ac2490cca1a438fad66851068d5ef059ff730dc942d6b7291a03b6425e07f1807a5a4384b4b
@@ -445,7 +445,7 @@
445
445
  </fo:inline>
446
446
  </fo:block>
447
447
  <fo:block-container margin-left="1.5mm">
448
- <fo:block-container margin-left="0mm">
448
+ <fo:block-container xsl:use-attribute-sets="reset-margins-style">
449
449
  <fo:block-container border="0.5pt solid black" font-size="10pt" margin-top="8mm" font-weight="bold" padding-left="1.5mm" padding-top="0.5mm" width="102%" height="11mm" display-align="center" id="__internal_layout__warning_block">
450
450
  <fo:block margin-left="1mm">Warning! Make sure that you obtained this publication from an authorized distributor.</fo:block>
451
451
  <xsl:if test="//mn:metanorma/mn:bibdata/mn:title[@language = 'fr']">
@@ -502,7 +502,7 @@
502
502
  <xsl:text> </xsl:text>
503
503
  </fo:block>
504
504
  <fo:block-container margin-left="57mm">
505
- <fo:block-container margin-left="0mm">
505
+ <fo:block-container xsl:use-attribute-sets="reset-margins-style">
506
506
  <fo:table table-layout="fixed" width="118mm" background-color="rgb(219, 229, 241)" id="__internal_layout__project_{generate-id()}">
507
507
  <fo:table-column column-width="50%"/>
508
508
  <fo:table-column column-width="50%"/>
@@ -575,7 +575,7 @@
575
575
  </fo:block-container>
576
576
 
577
577
  <fo:block-container margin-left="-2mm" margin-right="-2mm" margin-top="5mm">
578
- <fo:block-container margin-left="0mm" margin-right="0mm">
578
+ <fo:block-container xsl:use-attribute-sets="reset-margins-style">
579
579
  <xsl:variable name="border-color">rgb(221, 213, 213)</xsl:variable>
580
580
  <fo:table table-layout="fixed" width="100%" border="1.5pt solid {$border-color}">
581
581
  <fo:table-column column-width="50%"/>
@@ -896,7 +896,7 @@
896
896
  <fo:block span="all">
897
897
  <fo:block-container border="0.5pt solid black" margin-top="7mm">
898
898
  <fo:block-container margin-left="2.5mm" margin-right="2.5mm" margin-top="1mm" margin-bottom="1mm">
899
- <fo:block-container margin-left="0mm" margin-right="0mm">
899
+ <fo:block-container xsl:use-attribute-sets="reset-margins-style">
900
900
  <fo:table table-layout="fixed" width="100%">
901
901
  <fo:table-column column-width="20mm"/>
902
902
  <fo:table-column column-width="130mm"/>
@@ -1057,7 +1057,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1057
1057
  <fo:block> </fo:block>
1058
1058
  </fo:block>
1059
1059
  <fo:block-container font-size="30pt" font-weight="bold" height="56mm" margin-left="7.5mm" line-height="115%">
1060
- <fo:block-container margin-left="0mm">
1060
+ <fo:block-container xsl:use-attribute-sets="reset-margins-style">
1061
1061
  <fo:block-container height="25mm" display-align="after">
1062
1062
  <xsl:if test="$stage_published = 'true'">
1063
1063
  <xsl:attribute name="width">100mm</xsl:attribute>
@@ -1095,7 +1095,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1095
1095
  </fo:block-container>
1096
1096
  </fo:block-container>
1097
1097
  <fo:block-container margin-left="8mm">
1098
- <fo:block-container margin-left="0mm">
1098
+ <fo:block-container xsl:use-attribute-sets="reset-margins-style">
1099
1099
  <fo:block-container height="6mm">
1100
1100
  <fo:block text-align="right" margin-top="-4.5mm" margin-right="-1mm">
1101
1101
  <xsl:if test="//mn:metanorma/mn:bibdata/mn:ext/mn:accessibility-color-inside = 'true'">
@@ -1138,7 +1138,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1138
1138
  </fo:block-container>
1139
1139
  </fo:block-container>
1140
1140
  <fo:block-container margin-left="8.5mm">
1141
- <fo:block-container margin-left="0mm">
1141
+ <fo:block-container xsl:use-attribute-sets="reset-margins-style">
1142
1142
  <fo:block font-size="12pt" font-weight="bold" color="{$color_blue}" margin-bottom="16pt" role="H1">
1143
1143
  <!-- Example:
1144
1144
  Electromagnetic compatibility (EMC) –
@@ -1823,31 +1823,14 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1823
1823
  <!-- ====== -->
1824
1824
  <!-- title -->
1825
1825
  <!-- ====== -->
1826
- <xsl:template match="mn:introduction/mn:fmt-title">
1827
- <fo:block font-size="12pt" text-align="center" margin-bottom="12pt" role="H1">
1828
- <xsl:apply-templates/>
1829
- <xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
1830
- </fo:block>
1831
- </xsl:template>
1826
+ <!-- Introduction title text spacing -->
1832
1827
  <xsl:template match="mn:introduction/mn:fmt-title/text()">
1833
1828
  <xsl:call-template name="addLetterSpacing">
1834
1829
  <xsl:with-param name="text" select="."/>
1835
1830
  </xsl:call-template>
1836
1831
  </xsl:template>
1837
1832
 
1838
- <xsl:template match="mn:annex/mn:fmt-title">
1839
- <fo:block font-size="12pt" text-align="center" margin-bottom="32pt" keep-with-next="always" role="H1">
1840
- <xsl:apply-templates/>
1841
- <xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
1842
- </fo:block>
1843
- </xsl:template>
1844
-
1845
- <!-- Bibliography -->
1846
- <xsl:template match="mn:references[not(@normative='true')]/mn:fmt-title">
1847
- <fo:block font-size="12pt" text-align="center" margin-bottom="12pt" keep-with-next="always" role="H1">
1848
- <xsl:apply-templates/>
1849
- </fo:block>
1850
- </xsl:template>
1833
+ <!-- Bibliography title text spacing -->
1851
1834
  <xsl:template match="mn:references[not(@normative='true')]/mn:fmt-title/text()">
1852
1835
  <xsl:call-template name="addLetterSpacing">
1853
1836
  <xsl:with-param name="text" select="."/>
@@ -1856,47 +1839,23 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1856
1839
 
1857
1840
  <xsl:template match="mn:fmt-title" name="title">
1858
1841
 
1859
- <xsl:variable name="level">
1860
- <xsl:call-template name="getLevel"/>
1861
- </xsl:variable>
1862
-
1863
- <xsl:variable name="font-size">
1842
+ <xsl:variable name="element-name">
1864
1843
  <xsl:choose>
1865
- <xsl:when test="ancestor::mn:sections and $level = 1">11pt</xsl:when>
1866
- <xsl:when test="ancestor::mn:annex and $level &lt;= 2">11pt</xsl:when>
1867
- <xsl:when test="ancestor::mn:references[not (preceding-sibling::mn:references)]">11pt</xsl:when>
1868
- <xsl:otherwise>10pt</xsl:otherwise>
1844
+ <xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when>
1845
+ <xsl:otherwise>fo:block</xsl:otherwise>
1869
1846
  </xsl:choose>
1870
1847
  </xsl:variable>
1871
1848
 
1872
- <xsl:choose>
1873
- <xsl:when test="../@inline-header = 'true'">
1874
- <fo:inline font-size="{$font-size}" font-weight="bold" role="H{$level}">
1875
- <xsl:apply-templates/>
1876
- </fo:inline>
1877
- </xsl:when>
1878
- <xsl:otherwise>
1879
- <fo:block font-size="{$font-size}" font-weight="bold" keep-with-next="always" role="H{$level}">
1880
- <xsl:attribute name="space-before"> <!-- margin-top -->
1881
- <xsl:choose>
1882
- <xsl:when test="$level = 2 and ancestor::mn:annex">22pt</xsl:when>
1883
- <xsl:when test="$level &gt;= 2 and ancestor::mn:annex">5pt</xsl:when>
1884
- <xsl:when test="$level = '' or $level = 1">18pt</xsl:when>
1885
- <xsl:otherwise>10pt</xsl:otherwise>
1886
- </xsl:choose>
1887
- </xsl:attribute>
1888
- <xsl:attribute name="margin-bottom">
1889
- <xsl:choose>
1890
- <xsl:when test="$level = '' or $level = 1">14pt</xsl:when>
1891
- <xsl:when test="$level = 2 and ancestor::mn:annex">14pt</xsl:when>
1892
- <xsl:otherwise>5pt</xsl:otherwise>
1893
- </xsl:choose>
1894
- </xsl:attribute>
1895
- <xsl:apply-templates/>
1896
- <xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
1897
- </fo:block>
1898
- </xsl:otherwise>
1899
- </xsl:choose>
1849
+ <xsl:variable name="title_styles">
1850
+ <styles xsl:use-attribute-sets="title-style"><xsl:call-template name="refine_title-style"/></styles>
1851
+ </xsl:variable>
1852
+
1853
+ <xsl:element name="{$element-name}">
1854
+ <xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*"/>
1855
+
1856
+ <xsl:apply-templates/>
1857
+ <xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
1858
+ </xsl:element>
1900
1859
  </xsl:template>
1901
1860
  <!-- ====== -->
1902
1861
  <!-- ====== -->
@@ -1915,37 +1874,16 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
1915
1874
  </xsl:choose>
1916
1875
  </xsl:variable>
1917
1876
 
1877
+ <xsl:variable name="p_styles">
1878
+ <styles xsl:use-attribute-sets="p-style">
1879
+ <xsl:call-template name="refine_p-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template>
1880
+ </styles>
1881
+ </xsl:variable>
1882
+
1918
1883
  <xsl:choose>
1919
1884
  <xsl:when test="$element-name = 'fo:block'">
1920
1885
  <xsl:element name="{$element-name}">
1921
-
1922
- <xsl:call-template name="setBlockAttributes">
1923
- <xsl:with-param name="text_align_default">justify</xsl:with-param>
1924
- </xsl:call-template>
1925
-
1926
- <xsl:attribute name="margin-top">5pt</xsl:attribute>
1927
- <xsl:if test="ancestor::mn:fmt-definition">
1928
- <xsl:attribute name="margin-top">1pt</xsl:attribute>
1929
- </xsl:if>
1930
- <xsl:if test="ancestor::mn:dl">
1931
- <xsl:attribute name="margin-top">0pt</xsl:attribute>
1932
- </xsl:if>
1933
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1934
- <xsl:if test="local-name(following-sibling::*[1])= 'table'">
1935
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1936
- </xsl:if>
1937
- <xsl:if test="ancestor::mn:admonition">
1938
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1939
- </xsl:if>
1940
- <xsl:if test="ancestor::mn:admonition and not(following-sibling::mn:p)">
1941
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
1942
- </xsl:if>
1943
- <xsl:if test="ancestor::mn:dl">
1944
- <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
1945
- </xsl:if>
1946
- <xsl:if test="@id">
1947
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
1948
- </xsl:if>
1886
+ <xsl:copy-of select="xalan:nodeset($p_styles)/styles/@*"/>
1949
1887
 
1950
1888
  <xsl:apply-templates select="@language"/>
1951
1889
  <xsl:apply-templates>
@@ -2100,7 +2038,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
2100
2038
  <fo:page-sequence master-reference="back-page">
2101
2039
  <fo:flow flow-name="xsl-region-body">
2102
2040
  <fo:block-container margin-left="20mm" margin-top="19mm">
2103
- <fo:block-container margin-left="0mm" margin-top="0mm">
2041
+ <fo:block-container xsl:use-attribute-sets="reset-margins-style" margin-top="0mm">
2104
2042
  <fo:block font-size="11pt" color="{$color_blue}" margin-bottom="12pt" line-height="150%">
2105
2043
  <fo:block-container width="42mm">
2106
2044
  <fo:block>
@@ -4294,6 +4232,10 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
4294
4232
  </xsl:element>
4295
4233
  </xsl:template>
4296
4234
 
4235
+ <!-- show sourcecode's name 'before' or 'after' source code -->
4236
+ <xsl:variable name="sourcecode-name-position"><xsl:text>after</xsl:text>
4237
+ </xsl:variable>
4238
+
4297
4239
  <xsl:template match="mn:sourcecode" name="sourcecode">
4298
4240
 
4299
4241
  <xsl:variable name="sourcecode_attributes">
@@ -4317,7 +4259,12 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
4317
4259
 
4318
4260
  <xsl:call-template name="refine_sourcecode-container-style"/>
4319
4261
 
4320
- <fo:block-container margin-left="0mm" role="SKIP">
4262
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
4263
+
4264
+ <!-- <xsl:if test="$namespace = 'rsd'"> -->
4265
+ <xsl:if test="$sourcecode-name-position = 'before'">
4266
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name BEFORE content -->
4267
+ </xsl:if>
4321
4268
 
4322
4269
  <fo:block xsl:use-attribute-sets="sourcecode-style">
4323
4270
 
@@ -4339,7 +4286,16 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
4339
4286
  </fo:block>
4340
4287
 
4341
4288
  <xsl:apply-templates select="mn:dl"/> <!-- Key table -->
4342
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
4289
+
4290
+ <!-- <xsl:choose>
4291
+ <xsl:when test="$namespace = 'rsd'"></xsl:when>
4292
+ <xsl:otherwise>
4293
+ <xsl:apply-templates select="mn:fmt-name" /> --><!-- show sourcecode's name AFTER content -->
4294
+ <!-- </xsl:otherwise>
4295
+ </xsl:choose> -->
4296
+ <xsl:if test="$sourcecode-name-position = 'after'">
4297
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
4298
+ </xsl:if>
4343
4299
 
4344
4300
  </fo:block-container>
4345
4301
  </fo:block-container>
@@ -10223,6 +10179,10 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
10223
10179
  <!-- image -->
10224
10180
  <!-- ====== -->
10225
10181
 
10182
+ <!-- show figure's name 'before' or 'after' image -->
10183
+ <xsl:variable name="figure-name-position"><xsl:text>after</xsl:text>
10184
+ </xsl:variable>
10185
+
10226
10186
  <xsl:template match="mn:figure" name="figure">
10227
10187
  <xsl:variable name="isAdded" select="@added"/>
10228
10188
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -10235,6 +10195,10 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
10235
10195
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
10236
10196
  </xsl:call-template>
10237
10197
 
10198
+ <xsl:if test="$figure-name-position = 'before'"> <!-- show figure's name BEFORE image -->
10199
+ <xsl:apply-templates select="mn:fmt-name"/>
10200
+ </xsl:if>
10201
+
10238
10202
  <!-- Example: Dimensions in millimeters -->
10239
10203
  <xsl:apply-templates select="mn:note[@type = 'units']"/>
10240
10204
 
@@ -10255,7 +10219,16 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
10255
10219
  <xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
10256
10220
  <xsl:call-template name="showFigureKey"/>
10257
10221
  </xsl:if>
10258
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
10222
+
10223
+ <!-- <xsl:choose>
10224
+ <xsl:when test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'rsd'"></xsl:when>
10225
+ <xsl:otherwise>
10226
+ <xsl:apply-templates select="mn:fmt-name" /> --> <!-- show figure's name AFTER image -->
10227
+ <!-- </xsl:otherwise>
10228
+ </xsl:choose> -->
10229
+ <xsl:if test="$figure-name-position = 'after'">
10230
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
10231
+ </xsl:if>
10259
10232
 
10260
10233
  </fo:block-container>
10261
10234
  </xsl:template>
@@ -12346,11 +12319,18 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
12346
12319
  <!-- END Admonition -->
12347
12320
  <!-- ================ -->
12348
12321
 
12349
- <xsl:attribute-set name="references-non-normative-title-style">
12322
+ <xsl:attribute-set name="bibliography-title-style">
12323
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
12324
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
12325
+ <xsl:attribute name="text-align">center</xsl:attribute>
12326
+ <xsl:attribute name="space-before">0pt</xsl:attribute>
12327
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
12328
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
12329
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
12330
+ <xsl:attribute name="role">H1</xsl:attribute>
12350
12331
  </xsl:attribute-set>
12351
12332
 
12352
- <xsl:template name="refine_references-non-normative-title-style">
12353
-
12333
+ <xsl:template name="refine_bibliography-title-style">
12354
12334
  </xsl:template>
12355
12335
 
12356
12336
  <!-- bibitem in Normative References (references/@normative="true") -->
@@ -14462,7 +14442,14 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
14462
14442
  <!-- ===================================== -->
14463
14443
 
14464
14444
  <xsl:attribute-set name="annex-title-style">
14465
- </xsl:attribute-set>
14445
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
14446
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
14447
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
14448
+ <xsl:attribute name="text-align">center</xsl:attribute>
14449
+ <xsl:attribute name="space-before">0</xsl:attribute>
14450
+ <xsl:attribute name="margin-bottom">32pt</xsl:attribute>
14451
+ <xsl:attribute name="role">H1</xsl:attribute>
14452
+ </xsl:attribute-set> <!-- annex-title-style -->
14466
14453
 
14467
14454
  <xsl:template name="refine_annex-title-style">
14468
14455
  </xsl:template>
@@ -14473,6 +14460,99 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
14473
14460
  <xsl:template name="refine_p-zzSTDTitle1-style">
14474
14461
  </xsl:template>
14475
14462
 
14463
+ <xsl:attribute-set name="p-style">
14464
+ <xsl:attribute name="margin-top">5pt</xsl:attribute>
14465
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
14466
+ </xsl:attribute-set> <!-- p-style -->
14467
+
14468
+ <xsl:template name="refine_p-style">
14469
+ <xsl:param name="element-name"/>
14470
+ <xsl:param name="margin"/>
14471
+ <xsl:call-template name="setBlockAttributes">
14472
+ <xsl:with-param name="text_align_default">justify</xsl:with-param>
14473
+ </xsl:call-template>
14474
+
14475
+ <xsl:if test="ancestor::mn:fmt-definition">
14476
+ <xsl:attribute name="margin-top">1pt</xsl:attribute>
14477
+ </xsl:if>
14478
+ <xsl:if test="ancestor::mn:dl">
14479
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
14480
+ </xsl:if>
14481
+
14482
+ <xsl:if test="local-name(following-sibling::*[1])= 'table'">
14483
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
14484
+ </xsl:if>
14485
+ <xsl:if test="ancestor::mn:admonition">
14486
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
14487
+ </xsl:if>
14488
+ <xsl:if test="ancestor::mn:admonition and not(following-sibling::mn:p)">
14489
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
14490
+ </xsl:if>
14491
+ <xsl:if test="ancestor::mn:dl">
14492
+ <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
14493
+ </xsl:if>
14494
+ <xsl:copy-of select="@id"/>
14495
+ <!-- $namespace = 'iec' -->
14496
+
14497
+ </xsl:template> <!-- refine_p-style -->
14498
+
14499
+ <xsl:attribute-set name="title-style">
14500
+ <!-- Note: font-size for level 1 title -->
14501
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
14502
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
14503
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
14504
+ <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
14505
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
14506
+ </xsl:attribute-set> <!-- title-style -->
14507
+
14508
+ <xsl:template name="refine_title-style">
14509
+ <xsl:param name="element-name"/>
14510
+ <xsl:variable name="level">
14511
+ <xsl:call-template name="getLevel"/>
14512
+ </xsl:variable>
14513
+ <xsl:if test="(ancestor::mn:sections and $level = 1) or (ancestor::mn:annex and $level &lt;= 2) or (ancestor::mn:references[not (preceding-sibling::mn:references)])">
14514
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
14515
+ </xsl:if>
14516
+ <xsl:if test="$level = 1">
14517
+ <xsl:if test="ancestor::mn:introduction">
14518
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
14519
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
14520
+ <xsl:attribute name="text-align">center</xsl:attribute>
14521
+ <xsl:attribute name="space-before">0pt</xsl:attribute>
14522
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
14523
+ </xsl:if>
14524
+ </xsl:if>
14525
+ <xsl:if test="$level &gt;= 2">
14526
+ <xsl:attribute name="space-before">10pt</xsl:attribute>
14527
+ <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
14528
+ </xsl:if>
14529
+ <xsl:if test="$level = 2">
14530
+ <xsl:if test="ancestor::mn:annex">
14531
+ <xsl:attribute name="space-before">22pt</xsl:attribute>
14532
+ <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
14533
+ </xsl:if>
14534
+ </xsl:if>
14535
+ <xsl:if test="$level &gt; 2">
14536
+ <xsl:if test="ancestor::mn:annex">
14537
+ <xsl:attribute name="space-before">5pt</xsl:attribute>
14538
+ </xsl:if>
14539
+ </xsl:if>
14540
+ <xsl:if test="parent::mn:references[not(@normative='true')]"><!-- Bibliography section title -->
14541
+ <xsl:variable name="bibliography_title_styles">
14542
+ <styles xsl:use-attribute-sets="bibliography-title-style"><xsl:call-template name="refine_bibliography-title-style"/></styles>
14543
+ </xsl:variable>
14544
+ <xsl:copy-of select="xalan:nodeset($bibliography_title_styles)/styles/@*"/>
14545
+ </xsl:if>
14546
+ <xsl:if test="parent::mn:annex"><!-- Annex title -->
14547
+ <xsl:variable name="annex_title_styles">
14548
+ <styles xsl:use-attribute-sets="annex-title-style"><xsl:call-template name="refine_annex-title-style"/></styles>
14549
+ </xsl:variable>
14550
+ <xsl:copy-of select="xalan:nodeset($annex_title_styles)/styles/@*"/>
14551
+ </xsl:if>
14552
+ <!-- $namespace = 'iec' -->
14553
+ <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
14554
+ </xsl:template> <!-- refine_title-style -->
14555
+
14476
14556
  <xsl:template name="processPrefaceSectionsDefault">
14477
14557
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
14478
14558
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -14811,6 +14891,12 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
14811
14891
  </xsl:choose>
14812
14892
  </xsl:template>
14813
14893
 
14894
+ <xsl:attribute-set name="reset-margins-style">
14895
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
14896
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
14897
+ <xsl:attribute name="role">SKIP</xsl:attribute>
14898
+ </xsl:attribute-set>
14899
+
14814
14900
  <xsl:attribute-set name="clause-style">
14815
14901
 
14816
14902
  </xsl:attribute-set>
@@ -15846,8 +15932,9 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
15846
15932
 
15847
15933
  <xsl:template name="setTextAlignment">
15848
15934
  <xsl:param name="default">left</xsl:param>
15935
+ <xsl:param name="skip_default">false</xsl:param>
15849
15936
  <xsl:variable name="align" select="normalize-space(@align)"/>
15850
- <xsl:attribute name="text-align">
15937
+ <xsl:variable name="text_align">
15851
15938
  <xsl:choose>
15852
15939
  <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
15853
15940
  <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
@@ -15855,9 +15942,13 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
15855
15942
  <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
15856
15943
  <xsl:when test="ancestor::mn:td/@align"><xsl:value-of select="ancestor::mn:td/@align"/></xsl:when>
15857
15944
  <xsl:when test="ancestor::mn:th/@align"><xsl:value-of select="ancestor::mn:th/@align"/></xsl:when>
15945
+ <xsl:when test="$skip_default = 'true'"/>
15858
15946
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
15859
15947
  </xsl:choose>
15860
- </xsl:attribute>
15948
+ </xsl:variable>
15949
+ <xsl:if test="normalize-space($text_align) != ''">
15950
+ <xsl:attribute name="text-align"><xsl:value-of select="$text_align"/></xsl:attribute>
15951
+ </xsl:if>
15861
15952
  <xsl:if test="$align = 'indent'">
15862
15953
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
15863
15954
  </xsl:if>
@@ -15865,8 +15956,10 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
15865
15956
 
15866
15957
  <xsl:template name="setBlockAttributes">
15867
15958
  <xsl:param name="text_align_default">left</xsl:param>
15959
+ <xsl:param name="skip_text_align_default">false</xsl:param>
15868
15960
  <xsl:call-template name="setTextAlignment">
15869
15961
  <xsl:with-param name="default" select="$text_align_default"/>
15962
+ <xsl:with-param name="skip_default" select="$skip_text_align_default"/>
15870
15963
  </xsl:call-template>
15871
15964
  <xsl:call-template name="setKeepAttributes"/>
15872
15965
  <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
@@ -690,7 +690,7 @@ Examples include GRID, LEI, CrossRef, and Ringgold</a:documentation>
690
690
  <define name="CitationType">
691
691
  <attribute name="bibitemid">
692
692
  <a:documentation>Bibliographic item that the citation applies to, referenced as the anchor of a bibliographic description</a:documentation>
693
- <data type="IDREF"/>
693
+ <ref name="IdRefType"/>
694
694
  </attribute>
695
695
  <choice>
696
696
  <zeroOrMore>
@@ -1296,17 +1296,17 @@ for which this claim of validity is made, if applicable</a:documentation>
1296
1296
  </define>
1297
1297
  <define name="validityBegins">
1298
1298
  <element name="validityBegins">
1299
- <ref name="ISO8601Date"/>
1299
+ <ref name="ISO8601DateTime"/>
1300
1300
  </element>
1301
1301
  </define>
1302
1302
  <define name="validityEnds">
1303
1303
  <element name="validityEnds">
1304
- <ref name="ISO8601Date"/>
1304
+ <ref name="ISO8601DateTime"/>
1305
1305
  </element>
1306
1306
  </define>
1307
1307
  <define name="validityRevision">
1308
1308
  <element name="revision">
1309
- <ref name="ISO8601Date"/>
1309
+ <ref name="ISO8601DateTime"/>
1310
1310
  </element>
1311
1311
  </define>
1312
1312
  <define name="TypedTitleString">
@@ -33,12 +33,10 @@ module Metanorma
33
33
  %w(international-standard technical-specification technical-report
34
34
  publicly-available-specification international-workshop-agreement
35
35
  guide interpretation-sheet).include? @doctype or
36
- @log.add("Document Attributes", nil,
37
- "#{@doctype} is not a recognised document type")
36
+ @log.add("IEC_2", nil, params: [@doctype])
38
37
  if function = xmldoc.at("//bibdata/ext/function")&.text
39
38
  %w(emc quality-assurance safety environment).include? function or
40
- @log.add("Document Attributes", nil,
41
- "#{function} is not a recognised document function")
39
+ @log.add("IEC_3", nil, params: [function])
42
40
  end
43
41
  end
44
42
 
@@ -180,3 +178,5 @@ module Metanorma
180
178
  end
181
179
  end
182
180
  end
181
+
182
+ require_relative "log"
@@ -23,8 +23,11 @@ module Metanorma
23
23
  def metadata_status(node, xml)
24
24
  x = iso_id_default(iso_id_params(node)).stage
25
25
  xml.status do |s|
26
- s.stage x.harmonized_code.stage, **attr_code(abbreviation: x.abbr)
27
- s.substage x.harmonized_code.substage
26
+ add_noko_elem(s, "stage", x.harmonized_code.stage,
27
+ abbreviation: x.abbr)
28
+ # s.stage x.harmonized_code.stage, **attr_code(abbreviation: x.abbr)
29
+ add_noko_elem(s, "substage", x.harmonized_code.substage)
30
+ # s.substage x.harmonized_code.substage
28
31
  end
29
32
  rescue *STAGE_ERROR
30
33
  report_illegal_stage(get_stage(node), get_substage(node))
@@ -88,23 +91,38 @@ module Metanorma
88
91
  end
89
92
 
90
93
  def iso_id_out_common(xml, params, _with_prf)
91
- xml.docidentifier iso_id_default(params).to_s,
92
- **attr_code(type: "ISO", primary: "true")
93
- xml.docidentifier iso_id_reference(params).to_s,
94
- **attr_code(type: "iso-reference")
94
+ add_noko_elem(xml, "docidentifier", iso_id_default(params).to_s,
95
+ type: "ISO", primary: "true")
96
+ # xml.docidentifier iso_id_default(params).to_s,
97
+ # **attr_code(type: "ISO", primary: "true")
98
+ add_noko_elem(xml, "docidentifier", iso_id_reference(params).to_s,
99
+ type: "iso-reference")
100
+ # xml.docidentifier iso_id_reference(params).to_s,
101
+ # **attr_code(type: "iso-reference")
95
102
  @id_revdate and
96
- xml.docidentifier iso_id_revdate(params.merge(year: @id_revdate))
97
- .to_s(with_edition_month_date: true),
98
- **attr_code(type: "iso-revdate")
99
- xml.docidentifier iso_id_reference(params).urn,
100
- **attr_code(type: "URN")
103
+ add_noko_elem(xml, "docidentifier",
104
+ iso_id_revdate(params.merge(year: @id_revdate)).to_s(
105
+ with_edition_month_date: true,
106
+ ),
107
+ type: "iso-revdate")
108
+ # xml.docidentifier iso_id_revdate(params.merge(year: @id_revdate))
109
+ # .to_s(with_edition_month_date: true),
110
+ # **attr_code(type: "iso-revdate")
111
+ add_noko_elem(xml, "docidentifier", iso_id_reference(params).urn,
112
+ type: "URN")
113
+ # xml.docidentifier iso_id_reference(params).urn,
114
+ # **attr_code(type: "URN")
101
115
  end
102
116
 
103
117
  def iso_id_out_non_amd(xml, params, _with_prf)
104
- xml.docidentifier iso_id_undated(params).to_s,
105
- **attr_code(type: "iso-undated")
106
- xml.docidentifier iso_id_with_lang(params).to_s,
107
- **attr_code(type: "iso-with-lang")
118
+ add_noko_elem(xml, "docidentifier", iso_id_undated(params).to_s,
119
+ type: "iso-undated")
120
+ # xml.docidentifier iso_id_undated(params).to_s,
121
+ # **attr_code(type: "iso-undated")
122
+ add_noko_elem(xml, "docidentifier", iso_id_with_lang(params).to_s,
123
+ type: "iso-with-lang")
124
+ # xml.docidentifier iso_id_with_lang(params).to_s,
125
+ # **attr_code(type: "iso-with-lang")
108
126
  end
109
127
 
110
128
  def iso_id_revdate(params)
@@ -153,18 +171,24 @@ module Metanorma
153
171
  def report_illegal_stage(stage, substage)
154
172
  out = stage || ""
155
173
  /[A-Z]/.match?(out) or out += ".#{substage}"
156
- err = "Illegal document stage: #{out}"
157
- @log.add("Document Attributes", nil, err)
174
+ @log.add("IEC_1", nil, params: [out])
158
175
  end
159
176
 
160
177
  def metadata_ext(node, xml)
161
178
  super
162
- a = node.attr("function") and xml.function a
163
- a = node.attr("accessibility-color-inside") and
164
- xml.accessibility_color_inside a
165
- a = node.attr("cen-processing") and xml.cen_processing a
166
- a = node.attr("secretary") and xml.secretary a
167
- a = node.attr("interest-to-committees") and xml.interest_to_committees a
179
+ add_noko_elem(xml, "function", node.attr("function"))
180
+ # a = node.attr("function") and xml.function a
181
+ add_noko_elem(xml, "accessibility_color_inside",
182
+ node.attr("accessibility-color-inside"))
183
+ # a = node.attr("accessibility-color-inside") and
184
+ # xml.accessibility_color_inside a
185
+ add_noko_elem(xml, "cen_processing", node.attr("cen-processing"))
186
+ # a = node.attr("cen-processing") and xml.cen_processing a
187
+ add_noko_elem(xml, "secretary", node.attr("secretary"))
188
+ # a = node.attr("secretary") and xml.secretary a
189
+ add_noko_elem(xml, "interest_to_committees",
190
+ node.attr("interest-to-committees"))
191
+ # a = node.attr("interest-to-committees") and xml.interest_to_committees a
168
192
  end
169
193
  end
170
194
  end
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <!-- VERSION v2.1.3 -->
3
+ <!-- VERSION v2.1.4 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -905,15 +905,32 @@ titlecase, or lowercase</a:documentation>
905
905
  </element>
906
906
  </define>
907
907
  <define name="image" combine="choice">
908
- <element name="svg">
909
- <a:documentation>Add svg mark up to image</a:documentation>
910
- <oneOrMore>
911
- <choice>
912
- <text/>
913
- <ref name="AnyElement"/>
914
- </choice>
915
- </oneOrMore>
916
- </element>
908
+ <choice>
909
+ <element name="image">
910
+ <ref name="RequiredId"/>
911
+ <ref name="ImageAttributes"/>
912
+ <optional>
913
+ <element name="svg">
914
+ <a:documentation>Allow svg in image/svg, for consistency</a:documentation>
915
+ <oneOrMore>
916
+ <choice>
917
+ <text/>
918
+ <ref name="AnyElement"/>
919
+ </choice>
920
+ </oneOrMore>
921
+ </element>
922
+ </optional>
923
+ </element>
924
+ <element name="svg">
925
+ <a:documentation>Add svg mark up to image</a:documentation>
926
+ <oneOrMore>
927
+ <choice>
928
+ <text/>
929
+ <ref name="AnyElement"/>
930
+ </choice>
931
+ </oneOrMore>
932
+ </element>
933
+ </choice>
917
934
  </define>
918
935
  <define name="ParagraphFnBody" combine="interleave">
919
936
  <ref name="BlockSource">
@@ -0,0 +1,23 @@
1
+ module Metanorma
2
+ module Iec
3
+ class Converter
4
+ IEC_LOG_MESSAGES = {
5
+ # rubocop:disable Naming/VariableNumber
6
+ "IEC_1": { category: "Document Attributes",
7
+ error: "Illegal document stage: %s",
8
+ severity: 2 },
9
+ "IEC_2": { category: "Document Attributes",
10
+ error: "%s is not a recognised document type",
11
+ severity: 2 },
12
+ "IEC_3": { category: "Document Attributes",
13
+ error: "%s is not a recognised document function",
14
+ severity: 2 },
15
+ }.freeze
16
+ # rubocop:enable Naming/VariableNumber
17
+
18
+ def log_messages
19
+ super.merge(IEC_LOG_MESSAGES)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.7.7".freeze
3
+ VERSION = "2.7.9".freeze
4
4
  end
5
5
  end
6
6
 
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
31
31
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
32
32
 
33
- spec.add_dependency "metanorma-iso", "~> 3.1.0"
33
+ spec.add_dependency "metanorma-iso", "~> 3.2.0"
34
34
  spec.add_dependency "pubid"
35
35
 
36
36
  spec.add_development_dependency "debug"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.7
4
+ version: 2.7.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-13 00:00:00.000000000 Z
11
+ date: 2025-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.0
19
+ version: 3.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 3.1.0
26
+ version: 3.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pubid
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -275,6 +275,7 @@ files:
275
275
  - lib/metanorma/iec/iec.rng
276
276
  - lib/metanorma/iec/isodoc.rng
277
277
  - lib/metanorma/iec/isostandard.rng
278
+ - lib/metanorma/iec/log.rb
278
279
  - lib/metanorma/iec/processor.rb
279
280
  - lib/metanorma/iec/relaton-iec.rng
280
281
  - lib/metanorma/iec/reqt.rng