metanorma-cc 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b5b027d48021b7071f3e61fa85371fc3d2afb2db750b461001ae8f4d2c16606
4
- data.tar.gz: f12d7befa0dc6583c25bf35372df0d2f2fe0e6caeabbd152fd95454ba2307307
3
+ metadata.gz: 7711b9675bcfab88ba0624be6f88f5ac5262e06b1f31b18a676ab370f9f83736
4
+ data.tar.gz: 1af7111b2d6341c4264d8a8e639b538036ea98bd8d1ee909740101adad8c8d4f
5
5
  SHA512:
6
- metadata.gz: 605251c6eb61d7ec93b0bfb533b0d2211c4a6207228d2d2325e4f41be6c88c50cb1424285a1f7eefd95b87763e05178146db278f3e1287cc5b1239ef3a99222a
7
- data.tar.gz: 78258e44feebed56e7dbcd5326950225f3e0c0b4e92583895182f7e82699611c4955d914ae60fad0b2176ad908f0f04858679b20cee61a6452cec4f310226b3f
6
+ metadata.gz: dcb84e476aa6a99ab5575246b9ac9a3770476c737dadc098db6450a3f97df8168a0f9a28b70283a274d2534d6b84e77b6d7d2ed3d38c81401c558ca3cc93daef
7
+ data.tar.gz: bae80bf550876a114d6c48e170e115dbd6f340dc60c7a0227c0e81115bae9542808bf17966d8d630e69afd9457821061626d9c1489afd027e457ee4c23cf0f44
@@ -1347,6 +1347,12 @@
1347
1347
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1348
1348
  </xsl:attribute-set>
1349
1349
 
1350
+ <xsl:attribute-set name="figure-block-style">
1351
+
1352
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1353
+
1354
+ </xsl:attribute-set>
1355
+
1350
1356
  <xsl:attribute-set name="figure-style">
1351
1357
 
1352
1358
  </xsl:attribute-set>
@@ -1356,7 +1362,7 @@
1356
1362
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1357
1363
  <xsl:attribute name="text-align">center</xsl:attribute>
1358
1364
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1359
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1365
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
1360
1366
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1361
1367
 
1362
1368
  </xsl:attribute-set>
@@ -2739,6 +2745,10 @@
2739
2745
  <xsl:with-param name="continued">true</xsl:with-param>
2740
2746
  </xsl:apply-templates>
2741
2747
 
2748
+ <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
2749
+ <fo:block/>
2750
+ </xsl:if>
2751
+
2742
2752
  </fo:table-cell>
2743
2753
  </fo:table-row>
2744
2754
  </xsl:template> <!-- table-header-title -->
@@ -3123,7 +3133,22 @@
3123
3133
 
3124
3134
  <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3125
3135
  <xsl:variable name="footnote_inline">
3126
- <fo:inline xsl:use-attribute-sets="fn-num-style">
3136
+ <fo:inline>
3137
+
3138
+ <xsl:variable name="fn_styles">
3139
+ <xsl:choose>
3140
+ <xsl:when test="ancestor::*[local-name() = 'bibitem']">
3141
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
3142
+ </xsl:when>
3143
+ <xsl:otherwise>
3144
+ <fn_styles xsl:use-attribute-sets="fn-num-style"/>
3145
+ </xsl:otherwise>
3146
+ </xsl:choose>
3147
+ </xsl:variable>
3148
+
3149
+ <xsl:for-each select="xalan:nodeset($fn_styles)/fn_styles/@*">
3150
+ <xsl:copy-of select="."/>
3151
+ </xsl:for-each>
3127
3152
 
3128
3153
  <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
3129
3154
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
@@ -3187,7 +3212,10 @@
3187
3212
  </xsl:for-each>
3188
3213
  <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']/*">
3189
3214
  <xsl:sort select="@displayorder" data-type="number"/>
3190
- <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])]">
3215
+ <!-- commented:
3216
+ .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
3217
+ because 'fn' there is in biblio-tag -->
3218
+ <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])]">
3191
3219
  <!-- copy unique fn -->
