metanorma-iec 2.7.7 → 2.7.8
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 +4 -4
- data/lib/isodoc/iec/iec.international-standard.xsl +171 -82
- data/lib/metanorma/iec/converter.rb +4 -4
- data/lib/metanorma/iec/front.rb +1 -2
- data/lib/metanorma/iec/log.rb +23 -0
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f7eefcc773e3048b7ab34be286c4afa430ca40b7308fd9aea8ff214a9f19f83d
|
|
4
|
+
data.tar.gz: dfc318182ef7651aa5c1bc7c19b379674202aabe5ff5937e100207cd43211682
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 647149621b1a03d206edbfebbb5b0531382de436c1bbb33d902a8f53a4b1f3fc5626e2e01127b488225917c77fd34c34aa0aba108d7dfc5e4222cf3f4acb0baa
|
|
7
|
+
data.tar.gz: 670560402ec2a70e21a802156f1df0a45a99e00a9fc1c15d9654bc0b7ba78b7eb211f6861eae93807e0acf4f622da4770880719c031dcc2160dd6f0bc6efd265
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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) –
|
|
@@ -1836,7 +1836,10 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
1836
1836
|
</xsl:template>
|
|
1837
1837
|
|
|
1838
1838
|
<xsl:template match="mn:annex/mn:fmt-title">
|
|
1839
|
-
<
|
|
1839
|
+
<xsl:call-template name="setNamedDestination"/>
|
|
1840
|
+
<fo:block xsl:use-attribute-sets="annex-title-style">
|
|
1841
|
+
<xsl:call-template name="refine_annex-title-style"/>
|
|
1842
|
+
|
|
1840
1843
|
<xsl:apply-templates/>
|
|
1841
1844
|
<xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
|
|
1842
1845
|
</fo:block>
|
|
@@ -1844,7 +1847,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
1844
1847
|
|
|
1845
1848
|
<!-- Bibliography -->
|
|
1846
1849
|
<xsl:template match="mn:references[not(@normative='true')]/mn:fmt-title">
|
|
1847
|
-
<fo:block
|
|
1850
|
+
<fo:block xsl:use-attribute-sets="references-non-normative-title-style">
|
|
1848
1851
|
<xsl:apply-templates/>
|
|
1849
1852
|
</fo:block>
|
|
1850
1853
|
</xsl:template>
|
|
@@ -1856,47 +1859,23 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
1856
1859
|
|
|
1857
1860
|
<xsl:template match="mn:fmt-title" name="title">
|
|
1858
1861
|
|
|
1859
|
-
<xsl:variable name="
|
|
1860
|
-
<xsl:call-template name="getLevel"/>
|
|
1861
|
-
</xsl:variable>
|
|
1862
|
-
|
|
1863
|
-
<xsl:variable name="font-size">
|
|
1862
|
+
<xsl:variable name="element-name">
|
|
1864
1863
|
<xsl:choose>
|
|
1865
|
-
<xsl:when test="
|
|
1866
|
-
<xsl:
|
|
1867
|
-
<xsl:when test="ancestor::mn:references[not (preceding-sibling::mn:references)]">11pt</xsl:when>
|
|
1868
|
-
<xsl:otherwise>10pt</xsl:otherwise>
|
|
1864
|
+
<xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when>
|
|
1865
|
+
<xsl:otherwise>fo:block</xsl:otherwise>
|
|
1869
1866
|
</xsl:choose>
|
|
1870
1867
|
</xsl:variable>
|
|
1871
1868
|
|
|
1872
|
-
<xsl:
|
|
1873
|
-
<xsl:
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
<xsl:when test="$level = 2 and ancestor::mn:annex">22pt</xsl:when>
|
|
1883
|
-
<xsl:when test="$level >= 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>
|
|
1869
|
+
<xsl:variable name="title_styles">
|
|
1870
|
+
<styles xsl:use-attribute-sets="title-style"><xsl:call-template name="refine_title-style"/></styles>
|
|
1871
|
+
</xsl:variable>
|
|
1872
|
+
|
|
1873
|
+
<xsl:element name="{$element-name}">
|
|
1874
|
+
<xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*"/>
|
|
1875
|
+
|
|
1876
|
+
<xsl:apply-templates/>
|
|
1877
|
+
<xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
|
|
1878
|
+
</xsl:element>
|
|
1900
1879
|
</xsl:template>
|
|
1901
1880
|
<!-- ====== -->
|
|
1902
1881
|
<!-- ====== -->
|
|
@@ -1915,37 +1894,16 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
1915
1894
|
</xsl:choose>
|
|
1916
1895
|
</xsl:variable>
|
|
1917
1896
|
|
|
1897
|
+
<xsl:variable name="p_styles">
|
|
1898
|
+
<styles xsl:use-attribute-sets="p-style">
|
|
1899
|
+
<xsl:call-template name="refine_p-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template>
|
|
1900
|
+
</styles>
|
|
1901
|
+
</xsl:variable>
|
|
1902
|
+
|
|
1918
1903
|
<xsl:choose>
|
|
1919
1904
|
<xsl:when test="$element-name = 'fo:block'">
|
|
1920
1905
|
<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>
|
|
1906
|
+
<xsl:copy-of select="xalan:nodeset($p_styles)/styles/@*"/>
|
|
1949
1907
|
|
|
1950
1908
|
<xsl:apply-templates select="@language"/>
|
|
1951
1909
|
<xsl:apply-templates>
|
|
@@ -2100,7 +2058,7 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
2100
2058
|
<fo:page-sequence master-reference="back-page">
|
|
2101
2059
|
<fo:flow flow-name="xsl-region-body">
|
|
2102
2060
|
<fo:block-container margin-left="20mm" margin-top="19mm">
|
|
2103
|
-
<fo:block-container
|
|
2061
|
+
<fo:block-container xsl:use-attribute-sets="reset-margins-style" margin-top="0mm">
|
|
2104
2062
|
<fo:block font-size="11pt" color="{$color_blue}" margin-bottom="12pt" line-height="150%">
|
|
2105
2063
|
<fo:block-container width="42mm">
|
|
2106
2064
|
<fo:block>
|
|
@@ -4294,6 +4252,10 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
4294
4252
|
</xsl:element>
|
|
4295
4253
|
</xsl:template>
|
|
4296
4254
|
|
|
4255
|
+
<!-- show sourcecode's name 'before' or 'after' source code -->
|
|
4256
|
+
<xsl:variable name="sourcecode-name-position"><xsl:text>after</xsl:text>
|
|
4257
|
+
</xsl:variable>
|
|
4258
|
+
|
|
4297
4259
|
<xsl:template match="mn:sourcecode" name="sourcecode">
|
|
4298
4260
|
|
|
4299
4261
|
<xsl:variable name="sourcecode_attributes">
|
|
@@ -4317,7 +4279,12 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
4317
4279
|
|
|
4318
4280
|
<xsl:call-template name="refine_sourcecode-container-style"/>
|
|
4319
4281
|
|
|
4320
|
-
<fo:block-container margin-left="0mm" role="SKIP">
|
|
4282
|
+
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
|
4283
|
+
|
|
4284
|
+
<!-- <xsl:if test="$namespace = 'rsd'"> -->
|
|
4285
|
+
<xsl:if test="$sourcecode-name-position = 'before'">
|
|
4286
|
+
<xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name BEFORE content -->
|
|
4287
|
+
</xsl:if>
|
|
4321
4288
|
|
|
4322
4289
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
|
4323
4290
|
|
|
@@ -4339,7 +4306,16 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
4339
4306
|
</fo:block>
|
|
4340
4307
|
|
|
4341
4308
|
<xsl:apply-templates select="mn:dl"/> <!-- Key table -->
|
|
4342
|
-
|
|
4309
|
+
|
|
4310
|
+
<!-- <xsl:choose>
|
|
4311
|
+
<xsl:when test="$namespace = 'rsd'"></xsl:when>
|
|
4312
|
+
<xsl:otherwise>
|
|
4313
|
+
<xsl:apply-templates select="mn:fmt-name" /> --><!-- show sourcecode's name AFTER content -->
|
|
4314
|
+
<!-- </xsl:otherwise>
|
|
4315
|
+
</xsl:choose> -->
|
|
4316
|
+
<xsl:if test="$sourcecode-name-position = 'after'">
|
|
4317
|
+
<xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
|
|
4318
|
+
</xsl:if>
|
|
4343
4319
|
|
|
4344
4320
|
</fo:block-container>
|
|
4345
4321
|
</fo:block-container>
|
|
@@ -10223,6 +10199,10 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
10223
10199
|
<!-- image -->
|
|
10224
10200
|
<!-- ====== -->
|
|
10225
10201
|
|
|
10202
|
+
<!-- show figure's name 'before' or 'after' image -->
|
|
10203
|
+
<xsl:variable name="figure-name-position"><xsl:text>after</xsl:text>
|
|
10204
|
+
</xsl:variable>
|
|
10205
|
+
|
|
10226
10206
|
<xsl:template match="mn:figure" name="figure">
|
|
10227
10207
|
<xsl:variable name="isAdded" select="@added"/>
|
|
10228
10208
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
|
@@ -10235,6 +10215,10 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
10235
10215
|
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
|
10236
10216
|
</xsl:call-template>
|
|
10237
10217
|
|
|
10218
|
+
<xsl:if test="$figure-name-position = 'before'"> <!-- show figure's name BEFORE image -->
|
|
10219
|
+
<xsl:apply-templates select="mn:fmt-name"/>
|
|
10220
|
+
</xsl:if>
|
|
10221
|
+
|
|
10238
10222
|
<!-- Example: Dimensions in millimeters -->
|
|
10239
10223
|
<xsl:apply-templates select="mn:note[@type = 'units']"/>
|
|
10240
10224
|
|
|
@@ -10255,7 +10239,16 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
10255
10239
|
<xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
|
|
10256
10240
|
<xsl:call-template name="showFigureKey"/>
|
|
10257
10241
|
</xsl:if>
|
|
10258
|
-
|
|
10242
|
+
|
|
10243
|
+
<!-- <xsl:choose>
|
|
10244
|
+
<xsl:when test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'rsd'"></xsl:when>
|
|
10245
|
+
<xsl:otherwise>
|
|
10246
|
+
<xsl:apply-templates select="mn:fmt-name" /> --> <!-- show figure's name AFTER image -->
|
|
10247
|
+
<!-- </xsl:otherwise>
|
|
10248
|
+
</xsl:choose> -->
|
|
10249
|
+
<xsl:if test="$figure-name-position = 'after'">
|
|
10250
|
+
<xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
|
|
10251
|
+
</xsl:if>
|
|
10259
10252
|
|
|
10260
10253
|
</fo:block-container>
|
|
10261
10254
|
</xsl:template>
|
|
@@ -12347,10 +12340,14 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
12347
12340
|
<!-- ================ -->
|
|
12348
12341
|
|
|
12349
12342
|
<xsl:attribute-set name="references-non-normative-title-style">
|
|
12343
|
+
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
|
12344
|
+
<xsl:attribute name="text-align">center</xsl:attribute>
|
|
12345
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
|
12346
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
|
12347
|
+
<xsl:attribute name="role">H1</xsl:attribute>
|
|
12350
12348
|
</xsl:attribute-set>
|
|
12351
12349
|
|
|
12352
12350
|
<xsl:template name="refine_references-non-normative-title-style">
|
|
12353
|
-
|
|
12354
12351
|
</xsl:template>
|
|
12355
12352
|
|
|
12356
12353
|
<!-- bibitem in Normative References (references/@normative="true") -->
|
|
@@ -14462,9 +14459,15 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
14462
14459
|
<!-- ===================================== -->
|
|
14463
14460
|
|
|
14464
14461
|
<xsl:attribute-set name="annex-title-style">
|
|
14465
|
-
|
|
14462
|
+
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
|
14463
|
+
<xsl:attribute name="text-align">center</xsl:attribute>
|
|
14464
|
+
<xsl:attribute name="margin-bottom">32pt</xsl:attribute>
|
|
14465
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
|
14466
|
+
<xsl:attribute name="role">H1</xsl:attribute>
|
|
14467
|
+
</xsl:attribute-set> <!-- annex-title-style -->
|
|
14466
14468
|
|
|
14467
14469
|
<xsl:template name="refine_annex-title-style">
|
|
14470
|
+
<!-- <xsl:call-template name="setIDforNamedDestination"/> -->
|
|
14468
14471
|
</xsl:template>
|
|
14469
14472
|
|
|
14470
14473
|
<xsl:attribute-set name="p-zzSTDTitle1-style">
|
|
@@ -14473,6 +14476,79 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
14473
14476
|
<xsl:template name="refine_p-zzSTDTitle1-style">
|
|
14474
14477
|
</xsl:template>
|
|
14475
14478
|
|
|
14479
|
+
<xsl:attribute-set name="p-style">
|
|
14480
|
+
<xsl:attribute name="margin-top">5pt</xsl:attribute>
|
|
14481
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
|
14482
|
+
</xsl:attribute-set> <!-- p-style -->
|
|
14483
|
+
|
|
14484
|
+
<xsl:template name="refine_p-style">
|
|
14485
|
+
<xsl:param name="element-name"/>
|
|
14486
|
+
<xsl:param name="margin"/>
|
|
14487
|
+
<xsl:call-template name="setBlockAttributes">
|
|
14488
|
+
<xsl:with-param name="text_align_default">justify</xsl:with-param>
|
|
14489
|
+
</xsl:call-template>
|
|
14490
|
+
|
|
14491
|
+
<xsl:if test="ancestor::mn:fmt-definition">
|
|
14492
|
+
<xsl:attribute name="margin-top">1pt</xsl:attribute>
|
|
14493
|
+
</xsl:if>
|
|
14494
|
+
<xsl:if test="ancestor::mn:dl">
|
|
14495
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
|
14496
|
+
</xsl:if>
|
|
14497
|
+
|
|
14498
|
+
<xsl:if test="local-name(following-sibling::*[1])= 'table'">
|
|
14499
|
+
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
|
14500
|
+
</xsl:if>
|
|
14501
|
+
<xsl:if test="ancestor::mn:admonition">
|
|
14502
|
+
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
|
14503
|
+
</xsl:if>
|
|
14504
|
+
<xsl:if test="ancestor::mn:admonition and not(following-sibling::mn:p)">
|
|
14505
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
|
14506
|
+
</xsl:if>
|
|
14507
|
+
<xsl:if test="ancestor::mn:dl">
|
|
14508
|
+
<xsl:attribute name="margin-bottom">5pt</xsl:attribute>
|
|
14509
|
+
</xsl:if>
|
|
14510
|
+
<xsl:copy-of select="@id"/>
|
|
14511
|
+
<!-- $namespace = 'iec' -->
|
|
14512
|
+
|
|
14513
|
+
</xsl:template> <!-- refine_p-style -->
|
|
14514
|
+
|
|
14515
|
+
<xsl:attribute-set name="title-style">
|
|
14516
|
+
<!-- Note: font-size for level 1 title -->
|
|
14517
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
|
14518
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
|
14519
|
+
<xsl:attribute name="space-before">18pt</xsl:attribute>
|
|
14520
|
+
<xsl:attribute name="margin-bottom">14pt</xsl:attribute>
|
|
14521
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
|
14522
|
+
</xsl:attribute-set> <!-- title-style -->
|
|
14523
|
+
|
|
14524
|
+
<xsl:template name="refine_title-style">
|
|
14525
|
+
<xsl:param name="element-name"/>
|
|
14526
|
+
<xsl:variable name="level">
|
|
14527
|
+
<xsl:call-template name="getLevel"/>
|
|
14528
|
+
</xsl:variable>
|
|
14529
|
+
<xsl:if test="(ancestor::mn:sections and $level = 1) or (ancestor::mn:annex and $level <= 2) or (ancestor::mn:references[not (preceding-sibling::mn:references)])">
|
|
14530
|
+
<xsl:attribute name="font-size">11pt</xsl:attribute>
|
|
14531
|
+
</xsl:if>
|
|
14532
|
+
<xsl:if test="$level >= 2">
|
|
14533
|
+
<xsl:attribute name="space-before">10pt</xsl:attribute>
|
|
14534
|
+
<xsl:attribute name="margin-bottom">5pt</xsl:attribute>
|
|
14535
|
+
</xsl:if>
|
|
14536
|
+
<xsl:if test="$level = 2">
|
|
14537
|
+
<xsl:if test="ancestor::mn:annex">
|
|
14538
|
+
<xsl:attribute name="space-before">22pt</xsl:attribute>
|
|
14539
|
+
<xsl:attribute name="margin-bottom">14pt</xsl:attribute>
|
|
14540
|
+
</xsl:if>
|
|
14541
|
+
</xsl:if>
|
|
14542
|
+
<xsl:if test="$level > 2">
|
|
14543
|
+
<xsl:if test="ancestor::mn:annex">
|
|
14544
|
+
<xsl:attribute name="space-before">5pt</xsl:attribute>
|
|
14545
|
+
</xsl:if>
|
|
14546
|
+
</xsl:if>
|
|
14547
|
+
|
|
14548
|
+
<!-- $namespace = 'iec' -->
|
|
14549
|
+
<xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
|
|
14550
|
+
</xsl:template> <!-- refine_title-style -->
|
|
14551
|
+
|
|
14476
14552
|
<xsl:template name="processPrefaceSectionsDefault">
|
|
14477
14553
|
<xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
|
|
14478
14554
|
<xsl:sort select="@displayorder" data-type="number"/>
|
|
@@ -14811,6 +14887,12 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
14811
14887
|
</xsl:choose>
|
|
14812
14888
|
</xsl:template>
|
|
14813
14889
|
|
|
14890
|
+
<xsl:attribute-set name="reset-margins-style">
|
|
14891
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
|
14892
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
|
14893
|
+
<xsl:attribute name="role">SKIP</xsl:attribute>
|
|
14894
|
+
</xsl:attribute-set>
|
|
14895
|
+
|
|
14814
14896
|
<xsl:attribute-set name="clause-style">
|
|
14815
14897
|
|
|
14816
14898
|
</xsl:attribute-set>
|
|
@@ -15846,8 +15928,9 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
15846
15928
|
|
|
15847
15929
|
<xsl:template name="setTextAlignment">
|
|
15848
15930
|
<xsl:param name="default">left</xsl:param>
|
|
15931
|
+
<xsl:param name="skip_default">false</xsl:param>
|
|
15849
15932
|
<xsl:variable name="align" select="normalize-space(@align)"/>
|
|
15850
|
-
<xsl:
|
|
15933
|
+
<xsl:variable name="text_align">
|
|
15851
15934
|
<xsl:choose>
|
|
15852
15935
|
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
|
15853
15936
|
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
|
@@ -15855,9 +15938,13 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
15855
15938
|
<xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
|
|
15856
15939
|
<xsl:when test="ancestor::mn:td/@align"><xsl:value-of select="ancestor::mn:td/@align"/></xsl:when>
|
|
15857
15940
|
<xsl:when test="ancestor::mn:th/@align"><xsl:value-of select="ancestor::mn:th/@align"/></xsl:when>
|
|
15941
|
+
<xsl:when test="$skip_default = 'true'"/>
|
|
15858
15942
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
|
15859
15943
|
</xsl:choose>
|
|
15860
|
-
</xsl:
|
|
15944
|
+
</xsl:variable>
|
|
15945
|
+
<xsl:if test="normalize-space($text_align) != ''">
|
|
15946
|
+
<xsl:attribute name="text-align"><xsl:value-of select="$text_align"/></xsl:attribute>
|
|
15947
|
+
</xsl:if>
|
|
15861
15948
|
<xsl:if test="$align = 'indent'">
|
|
15862
15949
|
<xsl:attribute name="margin-left">7mm</xsl:attribute>
|
|
15863
15950
|
</xsl:if>
|
|
@@ -15865,8 +15952,10 @@ les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pa
|
|
|
15865
15952
|
|
|
15866
15953
|
<xsl:template name="setBlockAttributes">
|
|
15867
15954
|
<xsl:param name="text_align_default">left</xsl:param>
|
|
15955
|
+
<xsl:param name="skip_text_align_default">false</xsl:param>
|
|
15868
15956
|
<xsl:call-template name="setTextAlignment">
|
|
15869
15957
|
<xsl:with-param name="default" select="$text_align_default"/>
|
|
15958
|
+
<xsl:with-param name="skip_default" select="$skip_text_align_default"/>
|
|
15870
15959
|
</xsl:call-template>
|
|
15871
15960
|
<xsl:call-template name="setKeepAttributes"/>
|
|
15872
15961
|
<xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
|
|
@@ -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("
|
|
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("
|
|
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"
|
data/lib/metanorma/iec/front.rb
CHANGED
|
@@ -153,8 +153,7 @@ module Metanorma
|
|
|
153
153
|
def report_illegal_stage(stage, substage)
|
|
154
154
|
out = stage || ""
|
|
155
155
|
/[A-Z]/.match?(out) or out += ".#{substage}"
|
|
156
|
-
|
|
157
|
-
@log.add("Document Attributes", nil, err)
|
|
156
|
+
@log.add("IEC_1", nil, params: [out])
|
|
158
157
|
end
|
|
159
158
|
|
|
160
159
|
def metadata_ext(node, xml)
|
|
@@ -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
|
data/metanorma-iec.gemspec
CHANGED
|
@@ -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.
|
|
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.
|
|
4
|
+
version: 2.7.8
|
|
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-
|
|
11
|
+
date: 2025-11-03 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.
|
|
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.
|
|
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
|