metanorma-iec 2.5.6 → 2.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/iec/base_convert.rb +8 -13
- data/lib/isodoc/iec/iec.international-standard.xsl +197 -23
- data/lib/isodoc/iec/init.rb +2 -3
- data/lib/isodoc/iec/metadata.rb +12 -12
- data/lib/isodoc/iec/presentation_terms.rb +13 -4
- data/lib/isodoc/iec/presentation_xml_convert.rb +1 -1
- data/lib/isodoc/iec/word_convert.rb +1 -1
- data/lib/isodoc/iec/xref.rb +1 -1
- data/lib/metanorma/iec/biblio.rng +13 -1
- data/lib/metanorma/iec/front.rb +0 -1
- data/lib/metanorma/iec/isodoc.rng +6 -6
- data/lib/metanorma/iec/relaton-iec.rng +15 -32
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2943a0d27f9b2a3dfc6f3075e9f09a5e98e2e3bff208fedecf134a79d8e62d77
|
4
|
+
data.tar.gz: c4d3c17e2d976295a1c43a099db21131d7234c08365145dc653e2d9483a8cee5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdf68ccbd39985b4d01465b82e03a4c3e877ed2287f7b918e4003216d8985f65a0ac1225a453de0b9c28e99e129a4dbb5366c5c2c07d4e639556e6e324fcc440
|
7
|
+
data.tar.gz: 2bad112331aabedd8c60fce2052dd73edcacb707d1c84778d41ba1a735930a825795d77a4aaca9f6721ed8d7723659de3160bae06af4efb9084079f628b2b870
|
@@ -8,28 +8,27 @@ module IsoDoc
|
|
8
8
|
# processed in foreword instead
|
9
9
|
end
|
10
10
|
|
11
|
-
def foreword(
|
12
|
-
out.div **attr_code(id:
|
13
|
-
|
14
|
-
|
11
|
+
def foreword(clause, out)
|
12
|
+
out.div **attr_code(id: clause["id"]) do |s|
|
13
|
+
clause_name(nil, clause.at(ns("./title")), s,
|
14
|
+
{ class: "ForewordTitle" })
|
15
|
+
clause.elements.each { |e| parse(e, s) unless e.name == "title" }
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
18
19
|
def bibliography(node, out)
|
19
|
-
return super
|
20
|
+
@is_iev or return super
|
20
21
|
end
|
21
22
|
|
22
23
|
def biblio_list(elem, div, biblio)
|
23
|
-
return super
|
24
|
-
|
24
|
+
@is_iev or return super
|
25
25
|
elem.children.each do |b|
|
26
26
|
parse(b, div) unless %w(title bibitem).include? b.name
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
def terms_parse(node, out)
|
31
|
-
return super
|
32
|
-
|
31
|
+
@is_iev or return super
|
33
32
|
page_break(out)
|
34
33
|
out.div **attr_code(id: node["id"]) do |div|
|
35
34
|
depth = clause_title_depth(node, nil)
|
@@ -44,10 +43,6 @@ module IsoDoc
|
|
44
43
|
end
|
45
44
|
end
|
46
45
|
|
47
|
-
def set_termdomain(termdomain)
|
48
|
-
return super unless @is_iev
|
49
|
-
end
|
50
|
-
|
51
46
|
def para_class(node)
|
52
47
|
case node["class"]
|
53
48
|
when "zzSTDTitle1", "zzSTDTitle2" then "zzSTDTitle1"
|
@@ -5804,6 +5804,11 @@
|
|
5804
5804
|
|
5805
5805
|
<xsl:value-of select="@reference"/>
|
5806
5806
|
|
5807
|
+
<!-- commented https://github.com/metanorma/isodoc/issues/614 -->
|
5808
|
+
<!-- <xsl:if test="$namespace = 'itu'">
|
5809
|
+
<xsl:text>)</xsl:text>
|
5810
|
+
</xsl:if> -->
|
5811
|
+
|
5807
5812
|
</fo:inline>
|
5808
5813
|
<fo:inline xsl:use-attribute-sets="table-fn-body-style">
|
5809
5814
|
<xsl:copy-of select="./node()"/>
|
@@ -5813,7 +5818,7 @@
|
|
5813
5818
|
|
5814
5819
|
</xsl:if>
|
5815
5820
|
</xsl:for-each>
|
5816
|
-
</xsl:template>
|
5821
|
+
</xsl:template> <!-- table_fn_display -->
|
5817
5822
|
|
5818
5823
|
<xsl:template name="create_fn">
|
5819
5824
|
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
@@ -5841,8 +5846,10 @@
|
|
5841
5846
|
<!-- EMD table's footnotes rendering -->
|
5842
5847
|
<!-- ============================ -->
|
5843
5848
|
|
5849
|
+
<!-- ============================ -->
|
5844
5850
|
<!-- figure's footnotes rendering -->
|
5845
|
-
|
5851
|
+
<!-- ============================ -->
|
5852
|
+
<xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
|
5846
5853
|
|
5847
5854
|
<!-- current figure id -->
|
5848
5855
|
<xsl:variable name="figure_id_">
|
@@ -5955,9 +5962,30 @@
|
|
5955
5962
|
|
5956
5963
|
</fo:block>
|
5957
5964
|
</xsl:if>
|
5958
|
-
|
5959
5965
|
</xsl:template> <!-- fn_display_figure -->
|
5960
5966
|
|
5967
|
+
<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
|
5968
|
+
<!-- figure's footnote label -->
|
5969
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'dl'][@key = 'true']/*[local-name() = 'dt']/ *[local-name() = 'p'][count(node()[normalize-space() != '']) = 1]/*[local-name() = 'sup']" priority="3">
|
5970
|
+
<xsl:variable name="key_iso">
|
5971
|
+
true
|
5972
|
+
</xsl:variable>
|
5973
|
+
<xsl:if test="normalize-space($key_iso) = 'true'">
|
5974
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
5975
|
+
|
5976
|
+
<xsl:attribute name="font-size">8pt</xsl:attribute>
|
5977
|
+
|
5978
|
+
</xsl:if>
|
5979
|
+
<fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
|
5980
|
+
<!-- <xsl:value-of select="@reference"/> -->
|
5981
|
+
<xsl:apply-templates/>
|
5982
|
+
</fo:inline>
|
5983
|
+
</xsl:template>
|
5984
|
+
|
5985
|
+
<!-- ============================ -->
|
5986
|
+
<!-- END: figure's footnotes rendering -->
|
5987
|
+
<!-- ============================ -->
|
5988
|
+
|
5961
5989
|
<!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) -->
|
5962
5990
|
<xsl:template match="*[local-name()='fn']">
|
5963
5991
|
<fo:inline xsl:use-attribute-sets="fn-reference-style">
|
@@ -5973,6 +6001,10 @@
|
|
5973
6001
|
|
5974
6002
|
<xsl:value-of select="@reference"/>
|
5975
6003
|
|
6004
|
+
<!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
|
6005
|
+
<!-- <xsl:if test="$namespace = 'jis'">
|
6006
|
+
<fo:inline font-weight="normal">)</fo:inline>
|
6007
|
+
</xsl:if> -->
|
5976
6008
|
</fo:basic-link>
|
5977
6009
|
</fo:inline>
|
5978
6010
|
</xsl:template>
|
@@ -6104,17 +6136,22 @@
|
|
6104
6136
|
</fo:block>
|
6105
6137
|
</xsl:when> <!-- END: a few components -->
|
6106
6138
|
<xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
|
6107
|
-
|
6139
|
+
<!-- Presentation XML contains 'Key' caption, https://github.com/metanorma/isodoc/issues/607 -->
|
6140
|
+
<xsl:if test="not(preceding-sibling::*[1][local-name() = 'p' and @keep-with-next])"> <!-- for old Presentation XML -->
|
6108
6141
|
|
6109
|
-
|
6142
|
+
<fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
|
6110
6143
|
|
6111
|
-
|
6112
|
-
|
6113
|
-
|
6114
|
-
|
6115
|
-
|
6116
|
-
|
6117
|
-
|
6144
|
+
<xsl:call-template name="refine_figure_key_style"/>
|
6145
|
+
|
6146
|
+
<xsl:variable name="title-key">
|
6147
|
+
<xsl:call-template name="getLocalizedString">
|
6148
|
+
<xsl:with-param name="key">key</xsl:with-param>
|
6149
|
+
</xsl:call-template>
|
6150
|
+
</xsl:variable>
|
6151
|
+
<xsl:value-of select="$title-key"/>
|
6152
|
+
</fo:block>
|
6153
|
+
|
6154
|
+
</xsl:if>
|
6118
6155
|
</xsl:when> <!-- END: definition list in a figure -->
|
6119
6156
|
</xsl:choose>
|
6120
6157
|
|
@@ -6302,6 +6339,14 @@
|
|
6302
6339
|
|
6303
6340
|
</xsl:template> <!-- END: dl -->
|
6304
6341
|
|
6342
|
+
<!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
|
6343
|
+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
|
6344
|
+
<fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
|
6345
|
+
<xsl:call-template name="refine_figure_key_style"/>
|
6346
|
+
<xsl:apply-templates/>
|
6347
|
+
</fo:block>
|
6348
|
+
</xsl:template>
|
6349
|
+
|
6305
6350
|
<xsl:template name="refine_dl_formula_where_style">
|
6306
6351
|
|
6307
6352
|
<xsl:attribute name="margin-bottom">10pt</xsl:attribute>
|
@@ -8410,6 +8455,39 @@
|
|
8410
8455
|
</xsl:copy>
|
8411
8456
|
</xsl:template>
|
8412
8457
|
|
8458
|
+
<xsl:template match="@*|node()" mode="mathml_linebreak">
|
8459
|
+
<xsl:copy>
|
8460
|
+
<xsl:apply-templates select="@*|node()" mode="mathml_linebreak"/>
|
8461
|
+
</xsl:copy>
|
8462
|
+
</xsl:template>
|
8463
|
+
|
8464
|
+
<!-- split math into two math -->
|
8465
|
+
<xsl:template match="mathml:mo[@linebreak] | mathml:mspace[@linebreak]" mode="mathml_linebreak">
|
8466
|
+
<xsl:variable name="math_elements_tree_">
|
8467
|
+
<xsl:for-each select="ancestor::*[ancestor-or-self::mathml:math]">
|
8468
|
+
<element pos="{position()}">
|
8469
|
+
<xsl:copy-of select="@*[local-name() != 'id']"/>
|
8470
|
+
<xsl:value-of select="name()"/>
|
8471
|
+
</element>
|
8472
|
+
</xsl:for-each>
|
8473
|
+
</xsl:variable>
|
8474
|
+
|
8475
|
+
<xsl:variable name="math_elements_tree" select="xalan:nodeset($math_elements_tree_)"/>
|
8476
|
+
|
8477
|
+
<xsl:call-template name="insertClosingElements">
|
8478
|
+
<xsl:with-param name="tree" select="$math_elements_tree"/>
|
8479
|
+
</xsl:call-template>
|
8480
|
+
|
8481
|
+
<xsl:element name="br" namespace="{$namespace_full}"/>
|
8482
|
+
|
8483
|
+
<xsl:call-template name="insertOpeningElements">
|
8484
|
+
<xsl:with-param name="tree" select="$math_elements_tree"/>
|
8485
|
+
<xsl:with-param name="xmlns">http://www.w3.org/1998/Math/MathML</xsl:with-param>
|
8486
|
+
<xsl:with-param name="add_continue">false</xsl:with-param>
|
8487
|
+
</xsl:call-template>
|
8488
|
+
|
8489
|
+
</xsl:template>
|
8490
|
+
|
8413
8491
|
<!-- Examples:
|
8414
8492
|
<stem type="AsciiMath">x = 1</stem>
|
8415
8493
|
<stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
|
@@ -8661,9 +8739,11 @@
|
|
8661
8739
|
</xsl:template>
|
8662
8740
|
|
8663
8741
|
<xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
|
8742
|
+
<!-- https://github.com/metanorma/isodoc/issues/607
|
8664
8743
|
<xsl:if test="normalize-space() != ''">
|
8665
|
-
<xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
|
8666
|
-
</xsl:if>
|
8744
|
+
<xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
|
8745
|
+
</xsl:if> -->
|
8746
|
+
<xsl:apply-templates/>
|
8667
8747
|
</xsl:template>
|
8668
8748
|
|
8669
8749
|
<!-- stem inside formula with name (with formula's number) -->
|
@@ -8819,6 +8899,17 @@
|
|
8819
8899
|
</xsl:when>
|
8820
8900
|
<xsl:otherwise>
|
8821
8901
|
|
8902
|
+
<!-- https://github.com/metanorma/isodoc/issues/607 -->
|
8903
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
8904
|
+
<xsl:text>—</xsl:text> em dash —
|
8905
|
+
</xsl:if> -->
|
8906
|
+
<!-- <xsl:if test="$namespace = 'iho' or $namespace = 'gb' or $namespace = 'm3d' or $namespace = 'unece-rec' or $namespace = 'unece' or $namespace = 'rsd'">
|
8907
|
+
<xsl:text>:</xsl:text>
|
8908
|
+
</xsl:if> -->
|
8909
|
+
|
8910
|
+
<!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp'">
|
8911
|
+
<xsl:text> – </xsl:text> en dash –
|
8912
|
+
</xsl:if> -->
|
8822
8913
|
</xsl:otherwise>
|
8823
8914
|
</xsl:choose>
|
8824
8915
|
</xsl:variable>
|
@@ -8837,8 +8928,16 @@
|
|
8837
8928
|
</xsl:when>
|
8838
8929
|
<xsl:otherwise>
|
8839
8930
|
|
8931
|
+
<!-- https://github.com/metanorma/isodoc/issues/607 -->
|
8932
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
8933
|
+
<xsl:text>—</xsl:text> em dash —
|
8934
|
+
</xsl:if> -->
|
8935
|
+
<!-- <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' or $namespace = 'rsd' or $namespace = 'jcgm'">
|
8840
8936
|
<xsl:text>:</xsl:text>
|
8841
|
-
|
8937
|
+
</xsl:if> -->
|
8938
|
+
<!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'unece-rec' or $namespace = 'unece'">
|
8939
|
+
<xsl:text> – </xsl:text> en dash –
|
8940
|
+
</xsl:if> -->
|
8842
8941
|
</xsl:otherwise>
|
8843
8942
|
</xsl:choose>
|
8844
8943
|
</xsl:variable>
|
@@ -11019,7 +11118,7 @@
|
|
11019
11118
|
<xsl:if test="normalize-space() != ''">
|
11020
11119
|
<fo:inline xsl:use-attribute-sets="termexample-name-style">
|
11021
11120
|
<xsl:call-template name="refine_termexample-name-style"/>
|
11022
|
-
<xsl:apply-templates/>
|
11121
|
+
<xsl:apply-templates/> <!-- commented $namespace = 'ieee', https://github.com/metanorma/isodoc/issues/614-->
|
11023
11122
|
</fo:inline>
|
11024
11123
|
</xsl:if>
|
11025
11124
|
</xsl:template>
|
@@ -11187,7 +11286,7 @@
|
|
11187
11286
|
<xsl:otherwise>
|
11188
11287
|
<fo:inline xsl:use-attribute-sets="example-name-style">
|
11189
11288
|
<xsl:call-template name="refine_example-name-style"/>
|
11190
|
-
<xsl:apply-templates/>
|
11289
|
+
<xsl:apply-templates/> <!-- $namespace = 'ieee', see https://github.com/metanorma/isodoc/issues/614 -->
|
11191
11290
|
</fo:inline>
|
11192
11291
|
</xsl:otherwise>
|
11193
11292
|
</xsl:choose>
|
@@ -11369,15 +11468,17 @@
|
|
11369
11468
|
|
11370
11469
|
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
11371
11470
|
<fo:block role="BlockQuote">
|
11372
|
-
<xsl:apply-templates select="./node()[not(local-name() = 'author') and
|
11471
|
+
<xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source') and not(local-name() = 'attribution')]"/> <!-- process all nested nodes, except author and source -->
|
11373
11472
|
</fo:block>
|
11374
11473
|
</fo:block-container>
|
11375
11474
|
</fo:block-container>
|
11376
|
-
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
|
11475
|
+
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source'] or *[local-name() = 'attribution']">
|
11377
11476
|
<fo:block xsl:use-attribute-sets="quote-source-style">
|
11378
11477
|
<!-- — ISO, ISO 7301:2011, Clause 1 -->
|
11379
11478
|
<xsl:apply-templates select="*[local-name() = 'author']"/>
|
11380
11479
|
<xsl:apply-templates select="*[local-name() = 'source']"/>
|
11480
|
+
<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
|
11481
|
+
<xsl:apply-templates select="*[local-name() = 'attribution']/*[local-name() = 'p']/node()"/>
|
11381
11482
|
</fo:block>
|
11382
11483
|
</xsl:if>
|
11383
11484
|
|
@@ -11399,9 +11500,13 @@
|
|
11399
11500
|
</xsl:template>
|
11400
11501
|
|
11401
11502
|
<xsl:template match="*[local-name() = 'author']">
|
11402
|
-
<xsl:
|
11503
|
+
<xsl:if test="local-name(..) = 'quote'"> <!-- for old Presentation XML, https://github.com/metanorma/isodoc/issues/607 -->
|
11504
|
+
<xsl:text>— </xsl:text>
|
11505
|
+
</xsl:if>
|
11403
11506
|
<xsl:apply-templates/>
|
11404
11507
|
</xsl:template>
|
11508
|
+
|
11509
|
+
<xsl:template match="*[local-name() = 'quote']//*[local-name() = 'referenceFrom']"/>
|
11405
11510
|
<!-- ====== -->
|
11406
11511
|
<!-- ====== -->
|
11407
11512
|
|
@@ -11585,8 +11690,12 @@
|
|
11585
11690
|
</xsl:template>
|
11586
11691
|
|
11587
11692
|
<xsl:template match="*[local-name() = 'domain']">
|
11693
|
+
<!-- https://github.com/metanorma/isodoc/issues/607
|
11588
11694
|
<fo:inline xsl:use-attribute-sets="domain-style"><<xsl:apply-templates/>></fo:inline>
|
11589
|
-
<xsl:text> </xsl:text>
|
11695
|
+
<xsl:text> </xsl:text> -->
|
11696
|
+
<xsl:if test="not(@hidden = 'true')">
|
11697
|
+
<xsl:apply-templates/>
|
11698
|
+
</xsl:if>
|
11590
11699
|
</xsl:template>
|
11591
11700
|
|
11592
11701
|
<xsl:template match="*[local-name() = 'admitted']">
|
@@ -11634,6 +11743,29 @@
|
|
11634
11743
|
<!-- END definition -->
|
11635
11744
|
<!-- ========== -->
|
11636
11745
|
|
11746
|
+
<xsl:variable name="reviews_">
|
11747
|
+
<xsl:for-each select="//*[local-name() = 'review'][@from]">
|
11748
|
+
<xsl:copy>
|
11749
|
+
<xsl:copy-of select="@from"/>
|
11750
|
+
<xsl:copy-of select="@id"/>
|
11751
|
+
</xsl:copy>
|
11752
|
+
</xsl:for-each>
|
11753
|
+
</xsl:variable>
|
11754
|
+
<xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
|
11755
|
+
|
11756
|
+
<xsl:template name="addReviewHelper">
|
11757
|
+
<!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
|
11758
|
+
<xsl:variable name="curr_id" select="@id"/>
|
11759
|
+
<xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
|
11760
|
+
<xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
|
11761
|
+
<fo:block keep-with-next="always" line-height="0.1" id="{$review_id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$review_id}" fox:alt-text="Annot___{$review_id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
11762
|
+
</xsl:if>
|
11763
|
+
<!-- <fo:block>
|
11764
|
+
<curr_id><xsl:value-of select="$curr_id"/></curr_id>
|
11765
|
+
<xsl:copy-of select="$reviews"/>
|
11766
|
+
</fo:block> -->
|
11767
|
+
</xsl:template>
|
11768
|
+
|
11637
11769
|
<!-- main sections -->
|
11638
11770
|
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
|
11639
11771
|
|
@@ -11642,6 +11774,8 @@
|
|
11642
11774
|
|
11643
11775
|
<xsl:call-template name="sections_element_style"/>
|
11644
11776
|
|
11777
|
+
<xsl:call-template name="addReviewHelper"/>
|
11778
|
+
|
11645
11779
|
<xsl:apply-templates/>
|
11646
11780
|
</fo:block>
|
11647
11781
|
|
@@ -11677,6 +11811,7 @@
|
|
11677
11811
|
|
11678
11812
|
<fo:block>
|
11679
11813
|
<xsl:call-template name="setId"/>
|
11814
|
+
<xsl:call-template name="addReviewHelper"/>
|
11680
11815
|
<xsl:apply-templates/>
|
11681
11816
|
</fo:block>
|
11682
11817
|
</xsl:template>
|
@@ -11713,6 +11848,8 @@
|
|
11713
11848
|
|
11714
11849
|
<xsl:call-template name="refine_clause_style"/>
|
11715
11850
|
|
11851
|
+
<xsl:call-template name="addReviewHelper"/>
|
11852
|
+
|
11716
11853
|
<xsl:apply-templates/>
|
11717
11854
|
</fo:block>
|
11718
11855
|
</xsl:template>
|
@@ -11765,6 +11902,23 @@
|
|
11765
11902
|
|
11766
11903
|
<xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
|
11767
11904
|
|
11905
|
+
<xsl:if test="1 = 1">
|
11906
|
+
<xsl:choose>
|
11907
|
+
<!-- if there isn't the attribute '@from', then -->
|
11908
|
+
<xsl:when test="$id_from = ''">
|
11909
|
+
<fo:block id="{@id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
11910
|
+
</xsl:when>
|
11911
|
+
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
11912
|
+
<xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
|
11913
|
+
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
11914
|
+
</xsl:when>
|
11915
|
+
<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
|
11916
|
+
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
11917
|
+
</xsl:when>
|
11918
|
+
</xsl:choose>
|
11919
|
+
</xsl:if>
|
11920
|
+
|
11921
|
+
<xsl:if test="1 = 2">
|
11768
11922
|
<xsl:choose>
|
11769
11923
|
<!-- if there isn't the attribute '@from', then -->
|
11770
11924
|
<xsl:when test="$id_from = ''">
|
@@ -11778,6 +11932,7 @@
|
|
11778
11932
|
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
|
11779
11933
|
</xsl:when>
|
11780
11934
|
</xsl:choose>
|
11935
|
+
</xsl:if>
|
11781
11936
|
|
11782
11937
|
</xsl:template>
|
11783
11938
|
|
@@ -13147,7 +13302,7 @@
|
|
13147
13302
|
<!-- remove preprocess-xslt -->
|
13148
13303
|
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
|
13149
13304
|
|
13150
|
-
<xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image'] | *[local-name() = 'sourcecode'] | *[local-name() = 'bibdata'] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
13305
|
+
<xsl:template match="*[local-name() = 'stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])] | *[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
13151
13306
|
<xsl:copy-of select="."/>
|
13152
13307
|
</xsl:template>
|
13153
13308
|
|
@@ -13213,6 +13368,22 @@
|
|
13213
13368
|
</xsl:choose>
|
13214
13369
|
</xsl:template>
|
13215
13370
|
|
13371
|
+
<xsl:variable name="regex_passthrough">.*\bpdf\b.*</xsl:variable>
|
13372
|
+
<xsl:template match="*[local-name() = 'passthrough']" mode="update_xml_step1">
|
13373
|
+
<!-- <xsl:if test="contains(@formats, ' pdf ')"> -->
|
13374
|
+
<xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
|
13375
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
13376
|
+
</xsl:if>
|
13377
|
+
</xsl:template>
|
13378
|
+
|
13379
|
+
<!-- split math by element with @linebreak into maths -->
|
13380
|
+
<xsl:template match="mathml:math[.//mathml:mo[@linebreak] or .//mathml:mspace[@linebreak]]" mode="update_xml_step1">
|
13381
|
+
<xsl:variable name="maths">
|
13382
|
+
<xsl:apply-templates select="." mode="mathml_linebreak"/>
|
13383
|
+
</xsl:variable>
|
13384
|
+
<xsl:copy-of select="$maths"/>
|
13385
|
+
</xsl:template>
|
13386
|
+
|
13216
13387
|
<!-- =========================================================================== -->
|
13217
13388
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
13218
13389
|
<!-- =========================================================================== -->
|
@@ -13316,6 +13487,8 @@
|
|
13316
13487
|
|
13317
13488
|
<xsl:template name="insertOpeningElements">
|
13318
13489
|
<xsl:param name="tree"/>
|
13490
|
+
<xsl:param name="xmlns"/>
|
13491
|
+
<xsl:param name="add_continue">true</xsl:param>
|
13319
13492
|
<xsl:for-each select="$tree//element">
|
13320
13493
|
<xsl:text disable-output-escaping="yes"><</xsl:text>
|
13321
13494
|
<xsl:value-of select="."/>
|
@@ -13326,7 +13499,8 @@
|
|
13326
13499
|
<xsl:value-of select="."/>
|
13327
13500
|
<xsl:text>"</xsl:text>
|
13328
13501
|
</xsl:for-each>
|
13329
|
-
<xsl:if test="position() = 1"> continue="true"</xsl:if>
|
13502
|
+
<xsl:if test="position() = 1 and $add_continue = 'true'"> continue="true"</xsl:if>
|
13503
|
+
<xsl:if test="position() = 1 and $xmlns != ''"> xmlns="<xsl:value-of select="$xmlns"/>"</xsl:if>
|
13330
13504
|
<xsl:text disable-output-escaping="yes">></xsl:text>
|
13331
13505
|
<xsl:if test="$debug = 'true'">
|
13332
13506
|
<xsl:message><<xsl:value-of select="."/>></xsl:message>
|
data/lib/isodoc/iec/init.rb
CHANGED
@@ -11,9 +11,8 @@ module IsoDoc
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def xref_init(lang, script, _klass, labels, options)
|
14
|
-
|
15
|
-
|
16
|
-
labels, options)
|
14
|
+
p = HtmlConvert.new(language: lang, script: script)
|
15
|
+
@xrefs = Xref.new(lang, script, p, labels, options)
|
17
16
|
end
|
18
17
|
|
19
18
|
def i18n_init(lang, script, locale, i18nyaml = nil)
|
data/lib/isodoc/iec/metadata.rb
CHANGED
@@ -20,25 +20,25 @@ module IsoDoc
|
|
20
20
|
set(:revdate, revdate&.text)
|
21
21
|
end
|
22
22
|
|
23
|
-
def doctype(
|
23
|
+
def doctype(xml, _out)
|
24
24
|
super
|
25
|
-
b =
|
26
|
-
b1 =
|
25
|
+
b = xml.at(ns("//bibdata/ext/doctype#{NOLANG}"))&.text
|
26
|
+
b1 = xml.at(ns("//bibdata/ext/doctype[@language = 'en']"))&.text || b
|
27
27
|
b1 and set(:doctype_en, status_print(b1))
|
28
|
-
b1 =
|
28
|
+
b1 = xml.at(ns("//bibdata/ext/doctype[@language = 'fr']"))&.text || b
|
29
29
|
b1 and set(:doctype_fr, status_print(b1))
|
30
|
-
docfunction(
|
31
|
-
dochorizontal(
|
30
|
+
docfunction(xml)
|
31
|
+
dochorizontal(xml)
|
32
32
|
end
|
33
33
|
|
34
|
-
def docfunction(
|
35
|
-
b =
|
34
|
+
def docfunction(xml)
|
35
|
+
b = xml.at(ns("//bibdata/ext/function#{NOLANG}"))&.text || return
|
36
36
|
b and set(:function, status_print(b))
|
37
|
-
b1 =
|
37
|
+
b1 = xml.at(ns("//bibdata/ext/function#{currlang}"))&.text || b
|
38
38
|
b1 and set(:function_display, status_print(b1))
|
39
|
-
b1 =
|
39
|
+
b1 = xml.at(ns("//bibdata/ext/function[@language = 'en']"))&.text || b
|
40
40
|
b1 and set(:function_en, status_print(b1))
|
41
|
-
b1 =
|
41
|
+
b1 = xml.at(ns("//bibdata/ext/function[@language = 'fr']"))&.text || b
|
42
42
|
b1 and set(:function_fr, status_print(b1))
|
43
43
|
end
|
44
44
|
|
@@ -54,7 +54,7 @@ module IsoDoc
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def unpublished(status)
|
57
|
-
status.to_i
|
57
|
+
status.to_i.positive? && status.to_i < 60
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -38,6 +38,14 @@ module IsoDoc
|
|
38
38
|
merge_fr_into_en_term(docxml)
|
39
39
|
end
|
40
40
|
|
41
|
+
def termdomain(elem)
|
42
|
+
if @is_iev
|
43
|
+
d = elem.at(ns("./domain")) or return
|
44
|
+
d["hidden"] = true
|
45
|
+
else super
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
41
49
|
def merge_fr_into_en_term(docxml)
|
42
50
|
@is_iev or return
|
43
51
|
docxml.xpath(ns("//term[@language = 'en'][@tag]")).each do |en|
|
@@ -119,13 +127,13 @@ module IsoDoc
|
|
119
127
|
|
120
128
|
def move_related(term)
|
121
129
|
defn = term.at(ns("./definition")) or return
|
122
|
-
term.xpath(ns("./related")).
|
130
|
+
term.xpath(ns("./related")).reverse_each do |r|
|
123
131
|
defn.next = r.remove
|
124
132
|
end
|
125
133
|
end
|
126
134
|
|
127
135
|
def related1(node)
|
128
|
-
lg = node
|
136
|
+
lg = node.at("./ancestor::xmlns:term/@language")&.text
|
129
137
|
@i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
|
130
138
|
p = node.at(ns("./preferred"))
|
131
139
|
ref = node.at(ns("./xref | ./eref | ./termref"))
|
@@ -171,14 +179,15 @@ module IsoDoc
|
|
171
179
|
@i18n = @i18n_lg["default"]
|
172
180
|
end
|
173
181
|
|
174
|
-
def
|
182
|
+
def termnote_label(elem)
|
175
183
|
lg = elem&.at("./ancestor::xmlns:term/@language")&.text
|
176
184
|
@i18n = @i18n_lg[lg] if lg && @i18n_lg[lg]
|
177
185
|
|
178
186
|
val = @xrefs.anchor(elem["id"], :value) || "???"
|
179
187
|
lbl = @i18n.termnote.gsub("%", val)
|
180
|
-
|
188
|
+
ret = @i18n.l10n "#{lbl}#{termnote_delim(elem)}"
|
181
189
|
@i18n = @i18n_lg["default"]
|
190
|
+
ret
|
182
191
|
end
|
183
192
|
end
|
184
193
|
end
|
data/lib/isodoc/iec/xref.rb
CHANGED
@@ -1783,9 +1783,21 @@ that the `number` given for the series applies to the second iteration of number
|
|
1783
1783
|
May be used to differentiate rendering of notes in bibliographies</a:documentation>
|
1784
1784
|
</attribute>
|
1785
1785
|
</optional>
|
1786
|
-
<ref name="
|
1786
|
+
<ref name="LocalizedStringAttributes">
|
1787
1787
|
<a:documentation>The content of the note</a:documentation>
|
1788
1788
|
</ref>
|
1789
|
+
<choice>
|
1790
|
+
<oneOrMore>
|
1791
|
+
<ref name="BasicBlockNoId">
|
1792
|
+
<a:documentation>Multiple blocks of content</a:documentation>
|
1793
|
+
</ref>
|
1794
|
+
</oneOrMore>
|
1795
|
+
<oneOrMore>
|
1796
|
+
<ref name="TextElement">
|
1797
|
+
<a:documentation>Single block of content</a:documentation>
|
1798
|
+
</ref>
|
1799
|
+
</oneOrMore>
|
1800
|
+
</choice>
|
1789
1801
|
</element>
|
1790
1802
|
</define>
|
1791
1803
|
<define name="bibabstract">
|
data/lib/metanorma/iec/front.rb
CHANGED
@@ -166,7 +166,6 @@ module Metanorma
|
|
166
166
|
super
|
167
167
|
a = node.attr("accessibility-color-inside") and
|
168
168
|
xml.accessibility_color_inside a
|
169
|
-
a = node.attr("price-code") and xml.price_code a
|
170
169
|
a = node.attr("cen-processing") and xml.cen_processing a
|
171
170
|
a = node.attr("secretary") and xml.secretary a
|
172
171
|
a = node.attr("interest-to-committees") and xml.interest_to_committees a
|
@@ -17,7 +17,7 @@
|
|
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.4.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">
|
@@ -326,7 +326,7 @@ normative or informative references, some split references into sections organiz
|
|
326
326
|
<a:documentation>Content of note</a:documentation>
|
327
327
|
<oneOrMore>
|
328
328
|
<choice>
|
329
|
-
<ref name="paragraph"/>
|
329
|
+
<ref name="paragraph-with-footnote"/>
|
330
330
|
<ref name="ul"/>
|
331
331
|
<ref name="ol"/>
|
332
332
|
<ref name="dl"/>
|
@@ -412,7 +412,7 @@ normative or informative references, some split references into sections organiz
|
|
412
412
|
<element name="note">
|
413
413
|
<ref name="OptionalId"/>
|
414
414
|
<oneOrMore>
|
415
|
-
<ref name="paragraph"/>
|
415
|
+
<ref name="paragraph-with-footnote"/>
|
416
416
|
</oneOrMore>
|
417
417
|
</element>
|
418
418
|
</define>
|
@@ -1977,7 +1977,7 @@ used in document amendments</a:documentation>
|
|
1977
1977
|
<oneOrMore>
|
1978
1978
|
<choice>
|
1979
1979
|
<a:documentation>Content of the verbal representation of the term</a:documentation>
|
1980
|
-
<ref name="paragraph"/>
|
1980
|
+
<ref name="paragraph-with-footnote"/>
|
1981
1981
|
<ref name="dl"/>
|
1982
1982
|
<ref name="ol"/>
|
1983
1983
|
<ref name="ul"/>
|
@@ -2015,7 +2015,7 @@ used in document amendments</a:documentation>
|
|
2015
2015
|
<oneOrMore>
|
2016
2016
|
<choice>
|
2017
2017
|
<a:documentation>Content of the term note</a:documentation>
|
2018
|
-
<ref name="paragraph"/>
|
2018
|
+
<ref name="paragraph-with-footnote"/>
|
2019
2019
|
<ref name="ul"/>
|
2020
2020
|
<ref name="ol"/>
|
2021
2021
|
<ref name="dl"/>
|
@@ -2037,7 +2037,7 @@ used in document amendments</a:documentation>
|
|
2037
2037
|
<ref name="dl"/>
|
2038
2038
|
<ref name="quote"/>
|
2039
2039
|
<ref name="sourcecode"/>
|
2040
|
-
<ref name="paragraph"/>
|
2040
|
+
<ref name="paragraph-with-footnote"/>
|
2041
2041
|
<ref name="figure"/>
|
2042
2042
|
</choice>
|
2043
2043
|
</oneOrMore>
|
@@ -28,10 +28,10 @@
|
|
28
28
|
<ref name="updates_document_type"/>
|
29
29
|
</optional>
|
30
30
|
<optional>
|
31
|
-
<ref name="
|
31
|
+
<ref name="price-code"/>
|
32
32
|
</optional>
|
33
33
|
<optional>
|
34
|
-
<ref name="
|
34
|
+
<ref name="accessibility-color-inside"/>
|
35
35
|
</optional>
|
36
36
|
<optional>
|
37
37
|
<ref name="cen-processing"/>
|
@@ -75,36 +75,19 @@
|
|
75
75
|
</choice>
|
76
76
|
</element>
|
77
77
|
</define>
|
78
|
-
<define name="
|
79
|
-
<
|
80
|
-
<
|
81
|
-
|
82
|
-
|
83
|
-
<
|
84
|
-
|
85
|
-
|
86
|
-
<
|
87
|
-
|
88
|
-
|
89
|
-
<
|
90
|
-
|
91
|
-
</zeroOrMore>
|
92
|
-
<zeroOrMore>
|
93
|
-
<ref name="contact"/>
|
94
|
-
</zeroOrMore>
|
95
|
-
<optional>
|
96
|
-
<ref name="technical-committee"/>
|
97
|
-
</optional>
|
98
|
-
<optional>
|
99
|
-
<ref name="subcommittee"/>
|
100
|
-
</optional>
|
101
|
-
<optional>
|
102
|
-
<ref name="workgroup"/>
|
103
|
-
</optional>
|
104
|
-
<optional>
|
105
|
-
<ref name="secretariat"/>
|
106
|
-
</optional>
|
107
|
-
</element>
|
78
|
+
<define name="OrganizationType" combine="interleave">
|
79
|
+
<optional>
|
80
|
+
<ref name="technical-committee"/>
|
81
|
+
</optional>
|
82
|
+
<optional>
|
83
|
+
<ref name="subcommittee"/>
|
84
|
+
</optional>
|
85
|
+
<optional>
|
86
|
+
<ref name="workgroup"/>
|
87
|
+
</optional>
|
88
|
+
<optional>
|
89
|
+
<ref name="secretariat"/>
|
90
|
+
</optional>
|
108
91
|
</define>
|
109
92
|
<define name="DocumentType">
|
110
93
|
<choice>
|
data/metanorma-iec.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
31
31
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
|
32
32
|
|
33
|
-
spec.add_dependency "metanorma-iso", "~> 2.
|
33
|
+
spec.add_dependency "metanorma-iso", "~> 2.9.0"
|
34
34
|
spec.add_dependency "pubid"
|
35
35
|
|
36
36
|
spec.add_development_dependency "debug"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-iso
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.9.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.9.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pubid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|