3192
3220
  <fn gen_id="{generate-id(.)}">
3193
3221
  <xsl:copy-of select="@*"/>
@@ -4039,7 +4067,7 @@
4039
4067
  10
4040
4068
 
4041
4069
 
4042
- <!-- 10 -->
4070
+ <!-- inherit -->
4043
4071
 
4044
4072
  </xsl:variable>
4045
4073
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -5007,6 +5035,33 @@
5007
5035
  </xsl:choose>
5008
5036
  </xsl:template>
5009
5037
 
5038
+ <xsl:template name="getLang_fromCurrentNode">
5039
+ <xsl:variable name="language_current" select="normalize-space(.//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5040
+ <xsl:variable name="language">
5041
+ <xsl:choose>
5042
+ <xsl:when test="$language_current != ''">
5043
+ <xsl:value-of select="$language_current"/>
5044
+ </xsl:when>
5045
+ <xsl:otherwise>
5046
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5047
+ <xsl:choose>
5048
+ <xsl:when test="$language_current_2 != ''">
5049
+ <xsl:value-of select="$language_current_2"/>
5050
+ </xsl:when>
5051
+ <xsl:otherwise>
5052
+ <xsl:value-of select=".//*[local-name()='bibdata']//*[local-name()='language']"/>
5053
+ </xsl:otherwise>
5054
+ </xsl:choose>
5055
+ </xsl:otherwise>
5056
+ </xsl:choose>
5057
+ </xsl:variable>
5058
+
5059
+ <xsl:choose>
5060
+ <xsl:when test="$language = 'English'">en</xsl:when>
5061
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
5062
+ </xsl:choose>
5063
+ </xsl:template>
5064
+
5010
5065
  <xsl:template name="capitalizeWords">
5011
5066
  <xsl:param name="str"/>
5012
5067
  <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
@@ -5621,7 +5676,7 @@
5621
5676
  <xsl:template match="*[local-name() = 'figure']" name="figure">
5622
5677
  <xsl:variable name="isAdded" select="@added"/>
5623
5678
  <xsl:variable name="isDeleted" select="@deleted"/>
5624
- <fo:block-container id="{@id}">
5679
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
5625
5680
 
5626
5681
  <xsl:call-template name="setTrackChangesStyles">
5627
5682
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -6607,7 +6662,13 @@
6607
6662
  </xsl:template>
6608
6663
 
6609
6664
  <xsl:template match="text()" mode="contents_item">
6610
- <xsl:call-template name="keep_together_standard_number"/>
6665
+ <xsl:variable name="text">
6666
+ <!-- to split by '_' and other chars -->
6667
+ <text><xsl:call-template name="add-zero-spaces-java"/></text>
6668
+ </xsl:variable>
6669
+ <xsl:for-each select="xalan:nodeset($text)/text/text()">
6670
+ <xsl:call-template name="keep_together_standard_number"/>
6671
+ </xsl:for-each>
6611
6672
  </xsl:template>
6612
6673
 
6613
6674
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
@@ -6618,37 +6679,55 @@
6618
6679
  <!-- =============== -->
6619
6680
  <!-- sourcecode -->
6620
6681
  <!-- =============== -->
6621
- <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
6622
6682
 
6623
- <xsl:variable name="sourcecode_attributes">
6624
- <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
6625
- <xsl:variable name="_font-size">
6683
+ <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
6684
+ <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
6685
+ <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
6626
6686
 
6627
- 10
6687
+ <xsl:template match="*[local-name() = 'property']" mode="css">
6688
+ <xsl:attribute name="{@name}">
6689
+ <xsl:value-of select="@value"/>
6690
+ </xsl:attribute>
6691
+ </xsl:template>
6628
6692
 
6693
+ <xsl:template name="get_sourcecode_attributes">
6694
+ <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
6695
+ <xsl:variable name="_font-size">
6629
6696
 
6630
- <!-- 9 -->
6697
+ 10
6631
6698
 
6632
- <!-- <xsl:if test="$namespace = 'ieee'">
6633
- <xsl:if test="$current_template = 'standard'">8</xsl:if>
6634
- </xsl:if> -->
6635
6699
 
6636
- </xsl:variable>
6700
+ <!-- inherit -->
6637
6701
 
6638
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
6639
- <xsl:if test="$font-size != ''">
6640
- <xsl:attribute name="font-size">
6641
- <xsl:choose>
6642
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
6643
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
6644
- <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
6645
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
6646
- </xsl:choose>
6647
- </xsl:attribute>
6648
- </xsl:if>
6649
- </xsl:element>
6702
+ <!-- <xsl:if test="$namespace = 'ieee'">
6703
+ <xsl:if test="$current_template = 'standard'">8</xsl:if>
6704
+ </xsl:if> -->
6705
+
6706
+ </xsl:variable>
6707
+
6708
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
6709
+ <xsl:if test="$font-size != ''">
6710
+ <xsl:attribute name="font-size">
6711
+ <xsl:choose>
6712
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
6713
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
6714
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
6715
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
6716
+ </xsl:choose>
6717
+ </xsl:attribute>
6718
+ </xsl:if>
6719
+ <xsl:apply-templates select="$sourcecode_css//class[@name = 'sourcecode']" mode="css"/>
6720
+ </xsl:element>
6721
+ </xsl:template>
6722
+
6723
+ <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
6724
+
6725
+ <xsl:variable name="sourcecode_attributes">
6726
+ <xsl:call-template name="get_sourcecode_attributes"/>
6650
6727
  </xsl:variable>
6651
6728
 
6729
+ <!-- <xsl:copy-of select="$sourcecode_css"/> -->
6730
+
6652
6731
  <xsl:choose>
6653
6732
  <xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
6654
6733
  <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
@@ -6702,9 +6781,10 @@
6702
6781
  </xsl:choose>
6703
6782
  </xsl:template>
6704
6783
 
6705
- <xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
6784
+ <xsl:template match="*[local-name()='sourcecode']/text() | *[local-name()='sourcecode']//*[local-name()='span']/text()" priority="2">
6706
6785
  <xsl:choose>
6707
- <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
6786
+ <!-- disabled -->
6787
+ <xsl:when test="1 = 2 and normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
6708
6788
  <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
6709
6789
  <xsl:choose>
6710
6790
  <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
@@ -6719,8 +6799,75 @@
6719
6799
  <xsl:call-template name="add_spaces_to_sourcecode"/>
6720
6800
  </xsl:otherwise>
6721
6801
  </xsl:choose>
6802
+ </xsl:template>
6722
6803
 
6804
+ <!-- add sourcecode highlighting -->
6805
+ <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
6806
+ <xsl:variable name="class" select="@class"/>
6807
+ <xsl:choose>
6808
+ <xsl:when test="$sourcecode_css//class[@name = $class]">
6809
+ <fo:inline>
6810
+ <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
6811
+ <xsl:apply-templates/>
6812
+ </fo:inline>
6813
+ </xsl:when>
6814
+ <xsl:otherwise>
6815
+ <xsl:apply-templates/>
6816
+ </xsl:otherwise>
6817
+ </xsl:choose>
6818
+ </xsl:template>
6819
+
6820
+ <!-- outer table with line numbers for sourcecode -->
6821
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
6822
+ <fo:block>
6823
+ <fo:table width="100%" table-layout="fixed">
6824
+ <xsl:copy-of select="@id"/>
6825
+ <fo:table-column column-width="8%"/>
6826
+ <fo:table-column column-width="92%"/>
6827
+ <fo:table-body>
6828
+ <xsl:apply-templates/>
6829
+ </fo:table-body>
6830
+ </fo:table>
6831
+ </fo:block>
6832
+ </xsl:template>
6833
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
6834
+ <xsl:apply-templates/>
6835
+ </xsl:template>
6836
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
6837
+ <fo:table-row>
6838
+ <xsl:apply-templates/>
6839
+ </fo:table-row>
6840
+ </xsl:template>
6841
+ <!-- first td with line numbers -->
6842
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
6843
+ <fo:table-cell>
6844
+ <fo:block>
6845
+
6846
+ <!-- set attibutes for line numbers - same as sourcecode -->
6847
+ <xsl:variable name="sourcecode_attributes">
6848
+ <xsl:for-each select="following-sibling::*[local-name() = 'td']/*[local-name() = 'sourcecode']">
6849
+ <xsl:call-template name="get_sourcecode_attributes"/>
6850
+ </xsl:for-each>
6851
+ </xsl:variable>
6852
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
6853
+ <xsl:attribute name="{local-name()}">
6854
+ <xsl:value-of select="."/>
6855
+ </xsl:attribute>
6856
+ </xsl:for-each>
6857
+
6858
+ <xsl:apply-templates/>
6859
+ </fo:block>
6860
+ </fo:table-cell>
6861
+ </xsl:template>
6862
+ <!-- second td with sourcecode -->
6863
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
6864
+ <fo:table-cell>
6865
+ <fo:block>
6866
+ <xsl:apply-templates/>
6867
+ </fo:block>
6868
+ </fo:table-cell>
6723
6869
  </xsl:template>
6870
+ <!-- END outer table with line numbers for sourcecode -->
6724
6871
 
6725
6872
  <xsl:template name="add_spaces_to_sourcecode">
6726
6873
  <xsl:variable name="text_step1">
@@ -8405,17 +8552,17 @@
8405
8552
  <fo:block>
8406
8553
  <fo:inline>
8407
8554
 
8408
- <xsl:value-of select="*[local-name()='docidentifier'][@type = 'metanorma-ordinal']"/>
8409
- <xsl:if test="not(*[local-name()='docidentifier'][@type = 'metanorma-ordinal'])">
8410
- <xsl:number format="[1]" count="*[local-name()='bibitem'][not(@hidden = 'true')]"/>
8411
- </xsl:if>
8412
-
8555
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
8556
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
8557
+ </xsl:apply-templates>
8413
8558
  </fo:inline>
8414
8559
  </fo:block>
8415
8560
  </fo:list-item-label>
8416
8561
  <fo:list-item-body start-indent="body-start()">
8417
8562
  <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
8418
- <xsl:call-template name="processBibitem"/>
8563
+ <xsl:call-template name="processBibitem">
8564
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
8565
+ </xsl:call-template>
8419
8566
  </fo:block>
8420
8567
  </fo:list-item-body>
8421
8568
  </fo:list-item>
@@ -8424,183 +8571,51 @@
8424
8571
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
8425
8572
 
8426
8573
  <xsl:template name="processBibitem">
8574
+ <xsl:param name="biblio_tag_part">both</xsl:param>
8427
8575
 
8428
8576
  <!-- start bibitem processing -->
8429
8577
  <xsl:if test=".//*[local-name() = 'fn']">
8430
8578
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
8431
8579
  </xsl:if>
8432
8580
 
8433
- <!-- display document identifier, not number [1] -->
8434
- <xsl:variable name="docidentifier">
8435
- <xsl:choose>
8436
- <xsl:when test="*[local-name() = 'docidentifier']/@type = 'metanorma'"/>
8437
- <xsl:otherwise><xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma-ordinal')]"/></xsl:otherwise>
8438
- </xsl:choose>
8439
- </xsl:variable>
8440
- <xsl:value-of select="$docidentifier"/>
8441
-
8442
- <xsl:apply-templates select="*[local-name() = 'note']"/>
8443
-
8444
- <xsl:if test="normalize-space($docidentifier) != '' and *[local-name() = 'formattedref']">
8445
- <xsl:text>,</xsl:text>
8446
- <xsl:text> </xsl:text>
8447
- </xsl:if>
8448
-
8581
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
8582
+ <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
8583
+ </xsl:apply-templates>
8449
8584
  <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
8450
8585
  <!-- end bibitem processing -->
8451
8586
 
8452
8587
  </xsl:template> <!-- processBibitem (bibitem) -->
