metanorma-cc 2.2.0 → 2.2.2

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: 9124c14de0cd844286cab8171a3d7305ba2ed3685b3677e98919cc3590bd2aac
4
+ data.tar.gz: 2640468029927350d7053f782a13651037176f9f6e020cff210393d7d9f927c0
5
5
  SHA512:
6
- metadata.gz: 605251c6eb61d7ec93b0bfb533b0d2211c4a6207228d2d2325e4f41be6c88c50cb1424285a1f7eefd95b87763e05178146db278f3e1287cc5b1239ef3a99222a
7
- data.tar.gz: 78258e44feebed56e7dbcd5326950225f3e0c0b4e92583895182f7e82699611c4955d914ae60fad0b2176ad908f0f04858679b20cee61a6452cec4f310226b3f
6
+ metadata.gz: 815f627fb1c06b7d1bd988a23f61e00e07c5508d11eb1ef132377e45ada04d7bed86cf9f1c7beb94c43242096bd20ae9ef34c7a61d5811245da35479f05d16cd
7
+ data.tar.gz: d8fb0071eda29cf42cea9c63982f9306027bb181bd382caa86b8ee4488d05788d136bbd035ec7a345917c503dfdcb925721d9a9be6e7bb27b5915dd853ead5ad
@@ -2,7 +2,7 @@
2
2
 
3
3
  <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
4
4
 
5
- <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
5
+ <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"/>
6
6
 
7
7
  <xsl:variable name="debug">false</xsl:variable>
8
8
 
@@ -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 -->
@@ -3092,7 +3102,7 @@
3092
3102
  </fn>
3093
3103
  -->
3094
3104
  <!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
3095
- <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">
3105
+ <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">
3096
3106
 
3097
3107
  <!-- list of footnotes to calculate actual footnotes number -->
3098
3108
  <xsl:variable name="p_fn_">
@@ -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>
@@ -3134,8 +3159,7 @@
3134
3159
  </fo:basic-link>
3135
3160
  </fo:inline>
3136
3161
  </xsl:variable>
3137
- <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
3138
- gen_id=<xsl:value-of select="$gen_id"/> -->
3162
+
3139
3163
  <xsl:choose>
3140
3164
  <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
3141
3165
  <xsl:copy-of select="$footnote_inline"/>
@@ -3187,7 +3211,10 @@
3187
3211
  </xsl:for-each>
3188
3212
  <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
3213
  <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])]">
3214
+ <!-- commented:
3215
+ .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
3216
+ because 'fn' there is in biblio-tag -->
3217
+ <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
3218
  <!-- copy unique fn -->
3192
3219
  <fn gen_id="{generate-id(.)}">
3193
3220
  <xsl:copy-of select="@*"/>
@@ -4039,7 +4066,7 @@
4039
4066
  10
4040
4067
 
4041
4068
 
4042
- <!-- 10 -->
4069
+ <!-- inherit -->
4043
4070
 
4044
4071
  </xsl:variable>
4045
4072
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -5007,6 +5034,33 @@
5007
5034
  </xsl:choose>
5008
5035
  </xsl:template>
5009
5036
 
5037
+ <xsl:template name="getLang_fromCurrentNode">
5038
+ <xsl:variable name="language_current" select="normalize-space(.//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5039
+ <xsl:variable name="language">
5040
+ <xsl:choose>
5041
+ <xsl:when test="$language_current != ''">
5042
+ <xsl:value-of select="$language_current"/>
5043
+ </xsl:when>
5044
+ <xsl:otherwise>
5045
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5046
+ <xsl:choose>
5047
+ <xsl:when test="$language_current_2 != ''">
5048
+ <xsl:value-of select="$language_current_2"/>
5049
+ </xsl:when>
5050
+ <xsl:otherwise>
5051
+ <xsl:value-of select=".//*[local-name()='bibdata']//*[local-name()='language']"/>
5052
+ </xsl:otherwise>
5053
+ </xsl:choose>
5054
+ </xsl:otherwise>
5055
+ </xsl:choose>
5056
+ </xsl:variable>
5057
+
5058
+ <xsl:choose>
5059
+ <xsl:when test="$language = 'English'">en</xsl:when>
5060
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
5061
+ </xsl:choose>
5062
+ </xsl:template>
5063
+
5010
5064
  <xsl:template name="capitalizeWords">
5011
5065
  <xsl:param name="str"/>
5012
5066
  <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
@@ -5621,7 +5675,7 @@
5621
5675
  <xsl:template match="*[local-name() = 'figure']" name="figure">
5622
5676
  <xsl:variable name="isAdded" select="@added"/>
5623
5677
  <xsl:variable name="isDeleted" select="@deleted"/>
5624
- <fo:block-container id="{@id}">
5678
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
5625
5679
 
5626
5680
  <xsl:call-template name="setTrackChangesStyles">
5627
5681
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -5699,7 +5753,9 @@
5699
5753
 
5700
5754
  <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
5701
5755
  <xsl:if test="number($scale) &lt; 100">
5702
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
5756
+
5757
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
5758
+
5703
5759
  </xsl:if>
5704
5760
 
5705
5761
  </xsl:if>
@@ -6607,7 +6663,13 @@
6607
6663
  </xsl:template>
6608
6664
 
6609
6665
  <xsl:template match="text()" mode="contents_item">
6610
- <xsl:call-template name="keep_together_standard_number"/>
6666
+ <xsl:variable name="text">
6667
+ <!-- to split by '_' and other chars -->
6668
+ <text><xsl:call-template name="add-zero-spaces-java"/></text>
6669
+ </xsl:variable>
6670
+ <xsl:for-each select="xalan:nodeset($text)/text/text()">
6671
+ <xsl:call-template name="keep_together_standard_number"/>
6672
+ </xsl:for-each>
6611
6673
  </xsl:template>
6612
6674
 
6613
6675
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
@@ -6618,37 +6680,55 @@
6618
6680
  <!-- =============== -->
6619
6681
  <!-- sourcecode -->
6620
6682
  <!-- =============== -->
6621
- <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
6622
6683
 
6623
- <xsl:variable name="sourcecode_attributes">
6624
- <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
6625
- <xsl:variable name="_font-size">
6684
+ <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
6685
+ <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
6686
+ <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
6626
6687
 
6627
- 10
6688
+ <xsl:template match="*[local-name() = 'property']" mode="css">
6689
+ <xsl:attribute name="{@name}">
6690
+ <xsl:value-of select="@value"/>
6691
+ </xsl:attribute>
6692
+ </xsl:template>
6628
6693
 
6694
+ <xsl:template name="get_sourcecode_attributes">
6695
+ <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
6696
+ <xsl:variable name="_font-size">
6629
6697
 
6630
- <!-- 9 -->
6698
+ 10
6631
6699
 
6632
- <!-- <xsl:if test="$namespace = 'ieee'">
6633
- <xsl:if test="$current_template = 'standard'">8</xsl:if>
6634
- </xsl:if> -->
6635
6700
 
6636
- </xsl:variable>
6701
+ <!-- inherit -->
6637
6702
 
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>
6703
+ <!-- <xsl:if test="$namespace = 'ieee'">
6704
+ <xsl:if test="$current_template = 'standard'">8</xsl:if>
6705
+ </xsl:if> -->
6706
+
6707
+ </xsl:variable>
6708
+
6709
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
6710
+ <xsl:if test="$font-size != ''">
6711
+ <xsl:attribute name="font-size">
6712
+ <xsl:choose>
6713
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
6714
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
6715
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
6716
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
6717
+ </xsl:choose>
6718
+ </xsl:attribute>
6719
+ </xsl:if>
6720
+ <xsl:apply-templates select="$sourcecode_css//class[@name = 'sourcecode']" mode="css"/>
6721
+ </xsl:element>
6722
+ </xsl:template>
6723
+
6724
+ <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
6725
+
6726
+ <xsl:variable name="sourcecode_attributes">
6727
+ <xsl:call-template name="get_sourcecode_attributes"/>
6650
6728
  </xsl:variable>
6651
6729
 
6730
+ <!-- <xsl:copy-of select="$sourcecode_css"/> -->
6731
+
6652
6732
  <xsl:choose>
6653
6733
  <xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
6654
6734
  <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
@@ -6691,6 +6771,12 @@
6691
6771
  </xsl:attribute>
6692
6772
  </xsl:for-each>
6693
6773
 
6774
+ <!-- remove margin between rows in the table with sourcecode line numbers -->
6775
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
6776
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
6777
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
6778
+ </xsl:if>
6779
+
6694
6780
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6695
6781
  </fo:block>
6696
6782
 
@@ -6702,9 +6788,10 @@
6702
6788
  </xsl:choose>
6703
6789
  </xsl:template>
6704
6790
 
