metanorma-iec 2.2.0 → 2.2.2
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/html/htmlstyle.css +30 -1
- data/lib/isodoc/iec/iec.international-standard.xsl +249 -191
- data/lib/isodoc/iec/init.rb +4 -0
- data/lib/isodoc/iec/word_convert.rb +4 -2
- data/lib/metanorma/iec/biblio-standoc.rng +1 -1
- data/lib/metanorma/iec/isodoc.rng +11 -1
- data/lib/metanorma/iec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bff37d83c4a647ea86d14725b368ce42dcab9d69152343f419ee0c4d2225759
|
4
|
+
data.tar.gz: ccbeec73dc1c28b3d8201dc6fc201f90b050cf0b0c72f8e19e1b9354a6e99906
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f735aafb8c12111182c2fdbbfb6ab4a4a03a044bd03b80fdd33be68fd0174e54028984617eac1c1da112335a7e8d8fe3b16d5eab8d7d07d41501ceb6f26eb6b8
|
7
|
+
data.tar.gz: 65153419c3b4d3a9a0bf055f210dcc1974134d9aa4b330e9b62284b241d4c8be5c47fae952dc3e48837196fe8ea753fd961ae83618e691b2fe778e0ebe9f33f8
|
@@ -131,6 +131,35 @@ a.FootnoteRef + a.FootnoteRef:before {
|
|
131
131
|
color: red;
|
132
132
|
text-decoration: line-through; }
|
133
133
|
|
134
|
+
/* code highlighting with line numbers */
|
135
|
+
table.rouge-line-table td.rouge-gutter {
|
136
|
+
-moz-user-select: none;
|
137
|
+
-ms-user-select: none;
|
138
|
+
-webkit-user-select: none;
|
139
|
+
user-select: none;
|
140
|
+
padding-right: 1em; }
|
141
|
+
|
142
|
+
table.rouge-line-table td.rouge-code {
|
143
|
+
-moz-user-select: all;
|
144
|
+
-ms-user-select: all;
|
145
|
+
-webkit-user-select: all;
|
146
|
+
user-select: all; }
|
147
|
+
|
148
|
+
table.rouge-line-table,
|
149
|
+
table.rouge-line-table th,
|
150
|
+
table.rouge-line-table td {
|
151
|
+
width: auto;
|
152
|
+
border: none;
|
153
|
+
margin: 0;
|
154
|
+
padding: 0;
|
155
|
+
font-size: 100%; }
|
156
|
+
|
157
|
+
table.rouge-line-table pre {
|
158
|
+
margin: 0;
|
159
|
+
padding: 0;
|
160
|
+
overflow-x: visible;
|
161
|
+
font-size: 100%; }
|
162
|
+
|
134
163
|
#standard-band {
|
135
164
|
background-color: #0AC442; }
|
136
165
|
|
@@ -903,7 +932,7 @@ table {
|
|
903
932
|
table th, table td {
|
904
933
|
padding: 1em; }
|
905
934
|
table td.header {
|
906
|
-
font-
|
935
|
+
font-weight: 400; }
|
907
936
|
table td,
|
908
937
|
table th {
|
909
938
|
font-size: 0.95em;
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
<xsl:param name="additionalXMLs" select="''"/> <!-- iec-rice.fr.xml -->
|
6
6
|
|
7
|
-
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
7
|
+
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure' or local-name() = 'localized-strings')] and not(ancestor::*[local-name() = 'name']))]" use="@reference"/>
|
8
8
|
|
9
9
|
<xsl:variable name="additionalXMLsArray">
|
10
10
|
<xsl:call-template name="split">
|
@@ -2802,6 +2802,12 @@
|
|
2802
2802
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
2803
2803
|
</xsl:attribute-set>
|
2804
2804
|
|
2805
|
+
<xsl:attribute-set name="figure-block-style">
|
2806
|
+
|
2807
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
2808
|
+
|
2809
|
+
</xsl:attribute-set>
|
2810
|
+
|
2805
2811
|
<xsl:attribute-set name="figure-style">
|
2806
2812
|
|
2807
2813
|
</xsl:attribute-set>
|
@@ -2811,7 +2817,7 @@
|
|
2811
2817
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
2812
2818
|
<xsl:attribute name="text-align">center</xsl:attribute>
|
2813
2819
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
2814
|
-
<xsl:attribute name="
|
2820
|
+
<xsl:attribute name="space-after">12pt</xsl:attribute>
|
2815
2821
|
<xsl:attribute name="keep-with-previous">always</xsl:attribute>
|
2816
2822
|
|
2817
2823
|
</xsl:attribute-set>
|
@@ -4232,6 +4238,10 @@
|
|
4232
4238
|
<xsl:with-param name="continued">true</xsl:with-param>
|
4233
4239
|
</xsl:apply-templates>
|
4234
4240
|
|
4241
|
+
<xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
|
4242
|
+
<fo:block/>
|
4243
|
+
</xsl:if>
|
4244
|
+
|
4235
4245
|
</fo:table-cell>
|
4236
4246
|
</fo:table-row>
|
4237
4247
|
</xsl:template> <!-- table-header-title -->
|
@@ -4604,7 +4614,7 @@
|
|
4604
4614
|
</fn>
|
4605
4615
|
-->
|
4606
4616
|
<!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
|
4607
|
-
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
4617
|
+
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
|
4608
4618
|
|
4609
4619
|
<!-- list of footnotes to calculate actual footnotes number -->
|
4610
4620
|
<xsl:variable name="p_fn_">
|
@@ -4635,7 +4645,22 @@
|
|
4635
4645
|
|
4636
4646
|
<xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
4637
4647
|
<xsl:variable name="footnote_inline">
|
4638
|
-
<fo:inline
|
4648
|
+
<fo:inline>
|
4649
|
+
|
4650
|
+
<xsl:variable name="fn_styles">
|
4651
|
+
<xsl:choose>
|
4652
|
+
<xsl:when test="ancestor::*[local-name() = 'bibitem']">
|
4653
|
+
<fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
|
4654
|
+
</xsl:when>
|
4655
|
+
<xsl:otherwise>
|
4656
|
+
<fn_styles xsl:use-attribute-sets="fn-num-style"/>
|
4657
|
+
</xsl:otherwise>
|
4658
|
+
</xsl:choose>
|
4659
|
+
</xsl:variable>
|
4660
|
+
|
4661
|
+
<xsl:for-each select="xalan:nodeset($fn_styles)/fn_styles/@*">
|
4662
|
+
<xsl:copy-of select="."/>
|
4663
|
+
</xsl:for-each>
|
4639
4664
|
|
4640
4665
|
<xsl:if test="following-sibling::*[1][local-name() = 'fn']">
|
4641
4666
|
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
@@ -4646,8 +4671,7 @@
|
|
4646
4671
|
</fo:basic-link>
|
4647
4672
|
</fo:inline>
|
4648
4673
|
</xsl:variable>
|
4649
|
-
|
4650
|
-
gen_id=<xsl:value-of select="$gen_id"/> -->
|
4674
|
+
|
4651
4675
|
<xsl:choose>
|
4652
4676
|
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
4653
4677
|
<xsl:copy-of select="$footnote_inline"/>
|
@@ -4699,7 +4723,10 @@
|
|
4699
4723
|
</xsl:for-each>
|
4700
4724
|
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='boilerplate']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
|
4701
4725
|
<xsl:sort select="@displayorder" data-type="number"/>
|
4702
|
-
|
4726
|
+
<!-- commented:
|
4727
|
+
.//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
|
4728
|
+
because 'fn' there is in biblio-tag -->
|
4729
|
+
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
|
4703
4730
|
<!-- copy unique fn -->
|
4704
4731
|
<fn gen_id="{generate-id(.)}">
|
4705
4732
|
<xsl:copy-of select="@*"/>
|
@@ -5570,7 +5597,7 @@
|
|
5570
5597
|
|
5571
5598
|
10
|
5572
5599
|
|
5573
|
-
<!--
|
5600
|
+
<!-- inherit -->
|
5574
5601
|
|
5575
5602
|
</xsl:variable>
|
5576
5603
|
<xsl:variable name="font-size" select="normalize-space($_font-size)"/>
|
@@ -6538,6 +6565,33 @@
|
|
6538
6565
|
</xsl:choose>
|
6539
6566
|
</xsl:template>
|
6540
6567
|
|
6568
|
+
<xsl:template name="getLang_fromCurrentNode">
|
6569
|
+
<xsl:variable name="language_current" select="normalize-space(.//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
6570
|
+
<xsl:variable name="language">
|
6571
|
+
<xsl:choose>
|
6572
|
+
<xsl:when test="$language_current != ''">
|
6573
|
+
<xsl:value-of select="$language_current"/>
|
6574
|
+
</xsl:when>
|
6575
|
+
<xsl:otherwise>
|
6576
|
+
<xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
|
6577
|
+
<xsl:choose>
|
6578
|
+
<xsl:when test="$language_current_2 != ''">
|
6579
|
+
<xsl:value-of select="$language_current_2"/>
|
6580
|
+
</xsl:when>
|
6581
|
+
<xsl:otherwise>
|
6582
|
+
<xsl:value-of select=".//*[local-name()='bibdata']//*[local-name()='language']"/>
|
6583
|
+
</xsl:otherwise>
|
6584
|
+
</xsl:choose>
|
6585
|
+
</xsl:otherwise>
|
6586
|
+
</xsl:choose>
|
6587
|
+
</xsl:variable>
|
6588
|
+
|
6589
|
+
<xsl:choose>
|
6590
|
+
<xsl:when test="$language = 'English'">en</xsl:when>
|
6591
|
+
<xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
|
6592
|
+
</xsl:choose>
|
6593
|
+
</xsl:template>
|
6594
|
+
|
6541
6595
|
<xsl:template name="capitalizeWords">
|
6542
6596
|
<xsl:param name="str"/>
|
6543
6597
|
<xsl:variable name="str2" select="translate($str, '-', ' ')"/>
|
@@ -7158,7 +7212,7 @@
|
|
7158
7212
|
<xsl:template match="*[local-name() = 'figure']" name="figure">
|
7159
7213
|
<xsl:variable name="isAdded" select="@added"/>
|
7160
7214
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
7161
|
-
<fo:block-container id="{@id}">
|
7215
|
+
<fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
|
7162
7216
|
|
7163
7217
|
<xsl:call-template name="setTrackChangesStyles">
|
7164
7218
|
<xsl:with-param name="isAdded" select="$isAdded"/>
|
@@ -7236,7 +7290,9 @@
|
|
7236
7290
|
|
7237
7291
|
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
7238
7292
|
<xsl:if test="number($scale) < 100">
|
7239
|
-
|
7293
|
+
|
7294
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
7295
|
+
|
7240
7296
|
</xsl:if>
|
7241
7297
|
|
7242
7298
|
</xsl:if>
|
@@ -8155,7 +8211,13 @@
|
|
8155
8211
|
</xsl:template>
|
8156
8212
|
|
8157
8213
|
<xsl:template match="text()" mode="contents_item">
|
8158
|
-
<xsl:
|
8214
|
+
<xsl:variable name="text">
|
8215
|
+
<!-- to split by '_' and other chars -->
|
8216
|
+
<text><xsl:call-template name="add-zero-spaces-java"/></text>
|
8217
|
+
</xsl:variable>
|
8218
|
+
<xsl:for-each select="xalan:nodeset($text)/text/text()">
|
8219
|
+
<xsl:call-template name="keep_together_standard_number"/>
|
8220
|
+
</xsl:for-each>
|
8159
8221
|
</xsl:template>
|
8160
8222
|
|
8161
8223
|
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
|
@@ -8166,36 +8228,54 @@
|
|
8166
8228
|
<!-- =============== -->
|
8167
8229
|
<!-- sourcecode -->
|
8168
8230
|
<!-- =============== -->
|
8169
|
-
<xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
8170
8231
|
|
8171
|
-
|
8172
|
-
|
8173
|
-
|
8232
|
+
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
|
8233
|
+
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
|
8234
|
+
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
|
8174
8235
|
|
8175
|
-
|
8236
|
+
<xsl:template match="*[local-name() = 'property']" mode="css">
|
8237
|
+
<xsl:attribute name="{@name}">
|
8238
|
+
<xsl:value-of select="@value"/>
|
8239
|
+
</xsl:attribute>
|
8240
|
+
</xsl:template>
|
8176
8241
|
|
8177
|
-
|
8242
|
+
<xsl:template name="get_sourcecode_attributes">
|
8243
|
+
<xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
|
8244
|
+
<xsl:variable name="_font-size">
|
8178
8245
|
|
8179
|
-
|
8180
|
-
<xsl:if test="$current_template = 'standard'">8</xsl:if>
|
8181
|
-
</xsl:if> -->
|
8246
|
+
9
|
8182
8247
|
|
8183
|
-
|
8248
|
+
<!-- inherit -->
|
8184
8249
|
|
8185
|
-
<xsl:
|
8186
|
-
|
8187
|
-
|
8188
|
-
|
8189
|
-
|
8190
|
-
|
8191
|
-
|
8192
|
-
|
8193
|
-
|
8194
|
-
|
8195
|
-
|
8196
|
-
|
8250
|
+
<!-- <xsl:if test="$namespace = 'ieee'">
|
8251
|
+
<xsl:if test="$current_template = 'standard'">8</xsl:if>
|
8252
|
+
</xsl:if> -->
|
8253
|
+
|
8254
|
+
</xsl:variable>
|
8255
|
+
|
8256
|
+
<xsl:variable name="font-size" select="normalize-space($_font-size)"/>
|
8257
|
+
<xsl:if test="$font-size != ''">
|
8258
|
+
<xsl:attribute name="font-size">
|
8259
|
+
<xsl:choose>
|
8260
|
+
<xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
|
8261
|
+
<xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
|
8262
|
+
<xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
|
8263
|
+
<xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
|
8264
|
+
</xsl:choose>
|
8265
|
+
</xsl:attribute>
|
8266
|
+
</xsl:if>
|
8267
|
+
<xsl:apply-templates select="$sourcecode_css//class[@name = 'sourcecode']" mode="css"/>
|
8268
|
+
</xsl:element>
|
8269
|
+
</xsl:template>
|
8270
|
+
|
8271
|
+
<xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
8272
|
+
|
8273
|
+
<xsl:variable name="sourcecode_attributes">
|
8274
|
+
<xsl:call-template name="get_sourcecode_attributes"/>
|
8197
8275
|
</xsl:variable>
|
8198
8276
|
|
8277
|
+
<!-- <xsl:copy-of select="$sourcecode_css"/> -->
|
8278
|
+
|
8199
8279
|
<xsl:choose>
|
8200
8280
|
<xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
|
8201
8281
|
<xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
|
@@ -8238,6 +8318,12 @@
|
|
8238
8318
|
</xsl:attribute>
|
8239
8319
|
</xsl:for-each>
|
8240
8320
|
|
8321
|
+
<!-- remove margin between rows in the table with sourcecode line numbers -->
|
8322
|
+
<xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
|
8323
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
8324
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
8325
|
+
</xsl:if>
|
8326
|
+
|
8241
8327
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
8242
8328
|
</fo:block>
|
8243
8329
|
|
@@ -8249,9 +8335,10 @@
|
|
8249
8335
|
</xsl:choose>
|
8250
8336
|
</xsl:template>
|
8251
8337
|
|
8252
|
-
<xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
8338
|
+
<xsl:template match="*[local-name()='sourcecode']/text() | *[local-name()='sourcecode']//*[local-name()='span']/text()" priority="2">
|
8253
8339
|
<xsl:choose>
|
8254
|
-
|
8340
|
+
<!-- disabled -->
|
8341
|
+
<xsl:when test="1 = 2 and normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
|
8255
8342
|
<xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
|
8256
8343
|
<xsl:choose>
|
8257
8344
|
<xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
|
@@ -8266,8 +8353,76 @@
|
|
8266
8353
|
<xsl:call-template name="add_spaces_to_sourcecode"/>
|
8267
8354
|
</xsl:otherwise>
|
8268
8355
|
</xsl:choose>
|
8356
|
+
</xsl:template>
|
8357
|
+
|
8358
|
+
<!-- add sourcecode highlighting -->
|
8359
|
+
<xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
|
8360
|
+
<xsl:variable name="class" select="@class"/>
|
8361
|
+
<xsl:choose>
|
8362
|
+
<xsl:when test="$sourcecode_css//class[@name = $class]">
|
8363
|
+
<fo:inline>
|
8364
|
+
<xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
|
8365
|
+
<xsl:apply-templates/>
|
8366
|
+
</fo:inline>
|
8367
|
+
</xsl:when>
|
8368
|
+
<xsl:otherwise>
|
8369
|
+
<xsl:apply-templates/>
|
8370
|
+
</xsl:otherwise>
|
8371
|
+
</xsl:choose>
|
8372
|
+
</xsl:template>
|
8373
|
+
|
8374
|
+
<!-- outer table with line numbers for sourcecode -->
|
8375
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
|
8376
|
+
<fo:block>
|
8377
|
+
<fo:table width="100%" table-layout="fixed">
|
8378
|
+
<xsl:copy-of select="@id"/>
|
8379
|
+
<fo:table-column column-width="8%"/>
|
8380
|
+
<fo:table-column column-width="92%"/>
|
8381
|
+
<fo:table-body>
|
8382
|
+
<xsl:apply-templates/>
|
8383
|
+
</fo:table-body>
|
8384
|
+
</fo:table>
|
8385
|
+
</fo:block>
|
8386
|
+
</xsl:template>
|
8387
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
|
8388
|
+
<xsl:apply-templates/>
|
8389
|
+
</xsl:template>
|
8390
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
|
8391
|
+
<fo:table-row>
|
8392
|
+
<xsl:apply-templates/>
|
8393
|
+
</fo:table-row>
|
8394
|
+
</xsl:template>
|
8395
|
+
<!-- first td with line numbers -->
|
8396
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
|
8397
|
+
<fo:table-cell>
|
8398
|
+
<fo:block>
|
8399
|
+
|
8400
|
+
<!-- set attibutes for line numbers - same as sourcecode -->
|
8401
|
+
<xsl:variable name="sourcecode_attributes">
|
8402
|
+
<xsl:for-each select="following-sibling::*[local-name() = 'td']/*[local-name() = 'sourcecode']">
|
8403
|
+
<xsl:call-template name="get_sourcecode_attributes"/>
|
8404
|
+
</xsl:for-each>
|
8405
|
+
</xsl:variable>
|
8406
|
+
<xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
|
8407
|
+
<xsl:attribute name="{local-name()}">
|
8408
|
+
<xsl:value-of select="."/>
|
8409
|
+
</xsl:attribute>
|
8410
|
+
</xsl:for-each>
|
8411
|
+
|
8412
|
+
<xsl:apply-templates/>
|
8413
|
+
</fo:block>
|
8414
|
+
</fo:table-cell>
|
8415
|
+
</xsl:template>
|
8269
8416
|
|
8417
|
+
<!-- second td with sourcecode -->
|
8418
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
|
8419
|
+
<fo:table-cell>
|
8420
|
+
<fo:block>
|
8421
|
+
<xsl:apply-templates/>
|
8422
|
+
</fo:block>
|
8423
|
+
</fo:table-cell>
|
8270
8424
|
</xsl:template>
|
8425
|
+
<!-- END outer table with line numbers for sourcecode -->
|
8271
8426
|
|
8272
8427
|
<xsl:template name="add_spaces_to_sourcecode">
|
8273
8428
|
<xsl:variable name="text_step1">
|
@@ -8498,7 +8653,25 @@
|
|
8498
8653
|
<xsl:template match="*[local-name()='pre']" name="pre">
|
8499
8654
|
<fo:block xsl:use-attribute-sets="pre-style">
|
8500
8655
|
<xsl:copy-of select="@id"/>
|
8501
|
-
<xsl:
|
8656
|
+
<xsl:choose>
|
8657
|
+
|
8658
|
+
<xsl:when test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name()='td'][1][not(preceding-sibling::*)]"> <!-- pre in the first td in the table with @linenums = 'true' -->
|
8659
|
+
<xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
|
8660
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
8661
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
8662
|
+
</xsl:if>
|
8663
|
+
<fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
|
8664
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
8665
|
+
<mtext><xsl:value-of select="."/></mtext>
|
8666
|
+
</math>
|
8667
|
+
</fo:instream-foreign-object>
|
8668
|
+
</xsl:when>
|
8669
|
+
|
8670
|
+
<xsl:otherwise>
|
8671
|
+
<xsl:apply-templates/>
|
8672
|
+
</xsl:otherwise>
|
8673
|
+
|
8674
|
+
</xsl:choose>
|
8502
8675
|
</fo:block>
|
8503
8676
|
</xsl:template>
|
8504
8677
|
<!-- =============== -->
|
@@ -9960,17 +10133,17 @@
|
|
9960
10133
|
<fo:block>
|
9961
10134
|
<fo:inline>
|
9962
10135
|
|
9963
|
-
|
9964
|
-
|
9965
|
-
|
9966
|
-
</xsl:if>
|
9967
|
-
|
10136
|
+
<xsl:apply-templates select="*[local-name() = 'biblio-tag']">
|
10137
|
+
<xsl:with-param name="biblio_tag_part">first</xsl:with-param>
|
10138
|
+
</xsl:apply-templates>
|
9968
10139
|
</fo:inline>
|
9969
10140
|
</fo:block>
|
9970
10141
|
</fo:list-item-label>
|
9971
10142
|
<fo:list-item-body start-indent="body-start()">
|
9972
10143
|
<fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
|
9973
|
-
<xsl:call-template name="processBibitem"
|
10144
|
+
<xsl:call-template name="processBibitem">
|
10145
|
+
<xsl:with-param name="biblio_tag_part">last</xsl:with-param>
|
10146
|
+
</xsl:call-template>
|
9974
10147
|
</fo:block>
|
9975
10148
|
</fo:list-item-body>
|
9976
10149
|
</fo:list-item>
|
@@ -9979,176 +10152,51 @@
|
|
9979
10152
|
</xsl:template> <!-- references[not(@normative='true')]/bibitem -->
|
9980
10153
|
|
9981
10154
|
<xsl:template name="processBibitem">
|
10155
|
+
<xsl:param name="biblio_tag_part">both</xsl:param>
|
9982
10156
|
|
9983
10157
|
<!-- start bibitem processing -->
|
9984
10158
|
<xsl:if test=".//*[local-name() = 'fn']">
|
9985
10159
|
<xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
|
9986
10160
|
</xsl:if>
|
9987
10161
|
|
9988
|
-
|
9989
|
-
|
9990
|
-
|
9991
|
-
<xsl:when test="*[local-name() = 'docidentifier']/@type = 'metanorma'"/>
|
9992
|
-
<xsl:otherwise><xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma-ordinal')]"/></xsl:otherwise>
|
9993
|
-
</xsl:choose>
|
9994
|
-
</xsl:variable>
|
9995
|
-
<xsl:value-of select="$docidentifier"/>
|
9996
|
-
|
9997
|
-
<xsl:apply-templates select="*[local-name() = 'note']"/>
|
9998
|
-
|
9999
|
-
<xsl:if test="normalize-space($docidentifier) != '' and *[local-name() = 'formattedref']">
|
10000
|
-
<xsl:text>,</xsl:text>
|
10001
|
-
<xsl:text> </xsl:text>
|
10002
|
-
</xsl:if>
|
10003
|
-
|
10162
|
+
<xsl:apply-templates select="*[local-name() = 'biblio-tag']">
|
10163
|
+
<xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
|
10164
|
+
</xsl:apply-templates>
|
10004
10165
|
<xsl:apply-templates select="*[local-name() = 'formattedref']"/>
|
10005
10166
|
<!-- end bibitem processing -->
|
10006
10167
|
|
10007
10168
|
</xsl:template> <!-- processBibitem (bibitem) -->
|
10008
10169
|
|
10009
|
-
<xsl:template name="
|
10010
|
-
<xsl:
|
10011
|
-
|
10012
|
-
|
10013
|
-
|
10014
|
-
|
10015
|
-
|
10016
|
-
|
10017
|
-
|
10018
|
-
|
10019
|
-
|
10020
|
-
|
10021
|
-
<xsl:if test="$type != ''">
|
10022
|
-
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
10023
|
-
</xsl:if> -->
|
10024
|
-
<xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
|
10025
|
-
</xsl:otherwise>
|
10026
|
-
</xsl:choose>
|
10027
|
-
</xsl:template> <!-- processBibitemDocId -->
|
10170
|
+
<xsl:template match="*[local-name() = 'title']" mode="title">
|
10171
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
10172
|
+
</xsl:template>
|
10173
|
+
|
10174
|
+
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
|
10175
|
+
|
10176
|
+
<xsl:template match="*[local-name() = 'formattedref']">
|
10177
|
+
<!-- <xsl:if test="$namespace = 'unece' or $namespace = 'unece-rec'">
|
10178
|
+
<xsl:text>, </xsl:text>
|
10179
|
+
</xsl:if> -->
|
10180
|
+
<xsl:apply-templates/>
|
10181
|
+
</xsl:template>
|
10028
10182
|
|
10029
|
-
<xsl:template name="
|
10183
|
+
<xsl:template match="*[local-name() = 'biblio-tag']">
|
10184
|
+
<xsl:param name="biblio_tag_part">both</xsl:param>
|
10030
10185
|
<xsl:choose>
|
10031
|
-
<xsl:when test="
|
10032
|
-
<
|
10033
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
|
10034
|
-
</author>
|
10035
|
-
</xsl:when>
|
10036
|
-
<xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
|
10037
|
-
<author>
|
10038
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
|
10039
|
-
<xsl:text> </xsl:text>
|
10040
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
|
10041
|
-
</author>
|
10186
|
+
<xsl:when test="$biblio_tag_part = 'first' and *[local-name() = 'tab']">
|
10187
|
+
<xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
10042
10188
|
</xsl:when>
|
10043
|
-
<xsl:when test="
|
10044
|
-
<
|
10045
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
|
10046
|
-
<xsl:text> </xsl:text>
|
10047
|
-
<xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
|
10048
|
-
</author>
|
10189
|
+
<xsl:when test="$biblio_tag_part = 'last'">
|
10190
|
+
<xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
|
10049
10191
|
</xsl:when>
|
10050
10192
|
<xsl:otherwise>
|
10051
10193
|
<xsl:apply-templates/>
|
10052
10194
|
</xsl:otherwise>
|
10053
10195
|
</xsl:choose>
|
10054
|
-
</xsl:template> <!-- processPersonalAuthor -->
|
10055
|
-
|
10056
|
-
<xsl:template name="renderDate">
|
10057
|
-
<xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
|
10058
|
-
<xsl:value-of select="*[local-name() = 'on']"/>
|
10059
|
-
</xsl:if>
|
10060
|
-
<xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
|
10061
|
-
<xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
|
10062
|
-
</xsl:if>
|
10063
|
-
</xsl:template>
|
10064
|
-
|
10065
|
-
<xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
|
10066
|
-
<xsl:value-of select="translate(.,'. ','')"/>
|
10067
|
-
</xsl:template>
|
10068
|
-
|
10069
|
-
<xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
|
10070
|
-
<xsl:value-of select="substring(.,1,1)"/>
|
10071
10196
|
</xsl:template>
|
10072
10197
|
|
10073
|
-
<xsl:template match="*[local-name() = '
|
10074
|
-
<
|
10075
|
-
</xsl:template>
|
10076
|
-
|
10077
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
|
10078
|
-
<!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
|
10079
|
-
<fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
|
10080
|
-
<xsl:apply-templates/>
|
10081
|
-
</fo:inline>
|
10082
|
-
</xsl:template>
|
10083
|
-
|
10084
|
-
<!-- bibitem/note renders as footnote -->
|
10085
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
|
10086
|
-
|
10087
|
-
<!-- list of footnotes to calculate actual footnotes number -->
|
10088
|
-
<xsl:variable name="p_fn_">
|
10089
|
-
<xsl:call-template name="get_fn_list"/>
|
10090
|
-
</xsl:variable>
|
10091
|
-
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
10092
|
-
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
10093
|
-
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
10094
|
-
<!-- fn sequence number in document -->
|
10095
|
-
<xsl:variable name="current_fn_number">
|
10096
|
-
<xsl:choose>
|
10097
|
-
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
10098
|
-
<xsl:otherwise>
|
10099
|
-
<!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
|
10100
|
-
<xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
|
10101
|
-
</xsl:otherwise>
|
10102
|
-
</xsl:choose>
|
10103
|
-
</xsl:variable>
|
10104
|
-
<fo:footnote>
|
10105
|
-
<xsl:variable name="number">
|
10106
|
-
|
10107
|
-
<xsl:value-of select="$current_fn_number"/>
|
10108
|
-
|
10109
|
-
</xsl:variable>
|
10110
|
-
|
10111
|
-
<xsl:variable name="current_fn_number_text">
|
10112
|
-
<xsl:value-of select="$number"/>
|
10113
|
-
|
10114
|
-
</xsl:variable>
|
10115
|
-
|
10116
|
-
<fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
|
10117
|
-
<fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
|
10118
|
-
<xsl:value-of select="$current_fn_number_text"/>
|
10119
|
-
</fo:basic-link>
|
10120
|
-
</fo:inline>
|
10121
|
-
<fo:footnote-body>
|
10122
|
-
<fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
|
10123
|
-
<fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
|
10124
|
-
<xsl:value-of select="$current_fn_number_text"/>
|
10125
|
-
</fo:inline>
|
10126
|
-
<xsl:apply-templates/>
|
10127
|
-
</fo:block>
|
10128
|
-
</fo:footnote-body>
|
10129
|
-
</fo:footnote>
|
10130
|
-
</xsl:template>
|
10131
|
-
|
10132
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
|
10133
|
-
<xsl:text> edition </xsl:text>
|
10134
|
-
<xsl:value-of select="."/>
|
10135
|
-
</xsl:template>
|
10136
|
-
|
10137
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
|
10138
|
-
<xsl:text> (</xsl:text>
|
10139
|
-
<fo:inline xsl:use-attribute-sets="link-style">
|
10140
|
-
<fo:basic-link external-destination="." fox:alt-text=".">
|
10141
|
-
<xsl:value-of select="."/>
|
10142
|
-
</fo:basic-link>
|
10143
|
-
</fo:inline>
|
10144
|
-
<xsl:text>)</xsl:text>
|
10145
|
-
</xsl:template>
|
10146
|
-
|
10147
|
-
<xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
|
10148
|
-
|
10149
|
-
<xsl:template match="*[local-name() = 'formattedref']">
|
10150
|
-
|
10151
|
-
<xsl:apply-templates/>
|
10198
|
+
<xsl:template match="*[local-name() = 'biblio-tag']/*[local-name() = 'tab']" priority="2">
|
10199
|
+
<xsl:text> </xsl:text>
|
10152
10200
|
</xsl:template>
|
10153
10201
|
|
10154
10202
|
<!-- ======================= -->
|
@@ -10576,6 +10624,12 @@
|
|
10576
10624
|
<xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
|
10577
10625
|
<xsl:apply-templates mode="update_xml_step1"/>
|
10578
10626
|
</xsl:template>
|
10627
|
+
<xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
|
10628
|
+
<xsl:copy>
|
10629
|
+
<xsl:copy-of select="@*"/>
|
10630
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
10631
|
+
</xsl:copy>
|
10632
|
+
</xsl:template>
|
10579
10633
|
<!-- =========================================================================== -->
|
10580
10634
|
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
|
10581
10635
|
<!-- =========================================================================== -->
|
@@ -11056,6 +11110,10 @@
|
|
11056
11110
|
<xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
|
11057
11111
|
</xsl:template>
|
11058
11112
|
|
11113
|
+
<xsl:template name="getDocumentId_fromCurrentNode">
|
11114
|
+
<xsl:call-template name="getLang_fromCurrentNode"/><xsl:value-of select=".//*[local-name() = 'p'][1]/@id"/>
|
11115
|
+
</xsl:template>
|
11116
|
+
|
11059
11117
|
<xsl:template name="namespaceCheck">
|
11060
11118
|
<xsl:variable name="documentNS" select="namespace-uri(/*)"/>
|
11061
11119
|
<xsl:variable name="XSLNS">
|
data/lib/isodoc/iec/init.rb
CHANGED
@@ -83,7 +83,7 @@ module IsoDoc
|
|
83
83
|
super
|
84
84
|
end
|
85
85
|
|
86
|
-
def make_tr_attr(cell, row, totalrows, header)
|
86
|
+
def make_tr_attr(cell, row, totalrows, header, bordered)
|
87
87
|
ret = super
|
88
88
|
css_class =
|
89
89
|
cell.name == "th" || header ? "TABLE-col-heading" : "TABLE-cell"
|
@@ -91,9 +91,11 @@ module IsoDoc
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def tr_parse(node, out, ord, totalrows, header)
|
94
|
+
c = node.parent.parent["class"]
|
95
|
+
bordered = %w(modspec).include?(c) || !c
|
94
96
|
out.tr do |r|
|
95
97
|
node.elements.each do |td|
|
96
|
-
attrs = make_tr_attr(td, ord, totalrows - 1, header)
|
98
|
+
attrs = make_tr_attr(td, ord, totalrows - 1, header, bordered)
|
97
99
|
attrs[:class] = "TABLE-col-heading" if header
|
98
100
|
r.send td.name, **attr_code(attrs) do |entry|
|
99
101
|
td.children.each { |n| parse(n, entry) }
|
@@ -571,6 +571,11 @@
|
|
571
571
|
<ref name="MultilingualRenderingType"/>
|
572
572
|
</attribute>
|
573
573
|
</optional>
|
574
|
+
<optional>
|
575
|
+
<attribute name="linenums">
|
576
|
+
<data type="boolean"/>
|
577
|
+
</attribute>
|
578
|
+
</optional>
|
574
579
|
<optional>
|
575
580
|
<ref name="tname"/>
|
576
581
|
</optional>
|
@@ -1238,6 +1243,11 @@
|
|
1238
1243
|
</define>
|
1239
1244
|
<define name="concept">
|
1240
1245
|
<element name="concept">
|
1246
|
+
<optional>
|
1247
|
+
<attribute name="bold">
|
1248
|
+
<data type="boolean"/>
|
1249
|
+
</attribute>
|
1250
|
+
</optional>
|
1241
1251
|
<optional>
|
1242
1252
|
<attribute name="ital">
|
1243
1253
|
<data type="boolean"/>
|
@@ -2653,7 +2663,7 @@
|
|
2653
2663
|
<value>full</value>
|
2654
2664
|
<value>short</value>
|
2655
2665
|
<value>id</value>
|
2656
|
-
<
|
2666
|
+
<text/>
|
2657
2667
|
</choice>
|
2658
2668
|
</define>
|
2659
2669
|
<define name="erefTypeWithConnective">
|
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.2.
|
4
|
+
version: 2.2.2
|
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-12-
|
11
|
+
date: 2022-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-iso
|