metanorma-ieee 1.1.10 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/ieee/html/wp_image001_icr.emz +0 -0
- data/lib/isodoc/ieee/html/wp_image003_icr.emz +0 -0
- data/lib/isodoc/ieee/html/wp_image008_icr.emz +0 -0
- data/lib/isodoc/ieee/ieee.amendment.xsl +63 -12
- data/lib/isodoc/ieee/ieee.standard.xsl +63 -12
- data/lib/isodoc/ieee/metadata.rb +1 -2
- data/lib/isodoc/ieee/presentation_bibdata.rb +9 -4
- data/lib/isodoc/ieee/presentation_ref.rb +9 -3
- data/lib/isodoc/ieee/presentation_terms.rb +3 -5
- data/lib/isodoc/ieee/word_cleanup.rb +2 -0
- data/lib/metanorma/ieee/basicdoc.rng +94 -8
- data/lib/metanorma/ieee/biblio-standoc.rng +44 -1
- data/lib/metanorma/ieee/biblio.rng +11 -0
- data/lib/metanorma/ieee/boilerplate.adoc +1 -1
- data/lib/metanorma/ieee/cleanup.rb +9 -5
- data/lib/metanorma/ieee/cleanup_ref.rb +112 -9
- data/lib/metanorma/ieee/front.rb +69 -4
- data/lib/metanorma/ieee/ieee-footnotes.yaml +77 -0
- data/lib/metanorma/ieee/isodoc.rng +13 -64
- data/lib/metanorma/ieee/reqt.rng +0 -16
- data/lib/metanorma/ieee/validate.rb +0 -2
- data/lib/metanorma/ieee/version.rb +1 -1
- data/metanorma-ieee.gemspec +2 -2
- metadata +22 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: daaebf8c438f244ad1a0cc4c804f1aac05fcdf3252bb9b2847f0ab056ed5ffc0
|
4
|
+
data.tar.gz: 4cf01847b8a56f6e9a520cd7509cc56cec8077d891bef18beed30262688e87bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8af52bc41555e8ef7ff4f296dd65522cab8896226b9cbdad0b443f49a4a428343c0c205ff733845f8a4e93f707f543e152897b5895456ab2b72494e3c0a2cddc
|
7
|
+
data.tar.gz: f2b0d65f7e1e5e853363ac60dd7608b90d04f97368360dd60701e60d115f09d7973bd4791edd76b990f13d5628224c78e0883185743187efb532e1e1a68dad00
|
Binary file
|
Binary file
|
Binary file
|
@@ -5622,7 +5622,9 @@
|
|
5622
5622
|
</xsl:template> <!-- license-statement/p -->
|
5623
5623
|
|
5624
5624
|
<xsl:template match="*[local-name()='legal-statement']">
|
5625
|
+
<xsl:param name="isLegacy">false</xsl:param>
|
5625
5626
|
<fo:block xsl:use-attribute-sets="legal-statement-style">
|
5627
|
+
|
5626
5628
|
<xsl:apply-templates/>
|
5627
5629
|
</fo:block>
|
5628
5630
|
</xsl:template> <!-- legal-statement -->
|
@@ -7915,13 +7917,14 @@
|
|
7915
7917
|
<!-- ================= -->
|
7916
7918
|
<!-- Added,deleted text -->
|
7917
7919
|
<!-- ================= -->
|
7918
|
-
<xsl:template match="*[local-name()='add']" name="tag_add">
|
7920
|
+
<xsl:template match="*[local-name()='add'] | *[local-name() = 'change-open-tag'] | *[local-name() = 'change-close-tag']" name="tag_add">
|
7919
7921
|
<xsl:param name="skip">true</xsl:param>
|
7920
7922
|
<xsl:param name="block">false</xsl:param>
|
7921
7923
|
<xsl:param name="type"/>
|
7922
7924
|
<xsl:param name="text-align"/>
|
7923
7925
|
<xsl:choose>
|
7924
|
-
<xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start
|
7926
|
+
<xsl:when test="starts-with(., $ace_tag) or local-name() = 'change-open-tag' or local-name() = 'change-close-tag'"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start, or
|
7927
|
+
<change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
|
7925
7928
|
<xsl:choose>
|
7926
7929
|
<xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab']) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
|
7927
7930
|
<xsl:otherwise>
|
@@ -7929,12 +7932,32 @@
|
|
7929
7932
|
<xsl:call-template name="insertTag">
|
7930
7933
|
<xsl:with-param name="type">
|
7931
7934
|
<xsl:choose>
|
7935
|
+
<xsl:when test="local-name() = 'change-open-tag'">start</xsl:when>
|
7936
|
+
<xsl:when test="local-name() = 'change-close-tag'">end</xsl:when>
|
7932
7937
|
<xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
|
7933
7938
|
<xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
|
7934
7939
|
</xsl:choose>
|
7935
7940
|
</xsl:with-param>
|
7936
|
-
<xsl:with-param name="kind"
|
7937
|
-
|
7941
|
+
<xsl:with-param name="kind">
|
7942
|
+
<xsl:choose>
|
7943
|
+
<xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
|
7944
|
+
<xsl:value-of select="text()"/>
|
7945
|
+
</xsl:when>
|
7946
|
+
<xsl:otherwise>
|
7947
|
+
<xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
|
7948
|
+
</xsl:otherwise>
|
7949
|
+
</xsl:choose>
|
7950
|
+
</xsl:with-param>
|
7951
|
+
<xsl:with-param name="value">
|
7952
|
+
<xsl:choose>
|
7953
|
+
<xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
|
7954
|
+
<xsl:value-of select="*[local-name() = 'sub']"/>
|
7955
|
+
</xsl:when>
|
7956
|
+
<xsl:otherwise>
|
7957
|
+
<xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
|
7958
|
+
</xsl:otherwise>
|
7959
|
+
</xsl:choose>
|
7960
|
+
</xsl:with-param>
|
7938
7961
|
</xsl:call-template>
|
7939
7962
|
</xsl:variable>
|
7940
7963
|
<xsl:choose>
|
@@ -10144,11 +10167,17 @@
|
|
10144
10167
|
</xsl:when>
|
10145
10168
|
<xsl:otherwise>
|
10146
10169
|
|
10170
|
+
<xsl:variable name="image_class" select="ancestor::*[local-name() = 'image']/@class"/>
|
10171
|
+
<xsl:variable name="ancestor_table_cell" select="normalize-space(ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])"/>
|
10172
|
+
|
10147
10173
|
<xsl:variable name="element">
|
10148
10174
|
<xsl:choose>
|
10149
10175
|
<xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
|
10150
10176
|
<fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
|
10151
10177
|
</xsl:when>
|
10178
|
+
<xsl:when test="not(ancestor::*[local-name() = 'figure'])">
|
10179
|
+
<fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
|
10180
|
+
</xsl:when>
|
10152
10181
|
<xsl:otherwise>
|
10153
10182
|
<fo:block xsl:use-attribute-sets="image-style">
|
10154
10183
|
<xsl:if test="ancestor::*[local-name() = 'dt']">
|
@@ -10164,10 +10193,24 @@
|
|
10164
10193
|
<xsl:copy-of select="@*"/>
|
10165
10194
|
<!-- <fo:block xsl:use-attribute-sets="image-style"> -->
|
10166
10195
|
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
10167
|
-
|
10168
|
-
|
10169
|
-
|
10170
|
-
|
10196
|
+
|
10197
|
+
<xsl:choose>
|
10198
|
+
<xsl:when test="$image_class = 'corrigenda-tag'">
|
10199
|
+
<xsl:attribute name="fox:alt-text">CorrigendaTag</xsl:attribute>
|
10200
|
+
<xsl:attribute name="baseline-shift">-10%</xsl:attribute>
|
10201
|
+
<xsl:if test="$ancestor_table_cell = 'true'">
|
10202
|
+
<xsl:attribute name="baseline-shift">-25%</xsl:attribute>
|
10203
|
+
</xsl:if>
|
10204
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
10205
|
+
</xsl:when>
|
10206
|
+
<xsl:otherwise>
|
10207
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
10208
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
10209
|
+
</xsl:if>
|
10210
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
10211
|
+
</xsl:otherwise>
|
10212
|
+
</xsl:choose>
|
10213
|
+
|
10171
10214
|
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
10172
10215
|
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
|
10173
10216
|
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
|
@@ -12335,14 +12378,16 @@
|
|
12335
12378
|
|
12336
12379
|
<xsl:template match="*[local-name() = 'annex']">
|
12337
12380
|
<fo:block break-after="page"/>
|
12338
|
-
<fo:block
|
12381
|
+
<fo:block>
|
12339
12382
|
|
12340
12383
|
<xsl:call-template name="setBlockSpanAll"/>
|
12341
12384
|
|
12342
12385
|
<xsl:call-template name="refine_annex_style"/>
|
12343
12386
|
|
12344
12387
|
</fo:block>
|
12345
|
-
<
|
12388
|
+
<fo:block id="{@id}">
|
12389
|
+
<xsl:apply-templates/>
|
12390
|
+
</fo:block>
|
12346
12391
|
</xsl:template>
|
12347
12392
|
|
12348
12393
|
<xsl:template name="refine_annex_style">
|
@@ -12362,13 +12407,19 @@
|
|
12362
12407
|
<fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
12363
12408
|
</xsl:when>
|
12364
12409
|
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
12365
|
-
<xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
|
12410
|
+
<xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
|
12411
|
+
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
12412
|
+
</xsl:when>
|
12413
|
+
<xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
|
12366
12414
|
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
12367
12415
|
</xsl:when>
|
12368
12416
|
</xsl:choose>
|
12369
12417
|
|
12370
12418
|
</xsl:template>
|
12371
12419
|
|
12420
|
+
<!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
|
12421
|
+
<xsl:template match="*[local-name() = 'review'][@type = 'other']"/>
|
12422
|
+
|
12372
12423
|
<xsl:template match="*[local-name() = 'name']/text()">
|
12373
12424
|
<!-- 0xA0 to space replacement -->
|
12374
12425
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
@@ -14135,7 +14186,7 @@
|
|
14135
14186
|
|
14136
14187
|
<xsl:template name="printEdition">
|
14137
14188
|
<xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
|
14138
|
-
|
14189
|
+
|
14139
14190
|
<xsl:choose>
|
14140
14191
|
<xsl:when test="$edition_i18n != ''">
|
14141
14192
|
<!-- Example: <edition language="fr">deuxième édition</edition> -->
|
@@ -5622,7 +5622,9 @@
|
|
5622
5622
|
</xsl:template> <!-- license-statement/p -->
|
5623
5623
|
|
5624
5624
|
<xsl:template match="*[local-name()='legal-statement']">
|
5625
|
+
<xsl:param name="isLegacy">false</xsl:param>
|
5625
5626
|
<fo:block xsl:use-attribute-sets="legal-statement-style">
|
5627
|
+
|
5626
5628
|
<xsl:apply-templates/>
|
5627
5629
|
</fo:block>
|
5628
5630
|
</xsl:template> <!-- legal-statement -->
|
@@ -7915,13 +7917,14 @@
|
|
7915
7917
|
<!-- ================= -->
|
7916
7918
|
<!-- Added,deleted text -->
|
7917
7919
|
<!-- ================= -->
|
7918
|
-
<xsl:template match="*[local-name()='add']" name="tag_add">
|
7920
|
+
<xsl:template match="*[local-name()='add'] | *[local-name() = 'change-open-tag'] | *[local-name() = 'change-close-tag']" name="tag_add">
|
7919
7921
|
<xsl:param name="skip">true</xsl:param>
|
7920
7922
|
<xsl:param name="block">false</xsl:param>
|
7921
7923
|
<xsl:param name="type"/>
|
7922
7924
|
<xsl:param name="text-align"/>
|
7923
7925
|
<xsl:choose>
|
7924
|
-
<xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start
|
7926
|
+
<xsl:when test="starts-with(., $ace_tag) or local-name() = 'change-open-tag' or local-name() = 'change-close-tag'"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start, or
|
7927
|
+
<change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
|
7925
7928
|
<xsl:choose>
|
7926
7929
|
<xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab']) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
|
7927
7930
|
<xsl:otherwise>
|
@@ -7929,12 +7932,32 @@
|
|
7929
7932
|
<xsl:call-template name="insertTag">
|
7930
7933
|
<xsl:with-param name="type">
|
7931
7934
|
<xsl:choose>
|
7935
|
+
<xsl:when test="local-name() = 'change-open-tag'">start</xsl:when>
|
7936
|
+
<xsl:when test="local-name() = 'change-close-tag'">end</xsl:when>
|
7932
7937
|
<xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
|
7933
7938
|
<xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
|
7934
7939
|
</xsl:choose>
|
7935
7940
|
</xsl:with-param>
|
7936
|
-
<xsl:with-param name="kind"
|
7937
|
-
|
7941
|
+
<xsl:with-param name="kind">
|
7942
|
+
<xsl:choose>
|
7943
|
+
<xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
|
7944
|
+
<xsl:value-of select="text()"/>
|
7945
|
+
</xsl:when>
|
7946
|
+
<xsl:otherwise>
|
7947
|
+
<xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
|
7948
|
+
</xsl:otherwise>
|
7949
|
+
</xsl:choose>
|
7950
|
+
</xsl:with-param>
|
7951
|
+
<xsl:with-param name="value">
|
7952
|
+
<xsl:choose>
|
7953
|
+
<xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
|
7954
|
+
<xsl:value-of select="*[local-name() = 'sub']"/>
|
7955
|
+
</xsl:when>
|
7956
|
+
<xsl:otherwise>
|
7957
|
+
<xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
|
7958
|
+
</xsl:otherwise>
|
7959
|
+
</xsl:choose>
|
7960
|
+
</xsl:with-param>
|
7938
7961
|
</xsl:call-template>
|
7939
7962
|
</xsl:variable>
|
7940
7963
|
<xsl:choose>
|
@@ -10144,11 +10167,17 @@
|
|
10144
10167
|
</xsl:when>
|
10145
10168
|
<xsl:otherwise>
|
10146
10169
|
|
10170
|
+
<xsl:variable name="image_class" select="ancestor::*[local-name() = 'image']/@class"/>
|
10171
|
+
<xsl:variable name="ancestor_table_cell" select="normalize-space(ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])"/>
|
10172
|
+
|
10147
10173
|
<xsl:variable name="element">
|
10148
10174
|
<xsl:choose>
|
10149
10175
|
<xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
|
10150
10176
|
<fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
|
10151
10177
|
</xsl:when>
|
10178
|
+
<xsl:when test="not(ancestor::*[local-name() = 'figure'])">
|
10179
|
+
<fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
|
10180
|
+
</xsl:when>
|
10152
10181
|
<xsl:otherwise>
|
10153
10182
|
<fo:block xsl:use-attribute-sets="image-style">
|
10154
10183
|
<xsl:if test="ancestor::*[local-name() = 'dt']">
|
@@ -10164,10 +10193,24 @@
|
|
10164
10193
|
<xsl:copy-of select="@*"/>
|
10165
10194
|
<!-- <fo:block xsl:use-attribute-sets="image-style"> -->
|
10166
10195
|
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
10167
|
-
|
10168
|
-
|
10169
|
-
|
10170
|
-
|
10196
|
+
|
10197
|
+
<xsl:choose>
|
10198
|
+
<xsl:when test="$image_class = 'corrigenda-tag'">
|
10199
|
+
<xsl:attribute name="fox:alt-text">CorrigendaTag</xsl:attribute>
|
10200
|
+
<xsl:attribute name="baseline-shift">-10%</xsl:attribute>
|
10201
|
+
<xsl:if test="$ancestor_table_cell = 'true'">
|
10202
|
+
<xsl:attribute name="baseline-shift">-25%</xsl:attribute>
|
10203
|
+
</xsl:if>
|
10204
|
+
<xsl:attribute name="height">3.5mm</xsl:attribute>
|
10205
|
+
</xsl:when>
|
10206
|
+
<xsl:otherwise>
|
10207
|
+
<xsl:if test="$isGenerateTableIF = 'false'">
|
10208
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
10209
|
+
</xsl:if>
|
10210
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
10211
|
+
</xsl:otherwise>
|
10212
|
+
</xsl:choose>
|
10213
|
+
|
10171
10214
|
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
10172
10215
|
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
|
10173
10216
|
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
|
@@ -12335,14 +12378,16 @@
|
|
12335
12378
|
|
12336
12379
|
<xsl:template match="*[local-name() = 'annex']">
|
12337
12380
|
<fo:block break-after="page"/>
|
12338
|
-
<fo:block
|
12381
|
+
<fo:block>
|
12339
12382
|
|
12340
12383
|
<xsl:call-template name="setBlockSpanAll"/>
|
12341
12384
|
|
12342
12385
|
<xsl:call-template name="refine_annex_style"/>
|
12343
12386
|
|
12344
12387
|
</fo:block>
|
12345
|
-
<
|
12388
|
+
<fo:block id="{@id}">
|
12389
|
+
<xsl:apply-templates/>
|
12390
|
+
</fo:block>
|
12346
12391
|
</xsl:template>
|
12347
12392
|
|
12348
12393
|
<xsl:template name="refine_annex_style">
|
@@ -12362,13 +12407,19 @@
|
|
12362
12407
|
<fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
12363
12408
|
</xsl:when>
|
12364
12409
|
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
12365
|
-
<xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
|
12410
|
+
<xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
|
12411
|
+
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
12412
|
+
</xsl:when>
|
12413
|
+
<xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
|
12366
12414
|
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
12367
12415
|
</xsl:when>
|
12368
12416
|
</xsl:choose>
|
12369
12417
|
|
12370
12418
|
</xsl:template>
|
12371
12419
|
|
12420
|
+
<!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
|
12421
|
+
<xsl:template match="*[local-name() = 'review'][@type = 'other']"/>
|
12422
|
+
|
12372
12423
|
<xsl:template match="*[local-name() = 'name']/text()">
|
12373
12424
|
<!-- 0xA0 to space replacement -->
|
12374
12425
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
@@ -14135,7 +14186,7 @@
|
|
14135
14186
|
|
14136
14187
|
<xsl:template name="printEdition">
|
14137
14188
|
<xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
|
14138
|
-
|
14189
|
+
|
14139
14190
|
<xsl:choose>
|
14140
14191
|
<xsl:when test="$edition_i18n != ''">
|
14141
14192
|
<!-- Example: <edition language="fr">deuxième édition</edition> -->
|
data/lib/isodoc/ieee/metadata.rb
CHANGED
@@ -17,8 +17,7 @@ module IsoDoc
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def ddMMMyyyy(isodate)
|
20
|
-
|
21
|
-
|
20
|
+
isodate.nil? and return nil
|
22
21
|
arr = isodate.split("-")
|
23
22
|
if arr.size == 1 && (/^\d+$/.match isodate)
|
24
23
|
Date.new(*arr.map(&:to_i)).strftime("%Y")
|
@@ -62,11 +61,17 @@ module IsoDoc
|
|
62
61
|
key = ""
|
63
62
|
map = list.xpath(ns(".//dt | .//dd")).each_with_object({}) do |dtd, m|
|
64
63
|
(dtd.name == "dt" and key = dtd.text) or
|
65
|
-
m[key] =
|
64
|
+
m[key] = text_from_paras(dtd)
|
65
|
+
.gsub(/\*/, "<span class='cite_fn'>*</span>")
|
66
66
|
end
|
67
67
|
list.replace(participant_para(map, idx))
|
68
68
|
end
|
69
69
|
|
70
|
+
def text_from_paras(node)
|
71
|
+
r = node.at(ns("./p")) and node = r
|
72
|
+
node.children.to_xml.strip
|
73
|
+
end
|
74
|
+
|
70
75
|
def participant_para(map, idx)
|
71
76
|
name = participant_name(map)
|
72
77
|
if map["role"]&.casecmp("member")&.zero?
|
@@ -89,7 +94,7 @@ module IsoDoc
|
|
89
94
|
name = "<strong>#{name}</strong>" if idx.zero?
|
90
95
|
br = map["role"].size > 30 ? "<br/>" : ""
|
91
96
|
"<p type='officeholder' align='center'>#{name}, #{br}" \
|
92
|
-
"<em>#{map['role']}</em></p>"
|
97
|
+
"<em><span class='au_role'>#{map['role']}</span></em></p>"
|
93
98
|
end
|
94
99
|
|
95
100
|
def participant_name(map)
|
@@ -50,10 +50,10 @@ module IsoDoc
|
|
50
50
|
|
51
51
|
def bibrender_relaton(xml, renderings)
|
52
52
|
f = renderings[xml["id"]][:formattedref]
|
53
|
-
|
53
|
+
fn = availability_note(xml)
|
54
|
+
f &&= "<formattedref>#{f}#{fn}</formattedref>"
|
54
55
|
keep = "./docidentifier | ./uri | ./note | ./title | ./biblio-tag"
|
55
|
-
xml.children =
|
56
|
-
"#{f}#{xml.xpath(ns(keep)).to_xml}"
|
56
|
+
xml.children = "#{f}#{xml.xpath(ns(keep)).to_xml}"
|
57
57
|
@author[xml["id"]] = renderings[xml["id"]][:author]
|
58
58
|
end
|
59
59
|
|
@@ -82,6 +82,12 @@ module IsoDoc
|
|
82
82
|
def expand_citeas(text)
|
83
83
|
std_docid_semantic(super)
|
84
84
|
end
|
85
|
+
|
86
|
+
def availability_note(bib)
|
87
|
+
note = bib.at(ns("./note[@type = 'Availability']")) or return ""
|
88
|
+
id = UUIDTools::UUID.random_create.to_s
|
89
|
+
"<fn reference='#{id}'><p>#{note.content}</p></fn>"
|
90
|
+
end
|
85
91
|
end
|
86
92
|
end
|
87
93
|
end
|
@@ -34,8 +34,7 @@ module IsoDoc
|
|
34
34
|
|
35
35
|
def unwrap_definition(docxml)
|
36
36
|
docxml.xpath(ns(".//definition/verbal-definition")).each do |v|
|
37
|
-
|
38
|
-
|
37
|
+
v.elements.all? { |e| %w(termsource p).include?(e.name) } or next
|
39
38
|
p = v.xpath(ns("./p"))
|
40
39
|
v.children =
|
41
40
|
"<p>#{p.map(&:children).map { |x| to_xml(x) }.join("\n")}</p>" \
|
@@ -73,7 +72,7 @@ module IsoDoc
|
|
73
72
|
"./preferred/graphical-symbol/figure/@id | " \
|
74
73
|
"./preferred"))
|
75
74
|
f = term.at(ns("./field-of-application")) || term.at(ns("./domain"))
|
76
|
-
|
75
|
+
@c.decode("#{sort_terms_key1(d)} :: #{sort_terms_key1(f)}")
|
77
76
|
end
|
78
77
|
|
79
78
|
def sort_terms_key1(elem)
|
@@ -190,8 +189,7 @@ module IsoDoc
|
|
190
189
|
end
|
191
190
|
|
192
191
|
def collapse_unwrap_definition(defn)
|
193
|
-
|
194
|
-
|
192
|
+
defn.nil? and return nil
|
195
193
|
s = defn.remove.xpath(ns("./termsource"))
|
196
194
|
p = defn.at(ns("./p"))
|
197
195
|
!s.empty? && p and p << s.map(&:remove).map(&:children)
|
@@ -95,8 +95,89 @@
|
|
95
95
|
<ref name="pagebreak"/>
|
96
96
|
<ref name="hr"/>
|
97
97
|
<ref name="bookmark"/>
|
98
|
+
<ref name="amend"/>
|
98
99
|
</choice>
|
99
100
|
</define>
|
101
|
+
<define name="amend">
|
102
|
+
<element name="amend">
|
103
|
+
<ref name="AmendType"/>
|
104
|
+
</element>
|
105
|
+
</define>
|
106
|
+
<define name="AmendType">
|
107
|
+
<optional>
|
108
|
+
<attribute name="id">
|
109
|
+
<data type="ID"/>
|
110
|
+
</attribute>
|
111
|
+
</optional>
|
112
|
+
<attribute name="change">
|
113
|
+
<choice>
|
114
|
+
<value>add</value>
|
115
|
+
<value>modify</value>
|
116
|
+
<value>delete</value>
|
117
|
+
<value>replace</value>
|
118
|
+
</choice>
|
119
|
+
</attribute>
|
120
|
+
<optional>
|
121
|
+
<attribute name="path"/>
|
122
|
+
</optional>
|
123
|
+
<optional>
|
124
|
+
<attribute name="path_end"/>
|
125
|
+
</optional>
|
126
|
+
<optional>
|
127
|
+
<attribute name="title"/>
|
128
|
+
</optional>
|
129
|
+
<optional>
|
130
|
+
<element name="location">
|
131
|
+
<zeroOrMore>
|
132
|
+
<choice>
|
133
|
+
<ref name="locality"/>
|
134
|
+
<ref name="localityStack"/>
|
135
|
+
</choice>
|
136
|
+
</zeroOrMore>
|
137
|
+
</element>
|
138
|
+
</optional>
|
139
|
+
<optional>
|
140
|
+
<element name="description">
|
141
|
+
<zeroOrMore>
|
142
|
+
<ref name="BasicBlock"/>
|
143
|
+
</zeroOrMore>
|
144
|
+
</element>
|
145
|
+
</optional>
|
146
|
+
<optional>
|
147
|
+
<element name="newcontent">
|
148
|
+
<optional>
|
149
|
+
<attribute name="id">
|
150
|
+
<data type="ID"/>
|
151
|
+
</attribute>
|
152
|
+
</optional>
|
153
|
+
<zeroOrMore>
|
154
|
+
<ref name="BasicBlock"/>
|
155
|
+
</zeroOrMore>
|
156
|
+
</element>
|
157
|
+
</optional>
|
158
|
+
<zeroOrMore>
|
159
|
+
<ref name="classification"/>
|
160
|
+
</zeroOrMore>
|
161
|
+
<zeroOrMore>
|
162
|
+
<ref name="contributor"/>
|
163
|
+
</zeroOrMore>
|
164
|
+
</define>
|
165
|
+
<define name="classification">
|
166
|
+
<element name="classification">
|
167
|
+
<ref name="classification_tag"/>
|
168
|
+
<ref name="classification_value"/>
|
169
|
+
</element>
|
170
|
+
</define>
|
171
|
+
<define name="classification_tag">
|
172
|
+
<element name="tag">
|
173
|
+
<text/>
|
174
|
+
</element>
|
175
|
+
</define>
|
176
|
+
<define name="classification_value">
|
177
|
+
<element name="value">
|
178
|
+
<text/>
|
179
|
+
</element>
|
180
|
+
</define>
|
100
181
|
<define name="paragraph">
|
101
182
|
<element name="p">
|
102
183
|
<ref name="ParagraphType"/>
|
@@ -163,6 +244,9 @@
|
|
163
244
|
<data type="ID"/>
|
164
245
|
</attribute>
|
165
246
|
<attribute name="reviewer"/>
|
247
|
+
<optional>
|
248
|
+
<attribute name="type"/>
|
249
|
+
</optional>
|
166
250
|
<optional>
|
167
251
|
<attribute name="date">
|
168
252
|
<data type="dateTime"/>
|
@@ -939,18 +1023,12 @@
|
|
939
1023
|
</optional>
|
940
1024
|
<optional>
|
941
1025
|
<attribute name="width">
|
942
|
-
<
|
943
|
-
<data type="int"/>
|
944
|
-
<value>auto</value>
|
945
|
-
</choice>
|
1026
|
+
<ref name="ImageSize"/>
|
946
1027
|
</attribute>
|
947
1028
|
</optional>
|
948
1029
|
<optional>
|
949
1030
|
<attribute name="height">
|
950
|
-
<
|
951
|
-
<data type="int"/>
|
952
|
-
<value>auto</value>
|
953
|
-
</choice>
|
1031
|
+
<ref name="ImageSize"/>
|
954
1032
|
</attribute>
|
955
1033
|
</optional>
|
956
1034
|
<optional>
|
@@ -965,6 +1043,14 @@
|
|
965
1043
|
</attribute>
|
966
1044
|
</optional>
|
967
1045
|
</define>
|
1046
|
+
<define name="ImageSize">
|
1047
|
+
<choice>
|
1048
|
+
<data type="string">
|
1049
|
+
<param name="pattern">\d+([.]\d+)?(%?)</param>
|
1050
|
+
</data>
|
1051
|
+
<value>auto</value>
|
1052
|
+
</choice>
|
1053
|
+
</define>
|
968
1054
|
<define name="video">
|
969
1055
|
<element name="video">
|
970
1056
|
<attribute name="id">
|
@@ -9,11 +9,42 @@
|
|
9
9
|
-->
|
10
10
|
<include href="biblio.rng">
|
11
11
|
<define name="BibData">
|
12
|
-
<ref name="
|
12
|
+
<ref name="StandardBibliographicItem"/>
|
13
13
|
<optional>
|
14
14
|
<ref name="ext"/>
|
15
15
|
</optional>
|
16
16
|
</define>
|
17
|
+
<define name="docrelation">
|
18
|
+
<element name="relation">
|
19
|
+
<attribute name="type">
|
20
|
+
<ref name="DocRelationType"/>
|
21
|
+
</attribute>
|
22
|
+
<optional>
|
23
|
+
<element name="description">
|
24
|
+
<ref name="FormattedString"/>
|
25
|
+
</element>
|
26
|
+
</optional>
|
27
|
+
<element name="bibitem">
|
28
|
+
<ref name="StandardReducedBibliographicItem"/>
|
29
|
+
</element>
|
30
|
+
<choice>
|
31
|
+
<zeroOrMore>
|
32
|
+
<ref name="locality"/>
|
33
|
+
</zeroOrMore>
|
34
|
+
<zeroOrMore>
|
35
|
+
<ref name="localityStack"/>
|
36
|
+
</zeroOrMore>
|
37
|
+
</choice>
|
38
|
+
<choice>
|
39
|
+
<zeroOrMore>
|
40
|
+
<ref name="sourceLocality"/>
|
41
|
+
</zeroOrMore>
|
42
|
+
<zeroOrMore>
|
43
|
+
<ref name="sourceLocalityStack"/>
|
44
|
+
</zeroOrMore>
|
45
|
+
</choice>
|
46
|
+
</element>
|
47
|
+
</define>
|
17
48
|
</include>
|
18
49
|
<define name="ext">
|
19
50
|
<element name="ext">
|
@@ -161,4 +192,16 @@
|
|
161
192
|
</optional>
|
162
193
|
</element>
|
163
194
|
</define>
|
195
|
+
<define name="StandardBibliographicItem">
|
196
|
+
<ref name="BibliographicItem"/>
|
197
|
+
<zeroOrMore>
|
198
|
+
<ref name="amend"/>
|
199
|
+
</zeroOrMore>
|
200
|
+
</define>
|
201
|
+
<define name="StandardReducedBibliographicItem">
|
202
|
+
<ref name="ReducedBibliographicItem"/>
|
203
|
+
<zeroOrMore>
|
204
|
+
<ref name="amend"/>
|
205
|
+
</zeroOrMore>
|
206
|
+
</define>
|
164
207
|
</grammar>
|
@@ -241,6 +241,9 @@
|
|
241
241
|
</element>
|
242
242
|
</define>
|
243
243
|
<define name="FullNameType">
|
244
|
+
<optional>
|
245
|
+
<ref name="name_abbreviation"/>
|
246
|
+
</optional>
|
244
247
|
<choice>
|
245
248
|
<group>
|
246
249
|
<zeroOrMore>
|
@@ -266,6 +269,11 @@
|
|
266
269
|
<ref name="variantname"/>
|
267
270
|
</zeroOrMore>
|
268
271
|
</define>
|
272
|
+
<define name="name_abbreviation">
|
273
|
+
<element name="abbreviation">
|
274
|
+
<ref name="LocalizedString"/>
|
275
|
+
</element>
|
276
|
+
</define>
|
269
277
|
<define name="prefix">
|
270
278
|
<element name="prefix">
|
271
279
|
<ref name="LocalizedString"/>
|
@@ -870,6 +878,9 @@
|
|
870
878
|
<optional>
|
871
879
|
<ref name="validity"/>
|
872
880
|
</optional>
|
881
|
+
<optional>
|
882
|
+
<ref name="depiction"/>
|
883
|
+
</optional>
|
873
884
|
</define>
|
874
885
|
<define name="btitle">
|
875
886
|
<element name="title">
|
@@ -190,14 +190,13 @@ module Metanorma
|
|
190
190
|
|
191
191
|
def populate_participants2(list)
|
192
192
|
curr = list
|
193
|
-
p = curr.at("./p") and curr = p
|
193
|
+
p = curr.at("./p[text() != '']") and curr = p
|
194
194
|
if dl = curr.at("./dl")
|
195
195
|
ret = extract_participants(dl)
|
196
196
|
dl.children = ret.keys.map do |k|
|
197
197
|
"<dt>#{k}</dt><dd><p>#{ret[k]}</p></dd>"
|
198
198
|
end.join
|
199
|
-
else
|
200
|
-
list.children = "<dl><dt>name</dt><dd><p>#{curr.children.to_xml}" \
|
199
|
+
else list.children = "<dl><dt>name</dt><dd><p>#{curr.children.to_xml}" \
|
201
200
|
"</p></dd><dt>role</dt><dd><p>member</p></dd></dl>"
|
202
201
|
end
|
203
202
|
end
|
@@ -206,13 +205,18 @@ module Metanorma
|
|
206
205
|
key = ""
|
207
206
|
map = dlist.xpath("./dt | ./dd").each_with_object({}) do |dtd, m|
|
208
207
|
(dtd.name == "dt" and key = dtd.text.sub(/:+$/, "")) or
|
209
|
-
m[key.strip.downcase] =
|
210
|
-
@c.encode(@c.decode(dtd.text.strip), :hexadecimal)
|
208
|
+
m[key.strip.downcase] = text_from_paras(dtd)
|
211
209
|
end
|
210
|
+
map["company"] &&= "<span class='organization'>#{map['company']}</span>"
|
212
211
|
map["role"] ||= "member"
|
213
212
|
map
|
214
213
|
end
|
215
214
|
|
215
|
+
def text_from_paras(node)
|
216
|
+
r = node.at("./p") and node = r
|
217
|
+
node.children.to_xml.strip
|
218
|
+
end
|
219
|
+
|
216
220
|
def bibdata_cleanup(xmldoc)
|
217
221
|
super
|
218
222
|
provenance_title(xmldoc)
|
@@ -15,13 +15,11 @@ module Metanorma
|
|
15
15
|
if ref.at("./note[@type = 'boilerplate']")
|
16
16
|
unwrap_boilerplate_clauses(ref, ".")
|
17
17
|
else
|
18
|
-
|
19
|
-
ref.at("./title").next = "<p>#{pref}</p>"
|
18
|
+
ref.at("./title").next = "<p>#{@i18n.biblio_pref}</p>"
|
20
19
|
end
|
21
20
|
end
|
22
21
|
|
23
22
|
def sort_biblio(bib)
|
24
|
-
@c = HTMLEntities.new
|
25
23
|
@i = IsoDoc::IEEE::PresentationXMLConvert
|
26
24
|
.new({ lang: @lang, script: @script, locale: @locale })
|
27
25
|
@i.i18n_init(@lang, @script, @locale)
|
@@ -75,12 +73,13 @@ module Metanorma
|
|
75
73
|
trademark_ieee_erefs(xmldoc)
|
76
74
|
end
|
77
75
|
|
76
|
+
IEEE = "Institute of Electrical and Electronics Engineers".freeze
|
77
|
+
|
78
78
|
# Style manual 12.3.5
|
79
79
|
def trademark_ieee_erefs(xmldoc)
|
80
80
|
ieee = xmldoc.xpath("//references/bibitem")
|
81
81
|
.each_with_object({}) do |b, m|
|
82
|
-
|
83
|
-
n&.text == "Institute of Electrical and Electronics Engineers" and
|
82
|
+
bib_pubs(b).include?(IEEE) and
|
84
83
|
m[b["id"]] = b.at("./docidentifier[@scope = 'trademark']")&.text
|
85
84
|
end
|
86
85
|
trademark_ieee_erefs1(xmldoc, "//preface//eref", ieee)
|
@@ -127,10 +126,114 @@ module Metanorma
|
|
127
126
|
end
|
128
127
|
|
129
128
|
def section_names_refs_cleanup(xml)
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
129
|
+
@doctype == "whitepaper" or return super
|
130
|
+
replace_title(xml, "//bibliography/references", @i18n&.references, true)
|
131
|
+
end
|
132
|
+
|
133
|
+
def bibitem_cleanup(xmldoc)
|
134
|
+
super
|
135
|
+
f = File.join(File.dirname(__FILE__), "ieee-footnotes.yaml")
|
136
|
+
@provenance_notes = YAML.safe_load(File.read(f))
|
137
|
+
withdrawn_note(xmldoc, @provenance_notes)
|
138
|
+
end
|
139
|
+
|
140
|
+
def biblio_reorder(xmldoc)
|
141
|
+
super
|
142
|
+
available_note(xmldoc, @provenance_notes)
|
143
|
+
end
|
144
|
+
|
145
|
+
def bib_pubs(bib)
|
146
|
+
bib.xpath("./contributor[role/@type = 'publisher']/organization/name")
|
147
|
+
.map(&:text)
|
148
|
+
end
|
149
|
+
|
150
|
+
BIBITEM_NO_AVAIL =
|
151
|
+
"//references/bibitem[not(note[@type = 'Availability'])]".freeze
|
152
|
+
|
153
|
+
def withdrawn_note(xmldoc, provenance_notes)
|
154
|
+
xmldoc.xpath(BIBITEM_NO_AVAIL).each do |b|
|
155
|
+
bib_pubs(b).include?(IEEE) or next
|
156
|
+
b.at("./status/stage")&.text == "withdrawn" or next
|
157
|
+
docid = b.at("./docidentifier[@type = 'IEEE'][not(@scope)]")
|
158
|
+
note = provenance_notes["ieee-withdrawn"].sub("%", docid.text)
|
159
|
+
insert_availability_note(b, note)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
AVAIL_PUBS = {
|
164
|
+
ieee: IEEE,
|
165
|
+
cispr: "International special committee on radio interference",
|
166
|
+
etsi: "European Telecommunications Standards Institute",
|
167
|
+
oasis: "OASIS",
|
168
|
+
"w3c": "World Wide Web Consortium",
|
169
|
+
"3gpp": "3rd Generation Partnership Project",
|
170
|
+
}.freeze
|
171
|
+
|
172
|
+
def available_note(xmldoc, provenance_notes)
|
173
|
+
iso_iec_available_note(xmldoc, provenance_notes["iso-iec"], true, true)
|
174
|
+
iso_iec_available_note(xmldoc, provenance_notes["iso"], true, false)
|
175
|
+
iso_iec_available_note(xmldoc, provenance_notes["iec"], false, true)
|
176
|
+
itu_available_note(xmldoc, provenance_notes["itut"], true)
|
177
|
+
itu_available_note(xmldoc, provenance_notes["itur"], false)
|
178
|
+
nist_available_note(xmldoc, provenance_notes["fips"], true)
|
179
|
+
nist_available_note(xmldoc, provenance_notes["nist"], false)
|
180
|
+
ietf_available_note(xmldoc, provenance_notes["ietf"])
|
181
|
+
AVAIL_PUBS.each do |k, v|
|
182
|
+
sdo_available_note(xmldoc, provenance_notes[k.to_s], v)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
def sdo_available_note(xmldoc, note, publisher)
|
187
|
+
ret = xmldoc.xpath(BIBITEM_NO_AVAIL).detect do |b|
|
188
|
+
bib_pubs(b).include?(publisher)
|
189
|
+
end
|
190
|
+
insert_availability_note(ret, note)
|
191
|
+
end
|
192
|
+
|
193
|
+
def iso_iec_available_note(xmldoc, note, iso, iec)
|
194
|
+
ret = xmldoc.xpath(BIBITEM_NO_AVAIL).detect do |b|
|
195
|
+
pubs = bib_pubs(b)
|
196
|
+
has_iec = pubs.include?("International Electrotechnical Commission")
|
197
|
+
has_iso = pubs.include?("International Organization for Standardization")
|
198
|
+
((has_iec && iec) || (!has_iec && !iec)) &&
|
199
|
+
((has_iso && iso) || (!has_iso && !iso))
|
200
|
+
end
|
201
|
+
insert_availability_note(ret, note)
|
202
|
+
end
|
203
|
+
|
204
|
+
def ietf_available_note(xmldoc, note)
|
205
|
+
ret = xmldoc.xpath(BIBITEM_NO_AVAIL).detect do |b|
|
206
|
+
b.at("./docidentifier[@type = 'IETF']")
|
207
|
+
end
|
208
|
+
insert_availability_note(ret, note)
|
209
|
+
end
|
210
|
+
|
211
|
+
def itu_available_note(xmldoc, note, itu_t)
|
212
|
+
ret = xmldoc.xpath(BIBITEM_NO_AVAIL).detect do |b|
|
213
|
+
has_itu_t = /^ITU-T/.match?(b.at("./docidentifier[@type = 'ITU']")&.text)
|
214
|
+
bib_pubs(b).include?("International Telecommunication Union") &&
|
215
|
+
(!has_itu_t && !itu_t) || (has_itu_t && itu_t)
|
216
|
+
end
|
217
|
+
insert_availability_note(ret, note)
|
218
|
+
end
|
219
|
+
|
220
|
+
def nist_available_note(xmldoc, note, fips)
|
221
|
+
ret = xmldoc.xpath(BIBITEM_NO_AVAIL).detect do |b|
|
222
|
+
id = b.at("./docidentifier[@type = 'NIST']")
|
223
|
+
has_fips = /\bFIPS\b/.match?(id&.text)
|
224
|
+
id && ((has_fips && !fips) || (!has_fips && fips))
|
225
|
+
end
|
226
|
+
insert_availability_note(ret, note)
|
227
|
+
end
|
228
|
+
|
229
|
+
def insert_availability_note(bib, msg)
|
230
|
+
bib or return
|
231
|
+
note = %(<note type="Availability"><p>#{msg}</p></note>)
|
232
|
+
if b = bib.at("./language | ./script | ./abstract | ./status")
|
233
|
+
b.previous = note
|
234
|
+
else b = bib.at("./contributor") || bib.at("./date") ||
|
235
|
+
bib.at("./docnumber") || bib.at("./docidentifier") ||
|
236
|
+
bib.at("./title") and b.next = note
|
134
237
|
end
|
135
238
|
end
|
136
239
|
end
|
data/lib/metanorma/ieee/front.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "isoics"
|
2
|
+
require "pubid-ieee"
|
2
3
|
|
3
4
|
module Metanorma
|
4
5
|
module IEEE
|
@@ -16,7 +17,8 @@ module Metanorma
|
|
16
17
|
def metadata_committee_prep(node)
|
17
18
|
node.attr("doctype") == "whitepaper" &&
|
18
19
|
node.attr("docsubtype") == "industry-connection-report" and
|
19
|
-
node.set_attr("working-group",
|
20
|
+
node.set_attr("working-group",
|
21
|
+
"IEEE SA Industry Connections activity")
|
20
22
|
node.attr("committee") || node.attr("society") ||
|
21
23
|
node.attr("working-group") or return
|
22
24
|
node.attr("balloting-group") && !node.attr("balloting-group-type") and
|
@@ -32,8 +34,10 @@ module Metanorma
|
|
32
34
|
end
|
33
35
|
|
34
36
|
def metadata_id(node, xml)
|
35
|
-
id = node.attr("
|
36
|
-
|
37
|
+
if id = node.attr("docidentifier")
|
38
|
+
xml.docidentifier id, **attr_code(type: "IEEE")
|
39
|
+
else ieee_id(node, xml)
|
40
|
+
end
|
37
41
|
id = node.attr("stdid-pdf") and
|
38
42
|
xml.docidentifier id, type: "IEEE", scope: "PDF"
|
39
43
|
id = node.attr("stdid-print") and
|
@@ -41,6 +45,65 @@ module Metanorma
|
|
41
45
|
xml.docnumber node.attr("docnumber")
|
42
46
|
end
|
43
47
|
|
48
|
+
def ieee_id(node, xml)
|
49
|
+
params = ieee_id_params(node)
|
50
|
+
params[:number] or return
|
51
|
+
ieee_id_out(xml, params)
|
52
|
+
end
|
53
|
+
|
54
|
+
def ieee_id_params(node)
|
55
|
+
core = ieee_id_params_core(node)
|
56
|
+
amd = ieee_id_params_amd(node, core) || {}
|
57
|
+
core.merge(amd)
|
58
|
+
end
|
59
|
+
|
60
|
+
def ieee_id_params_core(node)
|
61
|
+
pub = ieee_id_pub(node)
|
62
|
+
ret = { number: node.attr("docnumber"),
|
63
|
+
part: node.attr("partnumber"),
|
64
|
+
year: ieee_id_year(node, initial: true),
|
65
|
+
redline: @doctype == "redline",
|
66
|
+
publisher: pub[0],
|
67
|
+
copublisher: pub[1..-1] }.compact
|
68
|
+
ret[:copublisher].empty? and ret.delete(:copublisher)
|
69
|
+
ret
|
70
|
+
end
|
71
|
+
|
72
|
+
def ieee_id_params_amd(node, core)
|
73
|
+
if a = node.attr("corrigendum-number")
|
74
|
+
{ corrigendum: { version: a,
|
75
|
+
year: ieee_id_year(node, initial: false) } }
|
76
|
+
elsif node.attr("amendment-number")
|
77
|
+
{ amendment: pubid_select(core).create(**core) }
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def ieee_id_pub(node)
|
82
|
+
(node.attr("publisher") || default_publisher).split(/[;,]/)
|
83
|
+
.map(&:strip).map { |x| org_abbrev[x] || x }
|
84
|
+
end
|
85
|
+
|
86
|
+
def ieee_id_year(node, initial: false)
|
87
|
+
unless initial
|
88
|
+
y = node.attr("copyright-year") || node.attr("updated-date")
|
89
|
+
end
|
90
|
+
y ||= node.attr("published-date") || node.attr("copyright-year")
|
91
|
+
y&.sub(/-.*$/, "") || Date.today.year
|
92
|
+
end
|
93
|
+
|
94
|
+
def ieee_id_out(xml, params)
|
95
|
+
id = pubid_select(params).create(**params)
|
96
|
+
xml.docidentifier id.to_s, type: "IEEE"
|
97
|
+
end
|
98
|
+
|
99
|
+
def pubid_select(_params)
|
100
|
+
base_pubid
|
101
|
+
end
|
102
|
+
|
103
|
+
def base_pubid
|
104
|
+
Pubid::Ieee::Identifier
|
105
|
+
end
|
106
|
+
|
44
107
|
def default_publisher
|
45
108
|
"IEEE"
|
46
109
|
end
|
@@ -63,7 +126,9 @@ module Metanorma
|
|
63
126
|
end
|
64
127
|
|
65
128
|
def org_abbrev
|
66
|
-
{ "Institute of Electrical and Electronic Engineers" => "IEEE"
|
129
|
+
{ "Institute of Electrical and Electronic Engineers" => "IEEE",
|
130
|
+
"International Organization for Standardization" => "ISO",
|
131
|
+
"International Electrotechnical Commission" => "IEC" }
|
67
132
|
end
|
68
133
|
|
69
134
|
def relaton_relations
|
@@ -0,0 +1,77 @@
|
|
1
|
+
---
|
2
|
+
ieee: |
|
3
|
+
IEEE publications are available from The Institute of Electrical and
|
4
|
+
Electronics Engineers (http://standards.ieee.org/).
|
5
|
+
|
6
|
+
iec: |
|
7
|
+
IEC publications are available from the International Electrotechnical
|
8
|
+
Commission (http://www.iec.ch/). IEC publications are also available in
|
9
|
+
the United States from the American National Standards Institute
|
10
|
+
(http://www.ansi.org/).
|
11
|
+
|
12
|
+
cispr: |
|
13
|
+
CISPR documents are available from the International Electrotechnical
|
14
|
+
Commission (http://www.iec.ch/). CISPR documents are also available in
|
15
|
+
the United States from the American National Standards Institute
|
16
|
+
(http://www.ansi.org)
|
17
|
+
|
18
|
+
ietf: |
|
19
|
+
IETF documents (e.g., RFCs) are available from the Internet Engineering Task Force (http://www.ietf.org/).
|
20
|
+
|
21
|
+
iso: |
|
22
|
+
ISO publications are available from the ISO Central Secretariat
|
23
|
+
(http://www.iso.org/). ISO publications are also available in the United
|
24
|
+
States from the American National Standards Institute
|
25
|
+
(http://www.ansi.org/).
|
26
|
+
|
27
|
+
iso-iec: |
|
28
|
+
ISO/IEC documents are available from the International Organization for
|
29
|
+
Standardization (https://www.iso.org/). ISO/IEC publications are also
|
30
|
+
available in the United States from Global Engineering Documents
|
31
|
+
(https://global.ihs.com/). Electronic copies are available in the United
|
32
|
+
States from the American National Standards Institute
|
33
|
+
(https://www.ansi.org/)
|
34
|
+
|
35
|
+
fips: |
|
36
|
+
FIPS publications are available from the National Technical Information
|
37
|
+
Service (NTIS) (http://csrc.nist.gov).
|
38
|
+
|
39
|
+
nist: |
|
40
|
+
NIST publications are available from the National Institute of Standards
|
41
|
+
and Technology (http://www.nist.gov/).
|
42
|
+
|
43
|
+
astm: |
|
44
|
+
ASTM publications are available from the American Society for Testing
|
45
|
+
and Materials (http://www.astm.org/).
|
46
|
+
|
47
|
+
etsi: |
|
48
|
+
ETSI publications are available the European Telecommunications
|
49
|
+
Standards Institute (http://www.etsi.org).
|
50
|
+
|
51
|
+
ansi: |
|
52
|
+
ANSI publications are available from the American National Standards
|
53
|
+
Institute (http://www.ansi.org/).
|
54
|
+
|
55
|
+
itut: |
|
56
|
+
ITU-T publications are available from the International
|
57
|
+
Telecommunications Union (http://www.itu.int/).
|
58
|
+
|
59
|
+
itur: |
|
60
|
+
ITU publications are available from the International Telecommunications
|
61
|
+
Union (http://www.itu.int/).
|
62
|
+
|
63
|
+
w3c: |
|
64
|
+
W3C recommendations are available from the World Wide Web Consortium
|
65
|
+
(https://www.w3.org).
|
66
|
+
|
67
|
+
oasis: |
|
68
|
+
OASIS publications are available from the Organization for the
|
69
|
+
Organization for the Advancement of Structured Information Standards
|
70
|
+
(http://www.oasis-open.org)
|
71
|
+
|
72
|
+
3gpp: |
|
73
|
+
3GPP(TM) documents are available from the 3rd Generation Partnership
|
74
|
+
Project Web site (http://www.3gpp.org).
|
75
|
+
|
76
|
+
ieee-withdrawn: |
|
77
|
+
% has been withdrawn; however, copies can be obtained from Global Engineering, 15 Inverness Way East, Englewood, CO 80112-5704, USA, tel. (303) 792-2181 (http://global.ihs.com/).
|
@@ -17,10 +17,19 @@
|
|
17
17
|
these elements; we just want one namespace for any child grammars
|
18
18
|
of this.
|
19
19
|
-->
|
20
|
-
<!-- VERSION v1.
|
20
|
+
<!-- VERSION v1.3.0 -->
|
21
21
|
<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">
|
22
22
|
<include href="reqt.rng"/>
|
23
23
|
<include href="basicdoc.rng">
|
24
|
+
<define name="amend">
|
25
|
+
<element name="amend">
|
26
|
+
<ref name="BlockAttributes"/>
|
27
|
+
<ref name="AmendType"/>
|
28
|
+
<zeroOrMore>
|
29
|
+
<ref name="autonumber"/>
|
30
|
+
</zeroOrMore>
|
31
|
+
</element>
|
32
|
+
</define>
|
24
33
|
<define name="admonition">
|
25
34
|
<element name="admonition">
|
26
35
|
<attribute name="type">
|
@@ -137,6 +146,9 @@
|
|
137
146
|
<data type="boolean"/>
|
138
147
|
</attribute>
|
139
148
|
</optional>
|
149
|
+
<optional>
|
150
|
+
<attribute name="style"/>
|
151
|
+
</optional>
|
140
152
|
<oneOrMore>
|
141
153
|
<ref name="PureTextElement"/>
|
142
154
|
</oneOrMore>
|
@@ -2319,69 +2331,6 @@
|
|
2319
2331
|
<ref name="CitationType"/>
|
2320
2332
|
</element>
|
2321
2333
|
</define>
|
2322
|
-
<define name="amend">
|
2323
|
-
<element name="amend">
|
2324
|
-
<optional>
|
2325
|
-
<attribute name="id">
|
2326
|
-
<data type="ID"/>
|
2327
|
-
</attribute>
|
2328
|
-
</optional>
|
2329
|
-
<attribute name="change">
|
2330
|
-
<choice>
|
2331
|
-
<value>add</value>
|
2332
|
-
<value>modify</value>
|
2333
|
-
<value>delete</value>
|
2334
|
-
<value>replace</value>
|
2335
|
-
</choice>
|
2336
|
-
</attribute>
|
2337
|
-
<optional>
|
2338
|
-
<attribute name="path"/>
|
2339
|
-
</optional>
|
2340
|
-
<optional>
|
2341
|
-
<attribute name="path_end"/>
|
2342
|
-
</optional>
|
2343
|
-
<optional>
|
2344
|
-
<attribute name="title"/>
|
2345
|
-
</optional>
|
2346
|
-
<ref name="BlockAttributes"/>
|
2347
|
-
<optional>
|
2348
|
-
<element name="location">
|
2349
|
-
<zeroOrMore>
|
2350
|
-
<ref name="locality"/>
|
2351
|
-
</zeroOrMore>
|
2352
|
-
</element>
|
2353
|
-
</optional>
|
2354
|
-
<zeroOrMore>
|
2355
|
-
<ref name="autonumber"/>
|
2356
|
-
</zeroOrMore>
|
2357
|
-
<optional>
|
2358
|
-
<element name="description">
|
2359
|
-
<zeroOrMore>
|
2360
|
-
<ref name="BasicBlock"/>
|
2361
|
-
</zeroOrMore>
|
2362
|
-
</element>
|
2363
|
-
</optional>
|
2364
|
-
<optional>
|
2365
|
-
<element name="newcontent">
|
2366
|
-
<optional>
|
2367
|
-
<attribute name="id">
|
2368
|
-
<data type="ID"/>
|
2369
|
-
</attribute>
|
2370
|
-
</optional>
|
2371
|
-
<zeroOrMore>
|
2372
|
-
<ref name="BasicBlock"/>
|
2373
|
-
</zeroOrMore>
|
2374
|
-
</element>
|
2375
|
-
</optional>
|
2376
|
-
<optional>
|
2377
|
-
<element name="description">
|
2378
|
-
<zeroOrMore>
|
2379
|
-
<ref name="BasicBlock"/>
|
2380
|
-
</zeroOrMore>
|
2381
|
-
</element>
|
2382
|
-
</optional>
|
2383
|
-
</element>
|
2384
|
-
</define>
|
2385
2334
|
<define name="autonumber">
|
2386
2335
|
<element name="autonumber">
|
2387
2336
|
<attribute name="type">
|
data/lib/metanorma/ieee/reqt.rng
CHANGED
@@ -207,20 +207,4 @@
|
|
207
207
|
<value>permission</value>
|
208
208
|
</choice>
|
209
209
|
</define>
|
210
|
-
<define name="classification">
|
211
|
-
<element name="classification">
|
212
|
-
<ref name="classification_tag"/>
|
213
|
-
<ref name="classification_value"/>
|
214
|
-
</element>
|
215
|
-
</define>
|
216
|
-
<define name="classification_tag">
|
217
|
-
<element name="tag">
|
218
|
-
<text/>
|
219
|
-
</element>
|
220
|
-
</define>
|
221
|
-
<define name="classification_value">
|
222
|
-
<element name="value">
|
223
|
-
<text/>
|
224
|
-
</element>
|
225
|
-
</define>
|
226
210
|
</grammar>
|
@@ -149,7 +149,6 @@ module Metanorma
|
|
149
149
|
(xmldoc.xpath("//figure") - xmldoc.xpath("//table//figure"))
|
150
150
|
.each do |f|
|
151
151
|
(i = f.at("./image") and !i["src"]&.start_with?("data:")) or next
|
152
|
-
|
153
152
|
num = xrefs.anchor(f["id"], :label)
|
154
153
|
base = File.basename(i["src"], ".*")
|
155
154
|
base == "#{pref}_fig#{num}" or
|
@@ -170,7 +169,6 @@ module Metanorma
|
|
170
169
|
xmldoc.xpath("//table[.//figure]").each do |t|
|
171
170
|
xmldoc.xpath(".//figure").each do |f|
|
172
171
|
(i = f.at("./image") and !i["src"]&.start_with?("data:")) or next
|
173
|
-
|
174
172
|
num = tablefigurenumber(t, f, xrefs)
|
175
173
|
base = File.basename(i["src"])
|
176
174
|
base == num or
|
data/metanorma-ieee.gemspec
CHANGED
@@ -25,9 +25,9 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
27
27
|
|
28
|
-
spec.add_dependency "metanorma-standoc", "~> 2.
|
28
|
+
spec.add_dependency "metanorma-standoc", "~> 2.8.0"
|
29
29
|
spec.add_dependency "mnconvert", "~> 1.20"
|
30
|
-
|
30
|
+
spec.add_dependency "pubid-ieee"
|
31
31
|
#spec.add_dependency "pubid-iso", "~> 0.5.3"
|
32
32
|
#spec.add_dependency "relaton-iso", "~> 1.15.4"
|
33
33
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-ieee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-standoc
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.8.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: 2.
|
26
|
+
version: 2.8.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mnconvert
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.20'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pubid-ieee
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: debug
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -252,11 +266,14 @@ files:
|
|
252
266
|
- lib/isodoc/ieee/html/wordstyle_wp.scss
|
253
267
|
- lib/isodoc/ieee/html/wp_image001.emz
|
254
268
|
- lib/isodoc/ieee/html/wp_image001_icap.emz
|
269
|
+
- lib/isodoc/ieee/html/wp_image001_icr.emz
|
255
270
|
- lib/isodoc/ieee/html/wp_image003.emz
|
256
271
|
- lib/isodoc/ieee/html/wp_image003_icap.emz
|
272
|
+
- lib/isodoc/ieee/html/wp_image003_icr.emz
|
257
273
|
- lib/isodoc/ieee/html/wp_image007_icr.emz
|
258
274
|
- lib/isodoc/ieee/html/wp_image008.emz
|
259
275
|
- lib/isodoc/ieee/html/wp_image008_icap.emz
|
276
|
+
- lib/isodoc/ieee/html/wp_image008_icr.emz
|
260
277
|
- lib/isodoc/ieee/html_convert.rb
|
261
278
|
- lib/isodoc/ieee/i18n-en.yaml
|
262
279
|
- lib/isodoc/ieee/i18n.rb
|
@@ -289,6 +306,7 @@ files:
|
|
289
306
|
- lib/metanorma/ieee/cleanup_ref.rb
|
290
307
|
- lib/metanorma/ieee/converter.rb
|
291
308
|
- lib/metanorma/ieee/front.rb
|
309
|
+
- lib/metanorma/ieee/ieee-footnotes.yaml
|
292
310
|
- lib/metanorma/ieee/ieee.rng
|
293
311
|
- lib/metanorma/ieee/isodoc.rng
|
294
312
|
- lib/metanorma/ieee/processor.rb
|