8453
8588
 
8454
- <xsl:template name="processBibitemDocId">
8455
- <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')]"/>
8456
- <xsl:choose>
8457
- <xsl:when test="normalize-space($_doc_ident) != ''">
8458
- <!-- <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"/>
8459
- <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
8460
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
8461
- </xsl:if> -->
8462
- <xsl:value-of select="$_doc_ident"/>
8463
- </xsl:when>
8464
- <xsl:otherwise>
8465
- <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
8466
- <xsl:if test="$type != ''">
8467
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
8468
- </xsl:if> -->
8469
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
8470
- </xsl:otherwise>
8471
- </xsl:choose>
8472
- </xsl:template> <!-- processBibitemDocId -->
8589
+ <xsl:template match="*[local-name() = 'title']" mode="title">
8590
+ <fo:inline><xsl:apply-templates/></fo:inline>
8591
+ </xsl:template>
8592
+
8593
+ <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
8594
+
8595
+ <xsl:template match="*[local-name() = 'formattedref']">
8596
+ <!-- <xsl:if test="$namespace = 'unece' or $namespace = 'unece-rec'">
8597
+ <xsl:text>, </xsl:text>
8598
+ </xsl:if> -->
8599
+ <xsl:apply-templates/>
8600
+ </xsl:template>
8473
8601
 
8474
- <xsl:template name="processPersonalAuthor">
8602
+ <xsl:template match="*[local-name() = 'biblio-tag']">
8603
+ <xsl:param name="biblio_tag_part">both</xsl:param>
8475
8604
  <xsl:choose>
8476
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
8477
- <author>
8478
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
8479
- </author>
8605
+ <xsl:when test="$biblio_tag_part = 'first' and *[local-name() = 'tab']">
8606
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
8480
8607
  </xsl:when>
8481
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
8482
- <author>
8483
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
8484
- <xsl:text> </xsl:text>
8485
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
8486
- </author>
8487
- </xsl:when>
8488
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
8489
- <author>
8490
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
8491
- <xsl:text> </xsl:text>
8492
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
8493
- </author>
8608
+ <xsl:when test="$biblio_tag_part = 'last'">
8609
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
8494
8610
  </xsl:when>
8495
8611
  <xsl:otherwise>
8496
8612
  <xsl:apply-templates/>
8497
8613
  </xsl:otherwise>
8498
8614
  </xsl:choose>
8499
- </xsl:template> <!-- processPersonalAuthor -->
8500
-
8501
- <xsl:template name="renderDate">
8502
- <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
8503
- <xsl:value-of select="*[local-name() = 'on']"/>
8504
- </xsl:if>
8505
- <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
8506
- <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
8507
- </xsl:if>
8508
- </xsl:template>
8509
-
8510
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
8511
- <xsl:value-of select="translate(.,'. ','')"/>
8512
- </xsl:template>
8513
-
8514
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
8515
- <xsl:value-of select="substring(.,1,1)"/>
8516
- </xsl:template>
8517
-
8518
- <xsl:template match="*[local-name() = 'title']" mode="title">
8519
- <fo:inline><xsl:apply-templates/></fo:inline>
8520
- </xsl:template>
8521
-
8522
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
8523
- <!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
8524
- <fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
8525
- <xsl:apply-templates/>
8526
- </fo:inline>
8527
- </xsl:template>
8528
-
8529
- <!-- bibitem/note renders as footnote -->
8530
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
8531
-
8532
- <!-- list of footnotes to calculate actual footnotes number -->
8533
- <xsl:variable name="p_fn_">
8534
- <xsl:call-template name="get_fn_list"/>
8535
- </xsl:variable>
8536
- <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
8537
- <xsl:variable name="gen_id" select="generate-id(.)"/>
8538
- <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
8539
- <!-- fn sequence number in document -->
8540
- <xsl:variable name="current_fn_number">
8541
- <xsl:choose>
8542
- <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
8543
- <xsl:otherwise>
8544
- <!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
8545
- <xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
8546
- </xsl:otherwise>
8547
- </xsl:choose>
8548
- </xsl:variable>
8549
- <fo:footnote>
8550
- <xsl:variable name="number">
8551
-
8552
- <xsl:choose>
8553
- <xsl:when test="ancestor::*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]">
8554
- <xsl:number level="any" count="*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]//*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
8555
- </xsl:when>
8556
- <xsl:otherwise>
8557
- <xsl:value-of select="$current_fn_number"/>
8558
- </xsl:otherwise>
8559
- </xsl:choose>
8560
-
8561
- </xsl:variable>
8562
-
8563
- <xsl:variable name="current_fn_number_text">
8564
- <xsl:value-of select="$number"/>
8565
-
8566
- </xsl:variable>
8567
-
8568
- <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
8569
- <fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
8570
- <xsl:value-of select="$current_fn_number_text"/>
8571
- </fo:basic-link>
8572
- </fo:inline>
8573
- <fo:footnote-body>
8574
- <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
8575
- <fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
8576
- <xsl:value-of select="$current_fn_number_text"/>
8577
- </fo:inline>
8578
- <xsl:apply-templates/>
8579
- </fo:block>
8580
- </fo:footnote-body>
8581
- </fo:footnote>
8582
- </xsl:template>
8583
-
8584
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
8585
- <xsl:text> edition </xsl:text>
8586
- <xsl:value-of select="."/>
8587
- </xsl:template>
8588
-
8589
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
8590
- <xsl:text> (</xsl:text>
8591
- <fo:inline xsl:use-attribute-sets="link-style">
8592
- <fo:basic-link external-destination="." fox:alt-text=".">
8593
- <xsl:value-of select="."/>
8594
- </fo:basic-link>
8595
- </fo:inline>
8596
- <xsl:text>)</xsl:text>
8597
8615
  </xsl:template>
8598
8616
 
8599
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
8600
-
8601
- <xsl:template match="*[local-name() = 'formattedref']">
8602
-
8603
- <xsl:apply-templates/>
8617
+ <xsl:template match="*[local-name() = 'biblio-tag']/*[local-name() = 'tab']" priority="2">
8618
+ <xsl:text> </xsl:text>
8604
8619
  </xsl:template>
8605
8620
 
8606
8621
  <!-- ======================= -->
@@ -9034,6 +9049,12 @@
9034
9049
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
9035
9050
  <xsl:apply-templates mode="update_xml_step1"/>
9036
9051
  </xsl:template>
9052
+ <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
9053
+ <xsl:copy>
9054
+ <xsl:copy-of select="@*"/>
9055
+ <xsl:apply-templates mode="update_xml_step1"/>
9056
+ </xsl:copy>
9057
+ </xsl:template>
9037
9058
  <!-- =========================================================================== -->
9038
9059
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9039
9060
  <!-- =========================================================================== -->
@@ -9514,6 +9535,10 @@
9514
9535
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
9515
9536
  </xsl:template>
9516
9537
 
9538
+ <xsl:template name="getDocumentId_fromCurrentNode">
9539
+ <xsl:call-template name="getLang_fromCurrentNode"/><xsl:value-of select=".//*[local-name() = 'p'][1]/@id"/>
9540
+ </xsl:template>
9541
+
9517
9542
  <xsl:template name="namespaceCheck">
9518
9543
  <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
9519
9544
  <xsl:variable name="XSLNS">
@@ -810,8 +810,11 @@ a:hover {
810
810
  background: #1d1d1d;
811
811
  box-shadow: 3px 0 0 #1d1d1d, -3px 0 0 #1d1d1d; }
812
812
 
813
- ::selection,
814
- ::-moz-selection {
813
+ *::selection {
814
+ background: #1d1d1d;
815
+ color: white; }
816
+
817
+ *::-moz-selection {
815
818
  background: #1d1d1d;
816
819
  color: white; }
817
820
 
@@ -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,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
3
- VERSION = "2.2.0".freeze
3
+ VERSION = "2.2.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
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: exe
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-generic