metanorma-iec 2.1.12 → 2.1.13
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 103451df9208dd5c73f9405284df2fd6f2d92a32904b167840e0458b4766f401
|
4
|
+
data.tar.gz: e2ee999fd2718b01d4362ac00ad1f3428287de9ea28ad320bd67a7f3e6938bb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bd2c177ac2a318a847b8ed88703fc9d20d70a597e47d82db7d3fc8c8eb56ef7e3d11b60fc8602af07bdc301990fc20c93fc60d83037806d34a7e1b9493f18e9
|
7
|
+
data.tar.gz: 6578b3a9bd37d56fdb81ff2e59467fc0ffe451e134366927e3e95f81c3bf043837cce1cfee8e5cd4594bcb3dffd31a5ca46d633c8d6566f97c304ebcd0ba7106
|
@@ -446,6 +446,12 @@ p.TermNum {
|
|
446
446
|
padding-left: 30px; }
|
447
447
|
#toc .h3, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .h3 {
|
448
448
|
padding-left: 50px; }
|
449
|
+
#toc .h4, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .h4 {
|
450
|
+
padding-left: 70px; }
|
451
|
+
#toc .h5, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .h5 {
|
452
|
+
padding-left: 90px; }
|
453
|
+
#toc .h6, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .h6 {
|
454
|
+
padding-left: 110px; }
|
449
455
|
#toc .toc-active, #toc li:hover, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover {
|
450
456
|
background: black;
|
451
457
|
box-shadow: inset -5px 0px 10px -5px black !important; }
|
@@ -1972,6 +1972,8 @@
|
|
1972
1972
|
</xsl:copy>
|
1973
1973
|
</xsl:template> -->
|
1974
1974
|
|
1975
|
+
<xsl:strip-space elements="iec:xref"/>
|
1976
|
+
|
1975
1977
|
<!-- external parameters -->
|
1976
1978
|
|
1977
1979
|
<xsl:param name="svg_images"/> <!-- svg images array -->
|
@@ -3406,17 +3408,22 @@
|
|
3406
3408
|
</xsl:for-each>
|
3407
3409
|
</xsl:template>
|
3408
3410
|
|
3411
|
+
<xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
|
3409
3412
|
<xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
|
3410
3413
|
<xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
|
3411
3414
|
<xsl:template match="text()" name="text">
|
3412
3415
|
|
3413
|
-
<xsl:
|
3414
|
-
|
3415
|
-
|
3416
|
-
|
3417
|
-
|
3418
|
-
|
3419
|
-
|
3416
|
+
<xsl:choose>
|
3417
|
+
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:value-of select="."/></xsl:when>
|
3418
|
+
<xsl:otherwise>
|
3419
|
+
<xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_fo_inline_keep-together_within-line_open,'$1',$tag_fo_inline_keep-together_within-line_close))"/>
|
3420
|
+
<xsl:call-template name="replace_fo_inline_tags">
|
3421
|
+
<xsl:with-param name="tag_open" select="$tag_fo_inline_keep-together_within-line_open"/>
|
3422
|
+
<xsl:with-param name="tag_close" select="$tag_fo_inline_keep-together_within-line_close"/>
|
3423
|
+
<xsl:with-param name="text" select="$text"/>
|
3424
|
+
</xsl:call-template>
|
3425
|
+
</xsl:otherwise>
|
3426
|
+
</xsl:choose>
|
3420
3427
|
|
3421
3428
|
</xsl:template>
|
3422
3429
|
|
@@ -3796,7 +3803,7 @@
|
|
3796
3803
|
|
3797
3804
|
<!-- centered table when table name is centered (see table-name-style) -->
|
3798
3805
|
|
3799
|
-
<fo:table table-layout="fixed" width="100%">
|
3806
|
+
<fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style">
|
3800
3807
|
<fo:table-column column-width="proportional-column-width(1)"/>
|
3801
3808
|
<fo:table-column column-width="{@width}"/>
|
3802
3809
|
<fo:table-column column-width="proportional-column-width(1)"/>
|
@@ -4459,7 +4466,7 @@
|
|
4459
4466
|
<xsl:template match="*[local-name()='tr']">
|
4460
4467
|
<fo:table-row xsl:use-attribute-sets="table-body-row-style">
|
4461
4468
|
|
4462
|
-
<xsl:if test="*[local-name() = 'th']">
|
4469
|
+
<xsl:if test="count(*) = count(*[local-name() = 'th'])"> <!-- row contains 'th' only -->
|
4463
4470
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
4464
4471
|
</xsl:if>
|
4465
4472
|
|
@@ -5447,7 +5454,8 @@
|
|
5447
5454
|
<xsl:copy-of select="node()"/>
|
5448
5455
|
</td>
|
5449
5456
|
<td>
|
5450
|
-
<xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
|
5457
|
+
<!-- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/> -->
|
5458
|
+
<xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]" mode="dl_if"/>
|
5451
5459
|
<!-- get paragraphs from nested 'dl' -->
|
5452
5460
|
<xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
|
5453
5461
|
</td>
|
@@ -5455,6 +5463,53 @@
|
|
5455
5463
|
</xsl:template>
|
5456
5464
|
<xsl:template match="*[local-name()='dd']" mode="dl_if"/>
|
5457
5465
|
|
5466
|
+
<xsl:template match="*" mode="dl_if">
|
5467
|
+
<xsl:copy-of select="."/>
|
5468
|
+
</xsl:template>
|
5469
|
+
|
5470
|
+
<xsl:template match="*[local-name() = 'p']" mode="dl_if">
|
5471
|
+
<xsl:param name="indent"/>
|
5472
|
+
<p>
|
5473
|
+
<xsl:copy-of select="@*"/>
|
5474
|
+
<xsl:value-of select="$indent"/>
|
5475
|
+
<xsl:copy-of select="node()"/>
|
5476
|
+
</p>
|
5477
|
+
|
5478
|
+
</xsl:template>
|
5479
|
+
|
5480
|
+
<xsl:template match="*[local-name() = 'ul' or local-name() = 'ol']" mode="dl_if">
|
5481
|
+
<xsl:variable name="list_rendered_">
|
5482
|
+
<xsl:apply-templates select="."/>
|
5483
|
+
</xsl:variable>
|
5484
|
+
<xsl:variable name="list_rendered" select="xalan:nodeset($list_rendered_)"/>
|
5485
|
+
|
5486
|
+
<xsl:variable name="indent">
|
5487
|
+
<xsl:for-each select="($list_rendered//fo:block[not(.//fo:block)])[1]">
|
5488
|
+
<xsl:apply-templates select="ancestor::*[@provisional-distance-between-starts]/@provisional-distance-between-starts" mode="dl_if"/>
|
5489
|
+
</xsl:for-each>
|
5490
|
+
</xsl:variable>
|
5491
|
+
|
5492
|
+
<xsl:apply-templates mode="dl_if">
|
5493
|
+
<xsl:with-param name="indent" select="$indent"/>
|
5494
|
+
</xsl:apply-templates>
|
5495
|
+
</xsl:template>
|
5496
|
+
|
5497
|
+
<xsl:template match="*[local-name() = 'li']" mode="dl_if">
|
5498
|
+
<xsl:param name="indent"/>
|
5499
|
+
<xsl:apply-templates mode="dl_if">
|
5500
|
+
<xsl:with-param name="indent" select="$indent"/>
|
5501
|
+
</xsl:apply-templates>
|
5502
|
+
</xsl:template>
|
5503
|
+
|
5504
|
+
<xsl:template match="@provisional-distance-between-starts" mode="dl_if">
|
5505
|
+
<xsl:variable name="value" select="round(substring-before(.,'mm'))"/>
|
5506
|
+
<!-- emulate left indent for list item -->
|
5507
|
+
<xsl:call-template name="repeat">
|
5508
|
+
<xsl:with-param name="char" select="'x'"/>
|
5509
|
+
<xsl:with-param name="count" select="$value"/>
|
5510
|
+
</xsl:call-template>
|
5511
|
+
</xsl:template>
|
5512
|
+
|
5458
5513
|
<xsl:template match="*[local-name()='dl']" mode="dl_if_nested">
|
5459
5514
|
<xsl:for-each select="*[local-name() = 'dt']">
|
5460
5515
|
<p>
|
@@ -5850,6 +5905,7 @@
|
|
5850
5905
|
</word>
|
5851
5906
|
<xsl:call-template name="tokenize_with_tags">
|
5852
5907
|
<xsl:with-param name="text" select="substring-after($text, $separator)"/>
|
5908
|
+
<xsl:with-param name="tags" select="$tags"/>
|
5853
5909
|
</xsl:call-template>
|
5854
5910
|
</xsl:otherwise>
|
5855
5911
|
</xsl:choose>
|
@@ -5889,8 +5945,18 @@
|
|
5889
5945
|
|
5890
5946
|
<xsl:template name="add-zero-spaces-java">
|
5891
5947
|
<xsl:param name="text" select="."/>
|
5892
|
-
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space
|
5893
|
-
<xsl:
|
5948
|
+
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, arrow right -->
|
5949
|
+
<xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |→)','$1')"/>
|
5950
|
+
<!-- add zero-width space (#x200B) after characters: 'great than' -->
|
5951
|
+
<xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1), '(\u003e)(?!\u003e)', '$1')"/><!-- negative lookahead: 'great than' not followed by 'great than' -->
|
5952
|
+
<!-- add zero-width space (#x200B) before characters: 'less than' -->
|
5953
|
+
<xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2), '(?<!\u003c)(\u003c)', '$1')"/> <!-- (?<!\u003c)(\u003c) --> <!-- negative lookbehind: 'less than' not preceeded by 'less than' -->
|
5954
|
+
<!-- add zero-width space (#x200B) before character: { -->
|
5955
|
+
<xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(?<!\W)(\{)', '$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
|
5956
|
+
<!-- add zero-width space (#x200B) after character: , -->
|
5957
|
+
<xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(\,)(?!\d)', '$1')"/> <!-- negative lookahead: ',' not followed by digit -->
|
5958
|
+
|
5959
|
+
<xsl:value-of select="$text5"/>
|
5894
5960
|
</xsl:template>
|
5895
5961
|
|
5896
5962
|
<xsl:template name="add-zero-spaces-link-java">
|
@@ -6036,7 +6102,7 @@
|
|
6036
6102
|
</xsl:copy>
|
6037
6103
|
</xsl:template>
|
6038
6104
|
|
6039
|
-
<xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p'])]" mode="table-without-br">
|
6105
|
+
<xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode'])]" mode="table-without-br">
|
6040
6106
|
<xsl:copy>
|
6041
6107
|
<xsl:copy-of select="@*"/>
|
6042
6108
|
<p>
|
@@ -6084,6 +6150,28 @@
|
|
6084
6150
|
</xsl:for-each>
|
6085
6151
|
</xsl:template>
|
6086
6152
|
|
6153
|
+
<xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'sourcecode']" mode="table-without-br">
|
6154
|
+
<xsl:apply-templates mode="table-without-br"/>
|
6155
|
+
</xsl:template>
|
6156
|
+
|
6157
|
+
<xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'sourcecode']/text()[contains(., ' ') or contains(., ' ')]" mode="table-without-br">
|
6158
|
+
|
6159
|
+
<xsl:variable name="sep">###SOURCECODE_NEWLINE###</xsl:variable>
|
6160
|
+
<xsl:variable name="sourcecode_text" select="java:replaceAll(java:java.lang.String.new(.),'( | | )', $sep)"/>
|
6161
|
+
<xsl:variable name="items">
|
6162
|
+
<xsl:call-template name="split">
|
6163
|
+
<xsl:with-param name="pText" select="$sourcecode_text"/>
|
6164
|
+
<xsl:with-param name="sep" select="$sep"/>
|
6165
|
+
<xsl:with-param name="normalize-space">false</xsl:with-param>
|
6166
|
+
</xsl:call-template>
|
6167
|
+
</xsl:variable>
|
6168
|
+
<xsl:for-each select="xalan:nodeset($items)/*">
|
6169
|
+
<p>
|
6170
|
+
<sourcecode><xsl:copy-of select="node()"/></sourcecode>
|
6171
|
+
</p>
|
6172
|
+
</xsl:for-each>
|
6173
|
+
</xsl:template>
|
6174
|
+
|
6087
6175
|
<!-- remove redundant white spaces -->
|
6088
6176
|
<xsl:template match="text()[not(ancestor::*[local-name() = 'sourcecode'])]" mode="table-without-br">
|
6089
6177
|
<xsl:variable name="text" select="translate(.,'	 ','')"/>
|
@@ -6394,6 +6482,7 @@
|
|
6394
6482
|
<xsl:if test="ancestor::*[local-name() = 'sub']"><tag>sub</tag></xsl:if>
|
6395
6483
|
<xsl:if test="ancestor::*[local-name() = 'sup']"><tag>sup</tag></xsl:if>
|
6396
6484
|
<xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
|
6485
|
+
<xsl:if test="ancestor::*[local-name() = 'sourcecode']"><tag>sourcecode</tag></xsl:if>
|
6397
6486
|
<xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
|
6398
6487
|
</tags>
|
6399
6488
|
</xsl:template>
|
@@ -6881,6 +6970,12 @@
|
|
6881
6970
|
|
6882
6971
|
<fo:block-container margin-left="0mm">
|
6883
6972
|
|
6973
|
+
<!-- <xsl:if test="$namespace = 'iho'">
|
6974
|
+
<xsl:if test="ancestor::iho:td">
|
6975
|
+
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
6976
|
+
</xsl:if>
|
6977
|
+
</xsl:if> -->
|
6978
|
+
|
6884
6979
|
<fo:block>
|
6885
6980
|
|
6886
6981
|
<fo:inline xsl:use-attribute-sets="note-name-style">
|
@@ -8033,39 +8128,17 @@
|
|
8033
8128
|
<!-- =============== -->
|
8034
8129
|
<xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
8035
8130
|
|
8036
|
-
<
|
8037
|
-
|
8038
|
-
|
8039
|
-
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
8040
|
-
</xsl:if>
|
8041
|
-
|
8042
|
-
<xsl:if test="ancestor::*[local-name() = 'example']">
|
8043
|
-
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
8044
|
-
</xsl:if>
|
8045
|
-
|
8046
|
-
<xsl:copy-of select="@id"/>
|
8047
|
-
|
8048
|
-
<xsl:if test="parent::*[local-name() = 'note']">
|
8049
|
-
<xsl:attribute name="margin-left">
|
8050
|
-
<xsl:choose>
|
8051
|
-
<xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
|
8052
|
-
<xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
|
8053
|
-
</xsl:choose>
|
8054
|
-
</xsl:attribute>
|
8055
|
-
|
8056
|
-
</xsl:if>
|
8057
|
-
<fo:block-container margin-left="0mm">
|
8131
|
+
<xsl:variable name="sourcecode_attributes">
|
8132
|
+
<xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
|
8133
|
+
<xsl:variable name="_font-size">
|
8058
8134
|
|
8059
|
-
|
8060
|
-
<xsl:variable name="_font-size">
|
8135
|
+
9
|
8061
8136
|
|
8062
|
-
|
8137
|
+
<!-- 9 -->
|
8063
8138
|
|
8064
|
-
|
8065
|
-
|
8066
|
-
|
8067
|
-
<xsl:if test="$current_template = 'standard'">8</xsl:if>
|
8068
|
-
</xsl:if> -->
|
8139
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
8140
|
+
<xsl:if test="$current_template = 'standard'">8</xsl:if>
|
8141
|
+
</xsl:if> -->
|
8069
8142
|
|
8070
8143
|
</xsl:variable>
|
8071
8144
|
|
@@ -8080,14 +8153,60 @@
|
|
8080
8153
|
</xsl:choose>
|
8081
8154
|
</xsl:attribute>
|
8082
8155
|
</xsl:if>
|
8156
|
+
</xsl:element>
|
8157
|
+
</xsl:variable>
|
8083
8158
|
|
8159
|
+
<xsl:choose>
|
8160
|
+
<xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
|
8161
|
+
<xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
|
8162
|
+
<xsl:attribute name="{local-name()}">
|
8163
|
+
<xsl:value-of select="."/>
|
8164
|
+
</xsl:attribute>
|
8165
|
+
</xsl:for-each>
|
8084
8166
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
8085
|
-
</
|
8167
|
+
</xsl:when>
|
8086
8168
|
|
8087
|
-
|
8169
|
+
<xsl:otherwise>
|
8170
|
+
<fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
|
8088
8171
|
|
8089
|
-
|
8090
|
-
|
8172
|
+
<xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']">
|
8173
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
8174
|
+
</xsl:if>
|
8175
|
+
|
8176
|
+
<xsl:if test="ancestor::*[local-name() = 'example']">
|
8177
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
8178
|
+
</xsl:if>
|
8179
|
+
|
8180
|
+
<xsl:copy-of select="@id"/>
|
8181
|
+
|
8182
|
+
<xsl:if test="parent::*[local-name() = 'note']">
|
8183
|
+
<xsl:attribute name="margin-left">
|
8184
|
+
<xsl:choose>
|
8185
|
+
<xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
|
8186
|
+
<xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
|
8187
|
+
</xsl:choose>
|
8188
|
+
</xsl:attribute>
|
8189
|
+
|
8190
|
+
</xsl:if>
|
8191
|
+
<fo:block-container margin-left="0mm">
|
8192
|
+
|
8193
|
+
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
8194
|
+
|
8195
|
+
<xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
|
8196
|
+
<xsl:attribute name="{local-name()}">
|
8197
|
+
<xsl:value-of select="."/>
|
8198
|
+
</xsl:attribute>
|
8199
|
+
</xsl:for-each>
|
8200
|
+
|
8201
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
8202
|
+
</fo:block>
|
8203
|
+
|
8204
|
+
<xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
|
8205
|
+
|
8206
|
+
</fo:block-container>
|
8207
|
+
</fo:block-container>
|
8208
|
+
</xsl:otherwise>
|
8209
|
+
</xsl:choose>
|
8091
8210
|
</xsl:template>
|
8092
8211
|
|
8093
8212
|
<xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -10320,7 +10439,9 @@
|
|
10320
10439
|
<!-- ===================================== -->
|
10321
10440
|
<!-- Update xml -->
|
10322
10441
|
<!-- ===================================== -->
|
10442
|
+
<!-- =========================================================================== -->
|
10323
10443
|
<!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
10444
|
+
<!-- =========================================================================== -->
|
10324
10445
|
<xsl:template match="@*|node()" mode="update_xml_step1">
|
10325
10446
|
<xsl:copy>
|
10326
10447
|
<xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
|
@@ -10412,10 +10533,15 @@
|
|
10412
10533
|
<xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
|
10413
10534
|
<xsl:apply-templates mode="update_xml_step1"/>
|
10414
10535
|
</xsl:template>
|
10415
|
-
|
10536
|
+
<!-- =========================================================================== -->
|
10416
10537
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
10538
|
+
<!-- =========================================================================== -->
|
10417
10539
|
|
10540
|
+
<!-- =========================================================================== -->
|
10418
10541
|
<!-- XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
|
10542
|
+
<!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
|
10543
|
+
<!-- keep-together_within-line for: a.b, aaa.b, a.bbb, .b in table's cell ONLY -->
|
10544
|
+
<!-- =========================================================================== -->
|
10419
10545
|
<!-- Example: <keep-together_within-line>ISO 10303-51</keep-together_within-line> -->
|
10420
10546
|
<xsl:template match="@*|node()" mode="update_xml_enclose_keep-together_within-line">
|
10421
10547
|
<xsl:copy>
|
@@ -10431,10 +10557,15 @@
|
|
10431
10557
|
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
10432
10558
|
|
10433
10559
|
<!-- enclose standard's number into tag 'keep-together_within-line' -->
|
10434
|
-
<xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
|
10435
10560
|
<xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
|
10436
10561
|
<xsl:variable name="tag_keep-together_within-line_close">###/<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
|
10437
|
-
<xsl:variable name="
|
10562
|
+
<xsl:variable name="text__" select="java:replaceAll(java:java.lang.String.new(.), $regex_standard_reference, concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/>
|
10563
|
+
<xsl:variable name="text_">
|
10564
|
+
<xsl:choose>
|
10565
|
+
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:value-of select="."/></xsl:when> <!-- no need enclose standard's number into tag 'keep-together_within-line' in table cells -->
|
10566
|
+
<xsl:otherwise><xsl:value-of select="$text__"/></xsl:otherwise>
|
10567
|
+
</xsl:choose>
|
10568
|
+
</xsl:variable>
|
10438
10569
|
<xsl:variable name="text"><text><xsl:call-template name="replace_text_tags">
|
10439
10570
|
<xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/>
|
10440
10571
|
<xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/>
|
@@ -10450,7 +10581,11 @@
|
|
10450
10581
|
</xsl:variable>
|
10451
10582
|
|
10452
10583
|
<!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b -->
|
10453
|
-
|
10584
|
+
<!-- \S matches any non-whitespace character (equivalent to [^\r\n\t\f\v ]) -->
|
10585
|
+
<!-- <xsl:variable name="regex_solidus_units">((\b((\S{1,3}\/\S+)|(\S+\/\S{1,3}))\b)|(\/\S{1,3})\b)</xsl:variable> -->
|
10586
|
+
<!-- add < and > to \S -->
|
10587
|
+
<xsl:variable name="regex_S">[^\r\n\t\f\v \<>]</xsl:variable>
|
10588
|
+
<xsl:variable name="regex_solidus_units">((\b((<xsl:value-of select="$regex_S"/>{1,3}\/<xsl:value-of select="$regex_S"/>+)|(<xsl:value-of select="$regex_S"/>+\/<xsl:value-of select="$regex_S"/>{1,3}))\b)|(\/<xsl:value-of select="$regex_S"/>{1,3})\b)</xsl:variable>
|
10454
10589
|
<xsl:variable name="text3">
|
10455
10590
|
<text><xsl:for-each select="xalan:nodeset($text2)/text/node()">
|
10456
10591
|
<xsl:choose>
|
@@ -10514,9 +10649,8 @@
|
|
10514
10649
|
<xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
|
10515
10650
|
</xsl:choose>
|
10516
10651
|
</xsl:template>
|
10517
|
-
|
10518
10652
|
<!-- ===================================== -->
|
10519
|
-
<!--
|
10653
|
+
<!-- END XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' -->
|
10520
10654
|
<!-- ===================================== -->
|
10521
10655
|
|
10522
10656
|
<!-- for correct rendering combining chars -->
|
@@ -42,50 +42,24 @@ module IsoDoc
|
|
42
42
|
}
|
43
43
|
end
|
44
44
|
|
45
|
-
def
|
45
|
+
def make_table_word_toc(docxml)
|
46
|
+
docxml.at(table_toc_xpath) or return ""
|
46
47
|
toc = ""
|
47
|
-
|
48
|
-
if docxml.at("//p[@class = 'TableTitle']")
|
49
|
-
toc += make_TableWordToC(docxml)
|
50
|
-
end
|
51
|
-
if docxml.at("//p[@class = 'FigureTitle']")
|
52
|
-
toc += make_FigureWordToC(docxml)
|
53
|
-
end
|
54
|
-
intro.sub(/WORDTOC/, toc)
|
55
|
-
end
|
56
|
-
|
57
|
-
WORD_TOC_TABLE_PREFACE1 = <<~TOC.freeze
|
58
|
-
<span lang="EN-GB"><span
|
59
|
-
style='mso-element:field-begin'></span><span
|
60
|
-
style='mso-spacerun:yes'> </span>TOC
|
61
|
-
\\h \\z \\t "TableTitle,tabletitle" <span
|
62
|
-
style='mso-element:field-separator'></span></span>
|
63
|
-
TOC
|
64
|
-
|
65
|
-
WORD_TOC_FIGURE_PREFACE1 = <<~TOC.freeze
|
66
|
-
<span lang="EN-GB"><span
|
67
|
-
style='mso-element:field-begin'></span><span
|
68
|
-
style='mso-spacerun:yes'> </span>TOC
|
69
|
-
\\h \\z \\t "FigureTitle,figuretitle" <span
|
70
|
-
style='mso-element:field-separator'></span></span>
|
71
|
-
TOC
|
72
|
-
|
73
|
-
def make_TableWordToC(docxml)
|
74
|
-
toc = ""
|
75
|
-
docxml.xpath("//p[@class = 'TableTitle']").each do |h|
|
48
|
+
docxml.xpath(table_toc_xpath).each do |h|
|
76
49
|
toc += word_toc_entry(1, header_strip(h))
|
77
50
|
end
|
78
51
|
toc.sub(/(<p class="MsoToc1">)/,
|
79
|
-
%{\\1#{
|
52
|
+
%{\\1#{word_toc_table_preface1}}) + WORD_TOC_SUFFIX1
|
80
53
|
end
|
81
54
|
|
82
|
-
def
|
55
|
+
def make_figure_word_toc(docxml)
|
56
|
+
docxml.at(figure_toc_xpath) or return ""
|
83
57
|
toc = ""
|
84
|
-
docxml.xpath(
|
58
|
+
docxml.xpath(figure_toc_xpath).each do |h|
|
85
59
|
toc += word_toc_entry(1, header_strip(h))
|
86
60
|
end
|
87
61
|
toc.sub(/(<p class="MsoToc1">)/,
|
88
|
-
%{\\1#{
|
62
|
+
%{\\1#{word_toc_figure_preface1}}) + WORD_TOC_SUFFIX1
|
89
63
|
end
|
90
64
|
|
91
65
|
def word_toc_preface(level)
|
@@ -185,7 +159,7 @@ module IsoDoc
|
|
185
159
|
end
|
186
160
|
|
187
161
|
def authority_cleanup(docxml)
|
188
|
-
auth = docxml.at("//div[@id = 'boilerplate-feedback' or "\
|
162
|
+
auth = docxml.at("//div[@id = 'boilerplate-feedback' or " \
|
189
163
|
"@class = 'boilerplate-feedback']")
|
190
164
|
auth&.remove
|
191
165
|
super
|
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.1.
|
4
|
+
version: 2.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-iso
|