metanorma-iso 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/iso/html/header.html +42 -33
- data/lib/isodoc/iso/html/isodoc.css +9 -7
- data/lib/isodoc/iso/html/isodoc.scss +7 -5
- data/lib/isodoc/iso/html/style-human.css +0 -1
- data/lib/isodoc/iso/html/style-human.scss +0 -1
- data/lib/isodoc/iso/html/style-iso.css +0 -1
- data/lib/isodoc/iso/html/style-iso.scss +0 -1
- data/lib/isodoc/iso/html/word_iso_titlepage.html +12 -11
- data/lib/isodoc/iso/html/wordstyle.css +26 -19
- data/lib/isodoc/iso/html/wordstyle.scss +32 -25
- data/lib/isodoc/iso/i18n-en.yaml +2 -2
- data/lib/isodoc/iso/i18n-fr.yaml +2 -2
- data/lib/isodoc/iso/i18n-ru.yaml +2 -2
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +2 -2
- data/lib/isodoc/iso/iso.amendment.xsl +83 -22
- data/lib/isodoc/iso/iso.international-standard.xsl +83 -22
- data/lib/metanorma/iso/boilerplate-fr.xml +5 -6
- data/lib/metanorma/iso/boilerplate-ru.xml +4 -6
- data/lib/metanorma/iso/boilerplate.xml +5 -6
- data/lib/metanorma/iso/cleanup.rb +8 -2
- data/lib/metanorma/iso/front_id.rb +1 -0
- data/lib/metanorma/iso/validate_list.rb +20 -5
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +1 -1
- data/spec/metanorma/base_spec.rb +0 -1
- data/spec/metanorma/cleanup_spec.rb +10 -10
- data/spec/metanorma/refs_spec.rb +85 -144
- data/spec/metanorma/section_spec.rb +15 -18
- data/spec/metanorma/validate_spec.rb +46 -25
- data/spec/spec_helper.rb +2 -2
- data/spec/vcr_cassettes/docrels.yml +33 -33
- data/spec/vcr_cassettes/withdrawn_iso.yml +31 -31
- metadata +5 -5
data/lib/isodoc/iso/i18n-ru.yaml
CHANGED
@@ -3,9 +3,9 @@ term_def_boilerplate: |
|
|
3
3
|
|
4
4
|
<ul>
|
5
5
|
<li> <p>ИСО, Интернет-онлайн-платформа: доступна на
|
6
|
-
<link target="
|
6
|
+
<link target="https://www.iso.org/obp"/></p></li>
|
7
7
|
<li> <p>МЭК Electropedia: доступна на
|
8
|
-
<link target="
|
8
|
+
<link target="https://www.electropedia.org"/>
|
9
9
|
</p> </li> </ul>
|
10
10
|
all_rights_reserved: Все права защищены
|
11
11
|
reference_number: Ссылочный номер
|
@@ -2,9 +2,9 @@ term_def_boilerplate: |
|
|
2
2
|
<p>ISO和IEC用于标准化的术语数据库地址如下:</p>
|
3
3
|
<ul>
|
4
4
|
<li> <p>ISO在线浏览平台:
|
5
|
-
位于<link target="
|
5
|
+
位于<link target="https://www.iso.org/obp"/></p></li>
|
6
6
|
<li> <p>IEC Electropedia:
|
7
|
-
位于<link target="
|
7
|
+
位于<link target="https://www.electropedia.org"/>
|
8
8
|
</p> </li> </ul>
|
9
9
|
all_rights_reserved: 版权所有
|
10
10
|
reference_number: 参考编号
|
@@ -1939,7 +1939,7 @@
|
|
1939
1939
|
</xsl:template>
|
1940
1940
|
|
1941
1941
|
|
1942
|
-
<xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:
|
1942
|
+
<xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:variable name="lang">
|
1943
1943
|
<xsl:call-template name="getLang"/>
|
1944
1944
|
</xsl:variable><xsl:variable name="pageWidth_">
|
1945
1945
|
210
|
@@ -6577,7 +6577,51 @@
|
|
6577
6577
|
<xsl:with-param name="text" select="$text_step1"/>
|
6578
6578
|
</xsl:call-template>
|
6579
6579
|
</xsl:variable>
|
6580
|
-
|
6580
|
+
|
6581
|
+
<!-- <xsl:value-of select="$text_step2"/> -->
|
6582
|
+
|
6583
|
+
<!-- add zero-width space after space -->
|
6584
|
+
<xsl:variable name="text_step3" select="java:replaceAll(java:java.lang.String.new($text_step2),' ',' ')"/>
|
6585
|
+
|
6586
|
+
<!-- split text by zero-width space -->
|
6587
|
+
<xsl:variable name="text_step4">
|
6588
|
+
<xsl:call-template name="split">
|
6589
|
+
<xsl:with-param name="pText" select="$text_step3"/>
|
6590
|
+
<xsl:with-param name="sep" select="$zero_width_space"/>
|
6591
|
+
<xsl:with-param name="normalize-space">false</xsl:with-param>
|
6592
|
+
<xsl:with-param name="keep_sep">true</xsl:with-param>
|
6593
|
+
</xsl:call-template>
|
6594
|
+
</xsl:variable>
|
6595
|
+
|
6596
|
+
<xsl:for-each select="xalan:nodeset($text_step4)/item">
|
6597
|
+
<xsl:choose>
|
6598
|
+
<xsl:when test="string-length() > 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
|
6599
|
+
<xsl:call-template name="interspers">
|
6600
|
+
<xsl:with-param name="str" select="."/>
|
6601
|
+
</xsl:call-template>
|
6602
|
+
</xsl:when>
|
6603
|
+
<xsl:otherwise>
|
6604
|
+
<xsl:value-of select="."/>
|
6605
|
+
</xsl:otherwise>
|
6606
|
+
</xsl:choose>
|
6607
|
+
</xsl:for-each>
|
6608
|
+
|
6609
|
+
</xsl:template><xsl:template name="interspers">
|
6610
|
+
<xsl:param name="str"/>
|
6611
|
+
<xsl:param name="char" select="$zero_width_space"/>
|
6612
|
+
<xsl:if test="$str != ''">
|
6613
|
+
<xsl:value-of select="substring($str, 1, 1)"/>
|
6614
|
+
|
6615
|
+
<xsl:variable name="next_char" select="substring($str, 2, 1)"/>
|
6616
|
+
<xsl:if test="not(contains(concat(' -.:=_— ', $char), $next_char))">
|
6617
|
+
<xsl:value-of select="$char"/>
|
6618
|
+
</xsl:if>
|
6619
|
+
|
6620
|
+
<xsl:call-template name="interspers">
|
6621
|
+
<xsl:with-param name="str" select="substring($str, 2)"/>
|
6622
|
+
<xsl:with-param name="char" select="$char"/>
|
6623
|
+
</xsl:call-template>
|
6624
|
+
</xsl:if>
|
6581
6625
|
</xsl:template><xsl:template match="*" mode="syntax_highlight">
|
6582
6626
|
<xsl:apply-templates mode="syntax_highlight"/>
|
6583
6627
|
</xsl:template><xsl:variable name="syntax_highlight_styles_">
|
@@ -7090,11 +7134,24 @@
|
|
7090
7134
|
</xsl:template><xsl:template match="*[local-name() = 'author']">
|
7091
7135
|
<xsl:text>— </xsl:text>
|
7092
7136
|
<xsl:apply-templates/>
|
7093
|
-
</xsl:template><xsl:
|
7137
|
+
</xsl:template><xsl:variable name="bibitems_">
|
7138
|
+
<xsl:for-each select="//*[local-name() = 'bibitem']">
|
7139
|
+
<xsl:copy-of select="."/>
|
7140
|
+
</xsl:for-each>
|
7141
|
+
</xsl:variable><xsl:variable name="bibitems" select="xalan:nodeset($bibitems_)"/><xsl:variable name="bibitems_hidden_">
|
7142
|
+
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
|
7143
|
+
<xsl:copy-of select="."/>
|
7144
|
+
</xsl:for-each>
|
7145
|
+
<xsl:for-each select="//*[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']">
|
7146
|
+
<xsl:copy-of select="."/>
|
7147
|
+
</xsl:for-each>
|
7148
|
+
</xsl:variable><xsl:variable name="bibitems_hidden" select="xalan:nodeset($bibitems_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
|
7094
7149
|
<xsl:variable name="current_bibitemid" select="@bibitemid"/>
|
7095
|
-
<xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/>
|
7150
|
+
<!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
|
7151
|
+
<xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
|
7096
7152
|
<xsl:choose>
|
7097
|
-
<xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
|
7153
|
+
<!-- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> --> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
|
7154
|
+
<xsl:when test="$external-destination != '' or not($bibitems_hidden/*[local-name() ='bibitem'][@id = $current_bibitemid])"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
|
7098
7155
|
<fo:inline xsl:use-attribute-sets="eref-style">
|
7099
7156
|
<xsl:if test="@type = 'footnote'">
|
7100
7157
|
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
@@ -8201,7 +8258,7 @@
|
|
8201
8258
|
<xsl:copy>
|
8202
8259
|
<xsl:copy-of select="@*"/>
|
8203
8260
|
<!-- copy all elements from bibliography except 'Normative references' (moved to 'sections') -->
|
8204
|
-
<xsl:for-each select="*[not(@normative='true') and not(*[
|
8261
|
+
<xsl:for-each select="*[not(@normative='true') and not(*[@normative='true'])]">
|
8205
8262
|
<xsl:sort select="@displayorder" data-type="number"/>
|
8206
8263
|
<xsl:apply-templates select="." mode="update_xml_step1"/>
|
8207
8264
|
</xsl:for-each>
|
@@ -8240,7 +8297,8 @@
|
|
8240
8297
|
<xsl:variable name="position"><xsl:number count="*[local-name() = $local_name][@bibitemid = $bibitemid]" level="any"/></xsl:variable>
|
8241
8298
|
<xsl:if test="normalize-space($position) = '1'">
|
8242
8299
|
<xsl:variable name="fn_text">
|
8243
|
-
<xsl:copy-of select="key('bibitems', $bibitemid)[1]/*[local-name() = 'note'][not(@type='Unpublished-Status')][normalize-space() = $localized_string_withdrawn or starts-with(normalize-space(), $localized_string_cancelled_and_replaced)]/node()"/>
|
8300
|
+
<!-- <xsl:copy-of select="key('bibitems', $bibitemid)[1]/*[local-name() = 'note'][not(@type='Unpublished-Status')][normalize-space() = $localized_string_withdrawn or starts-with(normalize-space(), $localized_string_cancelled_and_replaced)]/node()" /> -->
|
8301
|
+
<xsl:copy-of select="$bibitems/*[local-name() ='bibitem'][@id = $bibitemid][1]/*[local-name() = 'note'][not(@type='Unpublished-Status')][normalize-space() = $localized_string_withdrawn or starts-with(normalize-space(), $localized_string_cancelled_and_replaced)]/node()"/>
|
8244
8302
|
</xsl:variable>
|
8245
8303
|
<xsl:if test="normalize-space($fn_text) != ''">
|
8246
8304
|
<xsl:element name="fn" namespace="{$namespace_full}">
|
@@ -8511,22 +8569,25 @@
|
|
8511
8569
|
<xsl:param name="pText" select="."/>
|
8512
8570
|
<xsl:param name="sep" select="','"/>
|
8513
8571
|
<xsl:param name="normalize-space" select="'true'"/>
|
8572
|
+
<xsl:param name="keep_sep" select="'false'"/>
|
8514
8573
|
<xsl:if test="string-length($pText) >0">
|
8515
|
-
|
8516
|
-
|
8517
|
-
|
8518
|
-
|
8519
|
-
|
8520
|
-
|
8521
|
-
|
8522
|
-
|
8523
|
-
|
8524
|
-
|
8525
|
-
|
8526
|
-
<xsl:
|
8527
|
-
|
8528
|
-
|
8529
|
-
|
8574
|
+
<item>
|
8575
|
+
<xsl:choose>
|
8576
|
+
<xsl:when test="$normalize-space = 'true'">
|
8577
|
+
<xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
|
8578
|
+
</xsl:when>
|
8579
|
+
<xsl:otherwise>
|
8580
|
+
<xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
|
8581
|
+
</xsl:otherwise>
|
8582
|
+
</xsl:choose>
|
8583
|
+
</item>
|
8584
|
+
<xsl:if test="$keep_sep = 'true' and contains($pText, $sep)"><item><xsl:value-of select="$sep"/></item></xsl:if>
|
8585
|
+
<xsl:call-template name="split">
|
8586
|
+
<xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
|
8587
|
+
<xsl:with-param name="sep" select="$sep"/>
|
8588
|
+
<xsl:with-param name="normalize-space" select="$normalize-space"/>
|
8589
|
+
<xsl:with-param name="keep_sep" select="$keep_sep"/>
|
8590
|
+
</xsl:call-template>
|
8530
8591
|
</xsl:if>
|
8531
8592
|
</xsl:template><xsl:template name="getDocumentId">
|
8532
8593
|
<xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
|
@@ -1939,7 +1939,7 @@
|
|
1939
1939
|
</xsl:template>
|
1940
1940
|
|
1941
1941
|
|
1942
|
-
<xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:
|
1942
|
+
<xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:variable name="lang">
|
1943
1943
|
<xsl:call-template name="getLang"/>
|
1944
1944
|
</xsl:variable><xsl:variable name="pageWidth_">
|
1945
1945
|
210
|
@@ -6577,7 +6577,51 @@
|
|
6577
6577
|
<xsl:with-param name="text" select="$text_step1"/>
|
6578
6578
|
</xsl:call-template>
|
6579
6579
|
</xsl:variable>
|
6580
|
-
|
6580
|
+
|
6581
|
+
<!-- <xsl:value-of select="$text_step2"/> -->
|
6582
|
+
|
6583
|
+
<!-- add zero-width space after space -->
|
6584
|
+
<xsl:variable name="text_step3" select="java:replaceAll(java:java.lang.String.new($text_step2),' ',' ')"/>
|
6585
|
+
|
6586
|
+
<!-- split text by zero-width space -->
|
6587
|
+
<xsl:variable name="text_step4">
|
6588
|
+
<xsl:call-template name="split">
|
6589
|
+
<xsl:with-param name="pText" select="$text_step3"/>
|
6590
|
+
<xsl:with-param name="sep" select="$zero_width_space"/>
|
6591
|
+
<xsl:with-param name="normalize-space">false</xsl:with-param>
|
6592
|
+
<xsl:with-param name="keep_sep">true</xsl:with-param>
|
6593
|
+
</xsl:call-template>
|
6594
|
+
</xsl:variable>
|
6595
|
+
|
6596
|
+
<xsl:for-each select="xalan:nodeset($text_step4)/item">
|
6597
|
+
<xsl:choose>
|
6598
|
+
<xsl:when test="string-length() > 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
|
6599
|
+
<xsl:call-template name="interspers">
|
6600
|
+
<xsl:with-param name="str" select="."/>
|
6601
|
+
</xsl:call-template>
|
6602
|
+
</xsl:when>
|
6603
|
+
<xsl:otherwise>
|
6604
|
+
<xsl:value-of select="."/>
|
6605
|
+
</xsl:otherwise>
|
6606
|
+
</xsl:choose>
|
6607
|
+
</xsl:for-each>
|
6608
|
+
|
6609
|
+
</xsl:template><xsl:template name="interspers">
|
6610
|
+
<xsl:param name="str"/>
|
6611
|
+
<xsl:param name="char" select="$zero_width_space"/>
|
6612
|
+
<xsl:if test="$str != ''">
|
6613
|
+
<xsl:value-of select="substring($str, 1, 1)"/>
|
6614
|
+
|
6615
|
+
<xsl:variable name="next_char" select="substring($str, 2, 1)"/>
|
6616
|
+
<xsl:if test="not(contains(concat(' -.:=_— ', $char), $next_char))">
|
6617
|
+
<xsl:value-of select="$char"/>
|
6618
|
+
</xsl:if>
|
6619
|
+
|
6620
|
+
<xsl:call-template name="interspers">
|
6621
|
+
<xsl:with-param name="str" select="substring($str, 2)"/>
|
6622
|
+
<xsl:with-param name="char" select="$char"/>
|
6623
|
+
</xsl:call-template>
|
6624
|
+
</xsl:if>
|
6581
6625
|
</xsl:template><xsl:template match="*" mode="syntax_highlight">
|
6582
6626
|
<xsl:apply-templates mode="syntax_highlight"/>
|
6583
6627
|
</xsl:template><xsl:variable name="syntax_highlight_styles_">
|
@@ -7090,11 +7134,24 @@
|
|
7090
7134
|
</xsl:template><xsl:template match="*[local-name() = 'author']">
|
7091
7135
|
<xsl:text>— </xsl:text>
|
7092
7136
|
<xsl:apply-templates/>
|
7093
|
-
</xsl:template><xsl:
|
7137
|
+
</xsl:template><xsl:variable name="bibitems_">
|
7138
|
+
<xsl:for-each select="//*[local-name() = 'bibitem']">
|
7139
|
+
<xsl:copy-of select="."/>
|
7140
|
+
</xsl:for-each>
|
7141
|
+
</xsl:variable><xsl:variable name="bibitems" select="xalan:nodeset($bibitems_)"/><xsl:variable name="bibitems_hidden_">
|
7142
|
+
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
|
7143
|
+
<xsl:copy-of select="."/>
|
7144
|
+
</xsl:for-each>
|
7145
|
+
<xsl:for-each select="//*[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']">
|
7146
|
+
<xsl:copy-of select="."/>
|
7147
|
+
</xsl:for-each>
|
7148
|
+
</xsl:variable><xsl:variable name="bibitems_hidden" select="xalan:nodeset($bibitems_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
|
7094
7149
|
<xsl:variable name="current_bibitemid" select="@bibitemid"/>
|
7095
|
-
<xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/>
|
7150
|
+
<!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
|
7151
|
+
<xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
|
7096
7152
|
<xsl:choose>
|
7097
|
-
<xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
|
7153
|
+
<!-- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> --> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
|
7154
|
+
<xsl:when test="$external-destination != '' or not($bibitems_hidden/*[local-name() ='bibitem'][@id = $current_bibitemid])"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
|
7098
7155
|
<fo:inline xsl:use-attribute-sets="eref-style">
|
7099
7156
|
<xsl:if test="@type = 'footnote'">
|
7100
7157
|
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
@@ -8201,7 +8258,7 @@
|
|
8201
8258
|
<xsl:copy>
|
8202
8259
|
<xsl:copy-of select="@*"/>
|
8203
8260
|
<!-- copy all elements from bibliography except 'Normative references' (moved to 'sections') -->
|
8204
|
-
<xsl:for-each select="*[not(@normative='true') and not(*[
|
8261
|
+
<xsl:for-each select="*[not(@normative='true') and not(*[@normative='true'])]">
|
8205
8262
|
<xsl:sort select="@displayorder" data-type="number"/>
|
8206
8263
|
<xsl:apply-templates select="." mode="update_xml_step1"/>
|
8207
8264
|
</xsl:for-each>
|
@@ -8240,7 +8297,8 @@
|
|
8240
8297
|
<xsl:variable name="position"><xsl:number count="*[local-name() = $local_name][@bibitemid = $bibitemid]" level="any"/></xsl:variable>
|
8241
8298
|
<xsl:if test="normalize-space($position) = '1'">
|
8242
8299
|
<xsl:variable name="fn_text">
|
8243
|
-
<xsl:copy-of select="key('bibitems', $bibitemid)[1]/*[local-name() = 'note'][not(@type='Unpublished-Status')][normalize-space() = $localized_string_withdrawn or starts-with(normalize-space(), $localized_string_cancelled_and_replaced)]/node()"/>
|
8300
|
+
<!-- <xsl:copy-of select="key('bibitems', $bibitemid)[1]/*[local-name() = 'note'][not(@type='Unpublished-Status')][normalize-space() = $localized_string_withdrawn or starts-with(normalize-space(), $localized_string_cancelled_and_replaced)]/node()" /> -->
|
8301
|
+
<xsl:copy-of select="$bibitems/*[local-name() ='bibitem'][@id = $bibitemid][1]/*[local-name() = 'note'][not(@type='Unpublished-Status')][normalize-space() = $localized_string_withdrawn or starts-with(normalize-space(), $localized_string_cancelled_and_replaced)]/node()"/>
|
8244
8302
|
</xsl:variable>
|
8245
8303
|
<xsl:if test="normalize-space($fn_text) != ''">
|
8246
8304
|
<xsl:element name="fn" namespace="{$namespace_full}">
|
@@ -8511,22 +8569,25 @@
|
|
8511
8569
|
<xsl:param name="pText" select="."/>
|
8512
8570
|
<xsl:param name="sep" select="','"/>
|
8513
8571
|
<xsl:param name="normalize-space" select="'true'"/>
|
8572
|
+
<xsl:param name="keep_sep" select="'false'"/>
|
8514
8573
|
<xsl:if test="string-length($pText) >0">
|
8515
|
-
|
8516
|
-
|
8517
|
-
|
8518
|
-
|
8519
|
-
|
8520
|
-
|
8521
|
-
|
8522
|
-
|
8523
|
-
|
8524
|
-
|
8525
|
-
|
8526
|
-
<xsl:
|
8527
|
-
|
8528
|
-
|
8529
|
-
|
8574
|
+
<item>
|
8575
|
+
<xsl:choose>
|
8576
|
+
<xsl:when test="$normalize-space = 'true'">
|
8577
|
+
<xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
|
8578
|
+
</xsl:when>
|
8579
|
+
<xsl:otherwise>
|
8580
|
+
<xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
|
8581
|
+
</xsl:otherwise>
|
8582
|
+
</xsl:choose>
|
8583
|
+
</item>
|
8584
|
+
<xsl:if test="$keep_sep = 'true' and contains($pText, $sep)"><item><xsl:value-of select="$sep"/></item></xsl:if>
|
8585
|
+
<xsl:call-template name="split">
|
8586
|
+
<xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
|
8587
|
+
<xsl:with-param name="sep" select="$sep"/>
|
8588
|
+
<xsl:with-param name="normalize-space" select="$normalize-space"/>
|
8589
|
+
<xsl:with-param name="keep_sep" select="$keep_sep"/>
|
8590
|
+
</xsl:call-template>
|
8530
8591
|
</xsl:if>
|
8531
8592
|
</xsl:template><xsl:template name="getDocumentId">
|
8532
8593
|
<xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
|
@@ -1,11 +1,11 @@
|
|
1
1
|
<boilerplate>
|
2
2
|
<copyright-statement>
|
3
3
|
<clause>
|
4
|
-
<title>DOCUMENT PROTÉGÉ PAR COPYRIGHT</title>
|
5
4
|
<p id="boilerplate-year">© {{ agency }} {{ docyear }}</p>
|
6
5
|
|
7
6
|
<p id="boilerplate-message">
|
8
|
-
Droits de reproduction réservés. Sauf indication contraire,
|
7
|
+
Droits de reproduction réservés. Sauf indication contraire, ou requise dans le cadre de sa mise en œuvre,
|
8
|
+
aucune partie de cette publication ne
|
9
9
|
peut être reproduite ni utilisée sous quelque forme que ce soit et par aucun procédé, électronique
|
10
10
|
ou mécanique, y compris la photocopie, l’affichage sur l’internet ou sur un Intranet, sans
|
11
11
|
autorisation écrite préalable. Les demandes d’autorisation peuvent être adressées à l’ISO à
|
@@ -14,10 +14,9 @@ l’adresse ci-après ou au comité membre de l’ISO dans le pays du demandeur.
|
|
14
14
|
|
15
15
|
<p id="boilerplate-address" align="left">
|
16
16
|
ISO copyright office<br/>
|
17
|
-
Ch. de Blandonnet 8
|
18
|
-
CH-1214 Vernier, Geneva
|
19
|
-
|
20
|
-
Fax  + 41 22 749 09 47<br/>
|
17
|
+
CP 401 • Ch. de Blandonnet 8<br/>
|
18
|
+
CH-1214 Vernier, Geneva<br/>
|
19
|
+
Tél.  + 41 22 749 01 11<br/>
|
21
20
|
Email: copyright@iso.org<br/>
|
22
21
|
Website: www.iso.org
|
23
22
|
</p>
|
@@ -1,21 +1,19 @@
|
|
1
1
|
<boilerplate>
|
2
2
|
<copyright-statement>
|
3
3
|
<clause>
|
4
|
-
<title>ДОКУМЕНТ, ОХРАНЯЕМЫЙ АВТОРСКИМ ПРАВОМ</title>
|
5
4
|
<p id="boilerplate-year">
|
6
5
|
© {{ agency }} {{ docyear }}
|
7
6
|
</p>
|
8
7
|
|
9
8
|
<p id="boilerplate-message">
|
10
|
-
Все права защищены. Если иначе не
|
9
|
+
Все права защищены. Если иначе не определено или не требуется в контексте его реализации, никакая часть этой публикации не может быть воспроизведена или использована иначе в любой форме или каким-либо образом, электронным или механическим, включая фотокопирование, или публикацию в Интернете или интранете, без предварительного письменного разрешения. Разрешение может быть запрошено ISO по адресу, указанному ниже, или у органа — члена ISO страны запрашивающего.
|
11
10
|
</p>
|
12
11
|
|
13
12
|
<p id="boilerplate-address" align="left">
|
14
13
|
Бюро ISO по охране авторских прав<br/>
|
15
|
-
Ch. de Blandonnet 8
|
16
|
-
CH-1214 Vernier, Geneva
|
17
|
-
|
18
|
-
Fax  + 41 22 749 09 47<br/>
|
14
|
+
CP 401 • Ch. de Blandonnet 8<br/>
|
15
|
+
CH-1214 Vernier, Geneva<br/>
|
16
|
+
Тел.  + 41 22 749 01 11<br/>
|
19
17
|
Электронная почта: copyright@iso.org<br/>
|
20
18
|
Сайт: www.iso.org
|
21
19
|
</p>
|
@@ -1,14 +1,14 @@
|
|
1
1
|
<boilerplate>
|
2
2
|
<copyright-statement>
|
3
3
|
<clause>
|
4
|
-
<title>COPYRIGHT PROTECTED DOCUMENT</title>
|
5
4
|
<p id="boilerplate-year">
|
6
5
|
© {{ agency }} {{ docyear }}
|
7
6
|
</p>
|
8
7
|
|
9
8
|
<p id="boilerplate-message">
|
10
9
|
All rights
|
11
|
-
reserved. Unless otherwise specified,
|
10
|
+
reserved. Unless otherwise specified, or required in the context of its implementation,
|
11
|
+
no part of this publication may be
|
12
12
|
reproduced or utilized otherwise in any form or by any means, electronic or
|
13
13
|
mechanical, including photocopying, or posting on the internet or an intranet,
|
14
14
|
without prior written permission. Permission can be requested from either ISO
|
@@ -17,10 +17,9 @@ at the address below or ISO's member body in the country of the requester.
|
|
17
17
|
|
18
18
|
<p id="boilerplate-address" align="left">
|
19
19
|
ISO copyright office<br/>
|
20
|
-
Ch. de Blandonnet 8
|
21
|
-
CH-1214 Vernier, Geneva
|
22
|
-
|
23
|
-
Fax  + 41 22 749 09 47<br/>
|
20
|
+
CP 401 • Ch. de Blandonnet 8<br/>
|
21
|
+
CH-1214 Vernier, Geneva<br/>
|
22
|
+
Phone:  + 41 22 749 01 11<br/>
|
24
23
|
Email: copyright@iso.org<br/>
|
25
24
|
Website: www.iso.org
|
26
25
|
</p>
|
@@ -165,8 +165,7 @@ module Metanorma
|
|
165
165
|
def withdrawn_note(xmldoc)
|
166
166
|
xmldoc.xpath("//bibitem[not(note[@type = 'Unpublished-Status'])]")
|
167
167
|
.each do |b|
|
168
|
-
next
|
169
|
-
next unless (s = b.at("./status/stage")) && (s.text.to_i >= 90)
|
168
|
+
next unless withdrawn_ref?(b)
|
170
169
|
|
171
170
|
if id = replacement_standard(b)
|
172
171
|
insert_unpub_note(b, @i18n.cancelled_and_replaced.sub(/%/, id))
|
@@ -176,6 +175,13 @@ module Metanorma
|
|
176
175
|
end
|
177
176
|
end
|
178
177
|
|
178
|
+
def withdrawn_ref?(biblio)
|
179
|
+
return false if pub_class(biblio) > 2
|
180
|
+
|
181
|
+
(s = biblio.at("./status/stage")) && (s.text.to_i == 95) &&
|
182
|
+
(t = biblio.at("./status/substage")) && (t.text.to_i == 99)
|
183
|
+
end
|
184
|
+
|
179
185
|
def replacement_standard(biblio)
|
180
186
|
r = biblio.at("./relation[@type = 'updates']/bibitem") or return nil
|
181
187
|
id = r.at("./formattedref | ./docidentifier[@primary = 'true'] | "\
|
@@ -39,6 +39,7 @@ module Metanorma
|
|
39
39
|
ret = STAGE_ABBRS[stage.to_sym]
|
40
40
|
ret = "PRF" if stage == "60" && substage == "00"
|
41
41
|
ret = "AWI" if stage == "10" && substage == "99"
|
42
|
+
ret = "AWI" if stage == "20" && substage == "00"
|
42
43
|
if %w(amendment technical-corrigendum technical-report
|
43
44
|
technical-specification).include?(doctype)
|
44
45
|
ret = "D" if stage == "40" && doctype == "amendment"
|
@@ -43,6 +43,7 @@ module Metanorma
|
|
43
43
|
|
44
44
|
def skip_list_punctuation(list)
|
45
45
|
return true if list.at("./ancestor::table")
|
46
|
+
return true if list.at("./following-sibling::term") # terms boilerplate
|
46
47
|
|
47
48
|
list.xpath(".//li").each do |entry|
|
48
49
|
l = entry.dup
|
@@ -65,7 +66,7 @@ module Metanorma
|
|
65
66
|
|
66
67
|
# if first list entry starts lowercase, treat as sentence broken up
|
67
68
|
def list_after_colon_punctuation(list, entries)
|
68
|
-
lower = list.at(".//li").text
|
69
|
+
lower = starts_lowercase?(list.at(".//li").text)
|
69
70
|
entries.each_with_index do |li, i|
|
70
71
|
if lower
|
71
72
|
list_semicolon_phrase(li, i == entries.size - 1)
|
@@ -77,10 +78,14 @@ module Metanorma
|
|
77
78
|
|
78
79
|
def list_semicolon_phrase(elem, last)
|
79
80
|
text = elem.text.strip
|
80
|
-
|
81
|
+
starts_lowercase?(text) or
|
81
82
|
style_warning(elem, "List entry of broken up sentence must start "\
|
82
83
|
"with lowercase letter", text)
|
83
|
-
|
84
|
+
list_semicolon_phrase_punct(elem, text, last)
|
85
|
+
end
|
86
|
+
|
87
|
+
def list_semicolon_phrase_punct(elem, text, last)
|
88
|
+
punct = text.strip.sub(/^.*?(\S)$/m, "\\1")
|
84
89
|
if last
|
85
90
|
punct == "." or
|
86
91
|
style_warning(elem, "Final list entry of broken up "\
|
@@ -94,14 +99,24 @@ module Metanorma
|
|
94
99
|
|
95
100
|
def list_full_sentence(elem)
|
96
101
|
text = elem.text.strip
|
97
|
-
|
102
|
+
starts_uppercase?(text) or
|
98
103
|
style_warning(elem, "List entry of separate sentences must start "\
|
99
104
|
"with uppercase letter", text)
|
100
|
-
punct = text.sub(/^.*?(\S)
|
105
|
+
punct = text.strip.sub(/^.*?(\S)$/m, "\\1")
|
101
106
|
punct == "." or
|
102
107
|
style_warning(elem, "List entry of separate sentences must "\
|
103
108
|
"end with full stop", text)
|
104
109
|
end
|
110
|
+
|
111
|
+
# allow that all-caps word (acronym) is agnostic as to lowercase
|
112
|
+
def starts_lowercase?(text)
|
113
|
+
text.match?(/^[^[[:upper:]][[:lower:]]]*[[:lower:]]/) ||
|
114
|
+
text.match?(/^[^[[:upper:]][[:lower:]]]*[[:upper:]][[:upper:]]+[^[[:alpha:]]]/)
|
115
|
+
end
|
116
|
+
|
117
|
+
def starts_uppercase?(text)
|
118
|
+
text.match?(/^[^[[:upper:]][[:lower:]]]*[[:upper:]]/)
|
119
|
+
end
|
105
120
|
end
|
106
121
|
end
|
107
122
|
end
|
data/metanorma-iso.gemspec
CHANGED
@@ -46,6 +46,6 @@ Gem::Specification.new do |spec|
|
|
46
46
|
spec.add_development_dependency "sassc", "2.4.0"
|
47
47
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
48
48
|
spec.add_development_dependency "timecop", "~> 0.9"
|
49
|
-
spec.add_development_dependency "vcr", "~>
|
49
|
+
spec.add_development_dependency "vcr", "~> 6.1.0"
|
50
50
|
spec.add_development_dependency "webmock"
|
51
51
|
end
|
data/spec/metanorma/base_spec.rb
CHANGED
@@ -1247,13 +1247,13 @@ RSpec.describe Metanorma::ISO do
|
|
1247
1247
|
<li>
|
1248
1248
|
<p id='_'>
|
1249
1249
|
ISO Online browsing platform: available at
|
1250
|
-
<link target='
|
1250
|
+
<link target='https://www.iso.org/obp'/>
|
1251
1251
|
</p>
|
1252
1252
|
</li>
|
1253
1253
|
<li>
|
1254
1254
|
<p id='_'>
|
1255
1255
|
IEC Electropedia: available at
|
1256
|
-
<link target='
|
1256
|
+
<link target='https://www.electropedia.org'/>
|
1257
1257
|
</p>
|
1258
1258
|
</li>
|
1259
1259
|
</ul>
|
@@ -1296,13 +1296,13 @@ RSpec.describe Metanorma::ISO do
|
|
1296
1296
|
<li>
|
1297
1297
|
<p id='_'>
|
1298
1298
|
ISO Online browsing platform: available at
|
1299
|
-
<link target='
|
1299
|
+
<link target='https://www.iso.org/obp'/>
|
1300
1300
|
</p>
|
1301
1301
|
</li>
|
1302
1302
|
<li>
|
1303
1303
|
<p id='_'>
|
1304
1304
|
IEC Electropedia: available at
|
1305
|
-
<link target='
|
1305
|
+
<link target='https://www.electropedia.org'/>
|
1306
1306
|
</p>
|
1307
1307
|
</li>
|
1308
1308
|
</ul>
|
@@ -1360,13 +1360,13 @@ RSpec.describe Metanorma::ISO do
|
|
1360
1360
|
<li>
|
1361
1361
|
<p id='_'>
|
1362
1362
|
ISO Online browsing platform: available at
|
1363
|
-
<link target='
|
1363
|
+
<link target='https://www.iso.org/obp'/>
|
1364
1364
|
</p>
|
1365
1365
|
</li>
|
1366
1366
|
<li>
|
1367
1367
|
<p id='_'>
|
1368
1368
|
IEC Electropedia: available at
|
1369
|
-
<link target='
|
1369
|
+
<link target='https://www.electropedia.org'/>
|
1370
1370
|
</p>
|
1371
1371
|
</li>
|
1372
1372
|
</ul>
|
@@ -1427,13 +1427,13 @@ RSpec.describe Metanorma::ISO do
|
|
1427
1427
|
<li>
|
1428
1428
|
<p id='_'>
|
1429
1429
|
ISO Online browsing platform: available at
|
1430
|
-
<link target='
|
1430
|
+
<link target='https://www.iso.org/obp'/>
|
1431
1431
|
</p>
|
1432
1432
|
</li>
|
1433
1433
|
<li>
|
1434
1434
|
<p id='_'>
|
1435
1435
|
IEC Electropedia: available at
|
1436
|
-
<link target='
|
1436
|
+
<link target='https://www.electropedia.org'/>
|
1437
1437
|
</p>
|
1438
1438
|
</li>
|
1439
1439
|
</ul>
|
@@ -1485,13 +1485,13 @@ RSpec.describe Metanorma::ISO do
|
|
1485
1485
|
<li>
|
1486
1486
|
<p id='_'>
|
1487
1487
|
ISO Online browsing platform: available at
|
1488
|
-
<link target='
|
1488
|
+
<link target='https://www.iso.org/obp'/>
|
1489
1489
|
</p>
|
1490
1490
|
</li>
|
1491
1491
|
<li>
|
1492
1492
|
<p id='_'>
|
1493
1493
|
IEC Electropedia: available at
|
1494
|
-
<link target='
|
1494
|
+
<link target='https://www.electropedia.org'/>
|
1495
1495
|
</p>
|
1496
1496
|
</li>
|
1497
1497
|
</ul>
|