6705
- <xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
6791
+ <xsl:template match="*[local-name()='sourcecode']/text() | *[local-name()='sourcecode']//*[local-name()='span']/text()" priority="2">
6706
6792
  <xsl:choose>
6707
- <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
6793
+ <!-- disabled -->
6794
+ <xsl:when test="1 = 2 and normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
6708
6795
  <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
6709
6796
  <xsl:choose>
6710
6797
  <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
@@ -6719,8 +6806,76 @@
6719
6806
  <xsl:call-template name="add_spaces_to_sourcecode"/>
6720
6807
  </xsl:otherwise>
6721
6808
  </xsl:choose>
6809
+ </xsl:template>
6810
+
6811
+ <!-- add sourcecode highlighting -->
6812
+ <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
6813
+ <xsl:variable name="class" select="@class"/>
6814
+ <xsl:choose>
6815
+ <xsl:when test="$sourcecode_css//class[@name = $class]">
6816
+ <fo:inline>
6817
+ <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
6818
+ <xsl:apply-templates/>
6819
+ </fo:inline>
6820
+ </xsl:when>
6821
+ <xsl:otherwise>
6822
+ <xsl:apply-templates/>
6823
+ </xsl:otherwise>
6824
+ </xsl:choose>
6825
+ </xsl:template>
6826
+
6827
+ <!-- outer table with line numbers for sourcecode -->
6828
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
6829
+ <fo:block>
6830
+ <fo:table width="100%" table-layout="fixed">
6831
+ <xsl:copy-of select="@id"/>
6832
+ <fo:table-column column-width="8%"/>
6833
+ <fo:table-column column-width="92%"/>
6834
+ <fo:table-body>
6835
+ <xsl:apply-templates/>
6836
+ </fo:table-body>
6837
+ </fo:table>
6838
+ </fo:block>
6839
+ </xsl:template>
6840
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
6841
+ <xsl:apply-templates/>
6842
+ </xsl:template>
6843
+ <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
6844
+ <fo:table-row>
6845
+ <xsl:apply-templates/>
6846
+ </fo:table-row>
6847
+ </xsl:template>
6848
+ <!-- first td with line numbers -->
6849
+ <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'] -->
6850
+ <fo:table-cell>
6851
+ <fo:block>
6852
+
6853
+ <!-- set attibutes for line numbers - same as sourcecode -->
6854
+ <xsl:variable name="sourcecode_attributes">
6855
+ <xsl:for-each select="following-sibling::*[local-name() = 'td']/*[local-name() = 'sourcecode']">
6856
+ <xsl:call-template name="get_sourcecode_attributes"/>
6857
+ </xsl:for-each>
6858
+ </xsl:variable>
6859
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
6860
+ <xsl:attribute name="{local-name()}">
6861
+ <xsl:value-of select="."/>
6862
+ </xsl:attribute>
6863
+ </xsl:for-each>
6864
+
6865
+ <xsl:apply-templates/>
6866
+ </fo:block>
6867
+ </fo:table-cell>
6868
+ </xsl:template>
6722
6869
 
6870
+ <!-- second td with sourcecode -->
6871
+ <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'] -->
6872
+ <fo:table-cell>
6873
+ <fo:block>
6874
+ <xsl:apply-templates/>
6875
+ </fo:block>
6876
+ </fo:table-cell>
6723
6877
  </xsl:template>
6878
+ <!-- END outer table with line numbers for sourcecode -->
6724
6879
 
6725
6880
  <xsl:template name="add_spaces_to_sourcecode">
6726
6881
  <xsl:variable name="text_step1">
@@ -6951,7 +7106,25 @@
6951
7106
  <xsl:template match="*[local-name()='pre']" name="pre">
6952
7107
  <fo:block xsl:use-attribute-sets="pre-style">
6953
7108
  <xsl:copy-of select="@id"/>
6954
- <xsl:apply-templates/>
7109
+ <xsl:choose>
7110
+
7111
+ <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' -->
7112
+ <xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
7113
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
7114
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
7115
+ </xsl:if>
7116
+ <fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
7117
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
7118
+ <mtext><xsl:value-of select="."/></mtext>
7119
+ </math>
7120
+ </fo:instream-foreign-object>
7121
+ </xsl:when>
7122
+
7123
+ <xsl:otherwise>
7124
+ <xsl:apply-templates/>
7125
+ </xsl:otherwise>
7126
+
7127
+ </xsl:choose>
6955
7128
  </fo:block>
6956
7129
  </xsl:template>
6957
7130
  <!-- =============== -->
@@ -8405,17 +8578,17 @@
8405
8578
  <fo:block>
8406
8579
  <fo:inline>
8407
8580
 
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
-
8581
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
8582
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
8583
+ </xsl:apply-templates>
8413
8584
  </fo:inline>
8414
8585
  </fo:block>
8415
8586
  </fo:list-item-label>
8416
8587
  <fo:list-item-body start-indent="body-start()">
8417
8588
  <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
8418
- <xsl:call-template name="processBibitem"/>
8589
+ <xsl:call-template name="processBibitem">
8590
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
8591
+ </xsl:call-template>
8419
8592
  </fo:block>
8420
8593
  </fo:list-item-body>
8421
8594
  </fo:list-item>
@@ -8424,183 +8597,51 @@
8424
8597
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
8425
8598
 
8426
8599
  <xsl:template name="processBibitem">
8600
+ <xsl:param name="biblio_tag_part">both</xsl:param>
8427
8601
 
8428
8602
  <!-- start bibitem processing -->
8429
8603
  <xsl:if test=".//*[local-name() = 'fn']">
8430
8604
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
8431
8605
  </xsl:if>
8432
8606
 
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
-
8607
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
8608
+ <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
8609
+ </xsl:apply-templates>
8449
8610
  <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
8450
8611
  <!-- end bibitem processing -->
8451
8612
 
8452
8613
  </xsl:template> <!-- processBibitem (bibitem) -->
8453
8614
 
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 -->
8615
+ <xsl:template match="*[local-name() = 'title']" mode="title">
8616
+ <fo:inline><xsl:apply-templates/></fo:inline>
8617
+ </xsl:template>
8618
+
8619
+ <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
8620
+
8621
+ <xsl:template match="*[local-name() = 'formattedref']">
8622
+ <!-- <xsl:if test="$namespace = 'unece' or $namespace = 'unece-rec'">
8623
+ <xsl:text>, </xsl:text>
8624
+ </xsl:if> -->
8625
+ <xsl:apply-templates/>
8626
+ </xsl:template>
8473
8627
 
8474
- <xsl:template name="processPersonalAuthor">
8628
+ <xsl:template match="*[local-name() = 'biblio-tag']">
8629
+ <xsl:param name="biblio_tag_part">both</xsl:param>
8475
8630
  <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>
8631
+ <xsl:when test="$biblio_tag_part = 'first' and *[local-name() = 'tab']">
8632
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
8480
8633
  </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>
8634
+ <xsl:when test="$biblio_tag_part = 'last'">
8635
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
8494
8636
  </xsl:when>
8495
8637
  <xsl:otherwise>
8496
8638
  <xsl:apply-templates/>
8497
8639
  </xsl:otherwise>
8498
8640
  </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
8641
  </xsl:template>
8513
8642
 
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
- </xsl:template>
8598
-
8599
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
8600
-
8601
- <xsl:template match="*[local-name() = 'formattedref']">
8602
-
8603
- <xsl:apply-templates/>
8643
+ <xsl:template match="*[local-name() = 'biblio-tag']/*[local-name() = 'tab']" priority="2">
8644
+ <xsl:text> </xsl:text>
8604
8645
  </xsl:template>
8605
8646
 
8606
8647
  <!-- ======================= -->
@@ -9034,6 +9075,12 @@
9034
9075
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
9035
9076
  <xsl:apply-templates mode="update_xml_step1"/>
9036
9077
  </xsl:template>
9078
+ <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
9079
+ <xsl:copy>
9080
+ <xsl:copy-of select="@*"/>
9081
+ <xsl:apply-templates mode="update_xml_step1"/>
9082
+ </xsl:copy>
9083
+ </xsl:template>
9037
9084
  <!-- =========================================================================== -->
9038
9085
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9039
9086
  <!-- =========================================================================== -->
@@ -9514,6 +9561,10 @@
9514
9561
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
9515
9562
  </xsl:template>
9516
9563
 
9564
+ <xsl:template name="getDocumentId_fromCurrentNode">
9565
+ <xsl:call-template name="getLang_fromCurrentNode"/><xsl:value-of select=".//*[local-name() = 'p'][1]/@id"/>
9566
+ </xsl:template>
9567
+
9517
9568
  <xsl:template name="namespaceCheck">
9518
9569
  <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
9519
9570
  <xsl:variable name="XSLNS">
@@ -124,6 +124,35 @@ a.FootnoteRef + a.FootnoteRef:before {
124
124
  color: red;
125
125
  text-decoration: line-through; }
126
126
 
127
+ /* code highlighting with line numbers */
128
+ table.rouge-line-table td.rouge-gutter {
129
+ -moz-user-select: none;
130
+ -ms-user-select: none;
131
+ -webkit-user-select: none;
132
+ user-select: none;
133
+ padding-right: 1em; }
134
+
135
+ table.rouge-line-table td.rouge-code {
136
+ -moz-user-select: all;
137
+ -ms-user-select: all;
138
+ -webkit-user-select: all;
139
+ user-select: all; }
140
+
141
+ table.rouge-line-table,
142
+ table.rouge-line-table th,
143
+ table.rouge-line-table td {
144
+ width: auto;
145
+ border: none;
146
+ margin: 0;
147
+ padding: 0;
148
+ font-size: 100%; }
149
+
150
+ table.rouge-line-table pre {
151
+ margin: 0;
152
+ padding: 0;
153
+ overflow-x: visible;
154
+ font-size: 100%; }
155
+
127
156
  #standard-band {
128
157
  background-color: #0AC442; }
129
158
 
@@ -124,6 +124,35 @@ a.FootnoteRef + a.FootnoteRef:before {
124
124
  color: red;
125
125
  text-decoration: line-through; }
126
126
 
127
+ /* code highlighting with line numbers */
128
+ table.rouge-line-table td.rouge-gutter {
129
+ -moz-user-select: none;
130
+ -ms-user-select: none;
131
+ -webkit-user-select: none;
132
+ user-select: none;
133
+ padding-right: 1em; }
134
+
135
+ table.rouge-line-table td.rouge-code {
136
+ -moz-user-select: all;
137
+ -ms-user-select: all;
138
+ -webkit-user-select: all;
139
+ user-select: all; }
140
+
141
+ table.rouge-line-table,
142
+ table.rouge-line-table th,
143
+ table.rouge-line-table td {
144
+ width: auto;
145
+ border: none;
146
+ margin: 0;
147
+ padding: 0;
148
+ font-size: 100%; }
149
+
150
+ table.rouge-line-table pre {
151
+ margin: 0;
152
+ padding: 0;
153
+ overflow-x: visible;
154
+ font-size: 100%; }
155
+
127
156
  #standard-band {
128
157
  background-color: #0AC442; }
129
158
 
@@ -352,6 +381,35 @@ a.FootnoteRef + a.FootnoteRef:before {
352
381
  color: red;
353
382
  text-decoration: line-through; }
354
383
 
384
+ /* code highlighting with line numbers */
385
+ table.rouge-line-table td.rouge-gutter {
386
+ -moz-user-select: none;
387
+ -ms-user-select: none;
388
+ -webkit-user-select: none;
389
+ user-select: none;
390
+ padding-right: 1em; }
391
+
392
+ table.rouge-line-table td.rouge-code {
393
+ -moz-user-select: all;
394
+ -ms-user-select: all;
395
+ -webkit-user-select: all;
396
+ user-select: all; }
397
+
398
+ table.rouge-line-table,
399
+ table.rouge-line-table th,
400
+ table.rouge-line-table td {
401
+ width: auto;
402
+ border: none;
403
+ margin: 0;
404
+ padding: 0;
405
+ font-size: 100%; }
406
+
407
+ table.rouge-line-table pre {
408
+ margin: 0;
409
+ padding: 0;
410
+ overflow-x: visible;
411
+ font-size: 100%; }
412
+
355
413
  #standard-band {
356
414
  background-color: #0AC442; }
357
415
 
@@ -810,8 +868,11 @@ a:hover {
810
868
  background: #1d1d1d;
811
869
  box-shadow: 3px 0 0 #1d1d1d, -3px 0 0 #1d1d1d; }
812
870
 
813
- ::selection,
814
- ::-moz-selection {
871
+ *::selection {
872
+ background: #1d1d1d;
873
+ color: white; }
874
+
875
+ *::-moz-selection {
815
876
  background: #1d1d1d;
816
877
  color: white; }
817
878
 
@@ -986,7 +1047,7 @@ table {
986
1047
  table th, table td {
987
1048
  padding: 1em; }
988
1049
  table td.header {
989
- font-weigth: 400; }
1050
+ font-weight: 400; }
990
1051
 
991
1052
  p.TableTitle {
992
1053
  text-align: center;
@@ -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.2".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.2
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-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic