metanorma-iec 2.2.0 → 2.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe5f071488c1b489abdf32da76363aaa976af39d6bfb84631225a3d08ad630bd
4
- data.tar.gz: 94c952903d02e5de6934ed33ec9a45caa1fe930025c6391cc94d857c386e6ce5
3
+ metadata.gz: e9bf31b4b7fc2357793b3c07735cae57e6623b0e8564789123a9ef5f39db2851
4
+ data.tar.gz: 1dd5e2d159a8c2fb54abcb79246f68d703359b2560bd1e048edeb761a34179f3
5
5
  SHA512:
6
- metadata.gz: b60c7395b02c317a03675b08f70be8b09b75d19b963aebcbf2355caa0f6ed7b832ede96e628aa3203546c0f27daaa75999e629b4cd89ff4473dc8ddcf34588d3
7
- data.tar.gz: 0c13485be861d7abef84dadce587fbbc1306c2f2a4a95faefbcdd6029905a7e27534d14f1c9b551a1c950d939abbb56a7ccd67d034c8883dcd29bee25a264877
6
+ metadata.gz: f55c6a1aaffbe60e4a9b69b2c2761aabfddf2aa69bab97504fc670fa0d183e3d21ca0f6ae037f5690465ca41352b6befee80422258ea16a3a9a3a12e3fd359a7
7
+ data.tar.gz: 8356d054cd2f97114e1da1fee0b4f3c6f5faca9d7d0377b98eeeae9be9a957b4f908f0eb08f0124ec22fd14fbcabcd76cbeb410ca7ab7c0ab8c800972e3f9ff4
@@ -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="margin-bottom">12pt</xsl:attribute>
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 -->
@@ -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 xsl:use-attribute-sets="fn-num-style">
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>
@@ -4699,7 +4724,10 @@
4699
4724
  </xsl:for-each>
4700
4725
  <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
4726
  <xsl:sort select="@displayorder" data-type="number"/>
4702
- <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[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])]">
4727
+ <!-- commented:
4728
+ .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
4729
+ because 'fn' there is in biblio-tag -->
4730
+ <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
4731
  <!-- copy unique fn -->
4704
4732
  <fn gen_id="{generate-id(.)}">
4705
4733
  <xsl:copy-of select="@*"/>
@@ -5570,7 +5598,7 @@
5570
5598
 
5571
5599
  10
5572
5600
 
5573
- <!-- 10 -->
5601
+ <!-- inherit -->
5574
5602
 
5575
5603
  </xsl:variable>
5576
5604
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -6538,6 +6566,33 @@
6538
6566
  </xsl:choose>
6539
6567
  </xsl:template>
6540
6568
 
6569
+ <xsl:template name="getLang_fromCurrentNode">
6570
+ <xsl:variable name="language_current" select="normalize-space(.//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
6571
+ <xsl:variable name="language">
6572
+ <xsl:choose>
6573
+ <xsl:when test="$language_current != ''">
6574
+ <xsl:value-of select="$language_current"/>
6575
+ </xsl:when>
6576
+ <xsl:otherwise>
6577
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
6578
+ <xsl:choose>
6579
+ <xsl:when test="$language_current_2 != ''">
6580
+ <xsl:value-of select="$language_current_2"/>
6581
+ </xsl:when>
6582
+ <xsl:otherwise>
6583
+ <xsl:value-of select=".//*[local-name()='bibdata']//*[local-name()='language']"/>
6584
+ </xsl:otherwise>
6585
+ </xsl:choose>
6586
+ </xsl:otherwise>
6587
+ </xsl:choose>
6588
+ </xsl:variable>
6589
+
6590
+ <xsl:choose>
6591
+ <xsl:when test="$language = 'English'">en</xsl:when>
6592
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
6593
+ </xsl:choose>
6594
+ </xsl:template>
6595
+
6541
6596
  <xsl:template name="capitalizeWords">
6542
6597
  <xsl:param name="str"/>
6543
6598
  <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
@@ -7158,7 +7213,7 @@
7158
7213
  <xsl:template match="*[local-name() = 'figure']" name="figure">
7159
7214
  <xsl:variable name="isAdded" select="@added"/>
7160
7215
  <xsl:variable name="isDeleted" select="@deleted"/>
7161
- <fo:block-container id="{@id}">
7216
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
7162
7217
 
7163
7218
  <xsl:call-template name="setTrackChangesStyles">
7164
7219
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -8155,7 +8210,13 @@
8155
8210
  </xsl:template>
8156
8211
 
8157
8212
  <xsl:template match="text()" mode="contents_item">
8158
- <xsl:call-template name="keep_together_standard_number"/>
8213
+ <xsl:variable name="text">
8214
+ <!-- to split by '_' and other chars -->
8215
+ <text><xsl:call-template name="add-zero-spaces-java"/></text>
8216
+ </xsl:variable>
8217
+ <xsl:for-each select="xalan:nodeset($text)/text/text()">
8218
+ <xsl:call-template name="keep_together_standard_number"/>
8219
+ </xsl:for-each>
8159
8220
  </xsl:template>
8160
8221
 
8161
8222
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
@@ -8166,36 +8227,54 @@
8166
8227
  <!-- =============== -->
8167
8228
  <!-- sourcecode -->
8168
8229
  <!-- =============== -->
8169
- <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
8170
8230
 
8171
- <xsl:variable name="sourcecode_attributes">
8172
- <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
8173
- <xsl:variable name="_font-size">
8231
+ <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
8232
+ <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
8233
+ <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
8174
8234
 
8175
- 9
8235
+ <xsl:template match="*[local-name() = 'property']" mode="css">
8236
+ <xsl:attribute name="{@name}">
8237
+ <xsl:value-of select="@value"/>
8238
+ </xsl:attribute>
8239
+ </xsl:template>
8176
8240
 
8177
- <!-- 9 -->
8241
+ <xsl:template name="get_sourcecode_attributes">
8242
+ <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
8243
+ <xsl:variable name="_font-size">
8178
8244
 
8179
- <!-- <xsl:if test="$namespace = 'ieee'">
8180
- <xsl:if test="$current_template = 'standard'">8</xsl:if>
8181
- </xsl:if> -->
8245
+ 9
8182
8246
 
8183
- </xsl:variable>
8247
+ <!-- inherit -->
8184
8248
 
8185
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
8186
- <xsl:if test="$font-size != ''">
8187
- <xsl:attribute name="font-size">
8188
- <xsl:choose>
8189
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
8190
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
8191
- <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
8192
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
8193
- </xsl:choose>
8194
- </xsl:attribute>
8195
- </xsl:if>
8196
- </xsl:element>
8249
+ <!-- <xsl:if test="$namespace = 'ieee'">
8250
+ <xsl:if test="$current_template = 'standard'">8</xsl:if>
8251
+ </xsl:if> -->
8252
+
8253
+ </xsl:variable>
8254
+
8255
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
8256
+ <xsl:if test="$font-size != ''">
8257
+ <xsl:attribute name="font-size">
8258
+ <xsl:choose>
8259
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
8260
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
8261
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
8262
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
8263
+ </xsl:choose>
8264
+ </xsl:attribute>
8265
+ </xsl:if>
8266
+ <xsl:apply-templates select="$sourcecode_css//class[@name = 'sourcecode']" mode="css"/>
8267
+ </xsl:element>
8268
+ </xsl:template>
8269
+
8270
+ <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
8271
+
8272
+ <xsl:variable name="sourcecode_attributes">
8273
+ <xsl:call-template name="get_sourcecode_attributes"/>
8197
8274
  </xsl:variable>
8198
8275
 
8276
+ <!-- <xsl:copy-of select="$sourcecode_css"/> -->
8277
+
8199
8278
  <xsl:choose>
8200
8279
  <xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
8201
8280
  <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
@@ -8249,9 +8328,10 @@
8249
8328
  </xsl:choose>
8250
8329
  </xsl:template>
8251
8330
 
8252
- <xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
8331
+ <xsl:template match="*[local-name()='sourcecode']/text() | *[local-name()='sourcecode']//*[local-name()='span']/text()" priority="2">
8253
8332
  <xsl:choose>
8254
- <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
8333
+ <!-- disabled -->
8334
+ <xsl:when test="1 = 2 and normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
8255
8335
  <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
8256
8336
  <xsl:choose>
8257
8337
  <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
@@ -8266,8 +8346,75 @@
8266
8346
  <xsl:call-template name="add_spaces_to_sourcecode"/>
8267
8347
  </xsl:otherwise>
8268
8348
  </xsl:choose>
8349
+ </xsl:template>
8350
+
8351
+ <!-- add sourcecode highlighting -->
8352
+ <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
8353
+ <xsl:variable name="class" select="@class"/>
8354
+ <xsl:choose>
8355
+ <xsl:when test="$sourcecode_css//class[@name = $class]">
8356
+ <fo:inline>
8357
+ <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
8358
+ <xsl:apply-templates/>
8359
+ </fo:inline>
8360
+ </xsl:when>
8361
+ <xsl:otherwise>
8362
+ <xsl:apply-templates/>
8363
+ </xsl:otherwise>
8364
+ </xsl:choose>
8365
+ </xsl:template>
8366
+
8367
+ <!-- outer table with line numbers for sourcecode -->
8368
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
8369
+ <fo:block>
8370
+ <fo:table width="100%" table-layout="fixed">
8371
+ <xsl:copy-of select="@id"/>
8372
+ <fo:table-column column-width="8%"/>
8373
+ <fo:table-column column-width="92%"/>
8374
+ <fo:table-body>
8375
+ <xsl:apply-templates/>
8376
+ </fo:table-body>
8377
+ </fo:table>
8378
+ </fo:block>
8379
+ </xsl:template>
8380
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
8381
+ <xsl:apply-templates/>
8382
+ </xsl:template>
8383
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
8384
+ <fo:table-row>
8385
+ <xsl:apply-templates/>
8386
+ </fo:table-row>
8387
+ </xsl:template>
8388
+ <!-- first td with line numbers -->
8389
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
8390
+ <fo:table-cell>
8391
+ <fo:block>
8392
+
8393
+ <!-- set attibutes for line numbers - same as sourcecode -->
8394
+ <xsl:variable name="sourcecode_attributes">
8395
+ <xsl:for-each select="following-sibling::*[local-name() = 'td']/*[local-name() = 'sourcecode']">
8396
+ <xsl:call-template name="get_sourcecode_attributes"/>
8397
+ </xsl:for-each>
8398
+ </xsl:variable>
8399
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
8400
+ <xsl:attribute name="{local-name()}">
8401
+ <xsl:value-of select="."/>
8402
+ </xsl:attribute>
8403
+ </xsl:for-each>
8269
8404
 
8405
+ <xsl:apply-templates/>
8406
+ </fo:block>
8407
+ </fo:table-cell>
8408
+ </xsl:template>
8409
+ <!-- second td with sourcecode -->
8410
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
8411
+ <fo:table-cell>
8412
+ <fo:block>
8413
+ <xsl:apply-templates/>
8414
+ </fo:block>
8415
+ </fo:table-cell>
8270
8416
  </xsl:template>
8417
+ <!-- END outer table with line numbers for sourcecode -->
8271
8418
 
8272
8419
  <xsl:template name="add_spaces_to_sourcecode">
8273
8420
  <xsl:variable name="text_step1">
@@ -9960,17 +10107,17 @@
9960
10107
  <fo:block>
9961
10108
  <fo:inline>
9962
10109
 
9963
- <xsl:value-of select="*[local-name()='docidentifier'][@type = 'metanorma-ordinal']"/>
9964
- <xsl:if test="not(*[local-name()='docidentifier'][@type = 'metanorma-ordinal'])">
9965
- <xsl:number format="[1]" count="*[local-name()='bibitem'][not(@hidden = 'true')]"/>
9966
- </xsl:if>
9967
-
10110
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
10111
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
10112
+ </xsl:apply-templates>
9968
10113
  </fo:inline>
9969
10114
  </fo:block>
9970
10115
  </fo:list-item-label>
9971
10116
  <fo:list-item-body start-indent="body-start()">
9972
10117
  <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
9973
- <xsl:call-template name="processBibitem"/>
10118
+ <xsl:call-template name="processBibitem">
10119
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
10120
+ </xsl:call-template>
9974
10121
  </fo:block>
9975
10122
  </fo:list-item-body>
9976
10123
  </fo:list-item>
@@ -9979,176 +10126,51 @@
9979
10126
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
9980
10127
 
9981
10128
  <xsl:template name="processBibitem">
10129
+ <xsl:param name="biblio_tag_part">both</xsl:param>
9982
10130
 
9983
10131
  <!-- start bibitem processing -->
9984
10132
  <xsl:if test=".//*[local-name() = 'fn']">
9985
10133
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
9986
10134
  </xsl:if>
9987
10135
 
9988
- <!-- display document identifier, not number [1] -->
9989
- <xsl:variable name="docidentifier">
9990
- <xsl:choose>
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
-
10136
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
10137
+ <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
10138
+ </xsl:apply-templates>
10004
10139
  <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
10005
10140
  <!-- end bibitem processing -->
10006
10141
 
10007
10142
  </xsl:template> <!-- processBibitem (bibitem) -->
10008
10143
 
10009
- <xsl:template name="processBibitemDocId">
10010
- <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
10011
- <xsl:choose>
10012
- <xsl:when test="normalize-space($_doc_ident) != ''">
10013
- <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
10014
- <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
10015
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
10016
- </xsl:if> -->
10017
- <xsl:value-of select="$_doc_ident"/>
10018
- </xsl:when>
10019
- <xsl:otherwise>
10020
- <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
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 -->
10144
+ <xsl:template match="*[local-name() = 'title']" mode="title">
10145
+ <fo:inline><xsl:apply-templates/></fo:inline>
10146
+ </xsl:template>
10147
+
10148
+ <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
10028
10149
 
10029
- <xsl:template name="processPersonalAuthor">
10150
+ <xsl:template match="*[local-name() = 'formattedref']">
10151
+ <!-- <xsl:if test="$namespace = 'unece' or $namespace = 'unece-rec'">
10152
+ <xsl:text>, </xsl:text>
10153
+ </xsl:if> -->
10154
+ <xsl:apply-templates/>
10155
+ </xsl:template>
10156
+
10157
+ <xsl:template match="*[local-name() = 'biblio-tag']">
10158
+ <xsl:param name="biblio_tag_part">both</xsl:param>
10030
10159
  <xsl:choose>
10031
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
10032
- <author>
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>
10160
+ <xsl:when test="$biblio_tag_part = 'first' and *[local-name() = 'tab']">
10161
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
10042
10162
  </xsl:when>
10043
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
10044
- <author>
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>
10163
+ <xsl:when test="$biblio_tag_part = 'last'">
10164
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
10049
10165
  </xsl:when>
10050
10166
  <xsl:otherwise>
10051
10167
  <xsl:apply-templates/>
10052
10168
  </xsl:otherwise>
10053
10169
  </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
- </xsl:template>
10072
-
10073
- <xsl:template match="*[local-name() = 'title']" mode="title">
10074
- <fo:inline><xsl:apply-templates/></fo:inline>
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
10170
  </xsl:template>
10146
10171
 
10147
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
10148
-
10149
- <xsl:template match="*[local-name() = 'formattedref']">
10150
-
10151
- <xsl:apply-templates/>
10172
+ <xsl:template match="*[local-name() = 'biblio-tag']/*[local-name() = 'tab']" priority="2">
10173
+ <xsl:text> </xsl:text>
10152
10174
  </xsl:template>
10153
10175
 
10154
10176
  <!-- ======================= -->
@@ -10576,6 +10598,12 @@
10576
10598
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
10577
10599
  <xsl:apply-templates mode="update_xml_step1"/>
10578
10600
  </xsl:template>
10601
+ <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10602
+ <xsl:copy>
10603
+ <xsl:copy-of select="@*"/>
10604
+ <xsl:apply-templates mode="update_xml_step1"/>
10605
+ </xsl:copy>
10606
+ </xsl:template>
10579
10607
  <!-- =========================================================================== -->
10580
10608
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10581
10609
  <!-- =========================================================================== -->
@@ -11056,6 +11084,10 @@
11056
11084
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
11057
11085
  </xsl:template>
11058
11086
 
11087
+ <xsl:template name="getDocumentId_fromCurrentNode">
11088
+ <xsl:call-template name="getLang_fromCurrentNode"/><xsl:value-of select=".//*[local-name() = 'p'][1]/@id"/>
11089
+ </xsl:template>
11090
+
11059
11091
  <xsl:template name="namespaceCheck">
11060
11092
  <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
11061
11093
  <xsl:variable name="XSLNS">
@@ -26,6 +26,10 @@ module IsoDoc
26
26
  @is_iev = id == "60050"
27
27
  super
28
28
  end
29
+
30
+ def std_docid_semantic(text)
31
+ text
32
+ end
29
33
  end
30
34
  end
31
35
  end
@@ -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) }
@@ -47,7 +47,7 @@
47
47
  </element>
48
48
  </define>
49
49
  <define name="DocumentType">
50
- <value>document</value>
50
+ <text/>
51
51
  </define>
52
52
  <define name="docsubtype">
53
53
  <element name="subdoctype">
@@ -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
- <value>modspec</value>
2666
+ <text/>
2657
2667
  </choice>
2658
2668
  </define>
2659
2669
  <define name="erefTypeWithConnective">
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.2.0".freeze
3
+ VERSION = "2.2.1".freeze
4
4
  end
5
5
  end
6
6
 
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.0
4
+ version: 2.2.1
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-05 00:00:00.000000000 Z
11
+ date: 2022-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso