metanorma-un 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1584,6 +1584,12 @@
1584
1584
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1585
1585
  </xsl:attribute-set>
1586
1586
 
1587
+ <xsl:attribute-set name="figure-block-style">
1588
+
1589
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1590
+
1591
+ </xsl:attribute-set>
1592
+
1587
1593
  <xsl:attribute-set name="figure-style">
1588
1594
 
1589
1595
  </xsl:attribute-set>
@@ -1592,7 +1598,7 @@
1592
1598
 
1593
1599
  <xsl:attribute name="text-align">center</xsl:attribute>
1594
1600
  <xsl:attribute name="font-size">9pt</xsl:attribute>
1595
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1601
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
1596
1602
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1597
1603
  <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
1598
1604
 
@@ -3004,6 +3010,10 @@
3004
3010
  <xsl:with-param name="continued">true</xsl:with-param>
3005
3011
  </xsl:apply-templates>
3006
3012
 
3013
+ <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
3014
+ <fo:block/>
3015
+ </xsl:if>
3016
+
3007
3017
  </fo:table-cell>
3008
3018
  </fo:table-row>
3009
3019
  </xsl:template> <!-- table-header-title -->
@@ -3412,7 +3422,22 @@
3412
3422
 
3413
3423
  <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3414
3424
  <xsl:variable name="footnote_inline">
3415
- <fo:inline xsl:use-attribute-sets="fn-num-style">
3425
+ <fo:inline>
3426
+
3427
+ <xsl:variable name="fn_styles">
3428
+ <xsl:choose>
3429
+ <xsl:when test="ancestor::*[local-name() = 'bibitem']">
3430
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
3431
+ </xsl:when>
3432
+ <xsl:otherwise>
3433
+ <fn_styles xsl:use-attribute-sets="fn-num-style"/>
3434
+ </xsl:otherwise>
3435
+ </xsl:choose>
3436
+ </xsl:variable>
3437
+
3438
+ <xsl:for-each select="xalan:nodeset($fn_styles)/fn_styles/@*">
3439
+ <xsl:copy-of select="."/>
3440
+ </xsl:for-each>
3416
3441
 
3417
3442
  <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
3418
3443
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
@@ -3476,7 +3501,10 @@
3476
3501
  </xsl:for-each>
3477
3502
  <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']/*">
3478
3503
  <xsl:sort select="@displayorder" data-type="number"/>
3479
- <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])]">
3504
+ <!-- commented:
3505
+ .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
3506
+ because 'fn' there is in biblio-tag -->
3507
+ <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])]">
3480
3508
  <!-- copy unique fn -->
3481
3509
  <fn gen_id="{generate-id(.)}">
3482
3510
  <xsl:copy-of select="@*"/>
@@ -4325,7 +4353,7 @@
4325
4353
 
4326
4354
  <xsl:variable name="_font-size">
4327
4355
 
4328
- <!-- 10 -->
4356
+ <!-- inherit -->
4329
4357
 
4330
4358
  </xsl:variable>
4331
4359
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -5293,6 +5321,33 @@
5293
5321
  </xsl:choose>
5294
5322
  </xsl:template>
5295
5323
 
5324
+ <xsl:template name="getLang_fromCurrentNode">
5325
+ <xsl:variable name="language_current" select="normalize-space(.//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5326
+ <xsl:variable name="language">
5327
+ <xsl:choose>
5328
+ <xsl:when test="$language_current != ''">
5329
+ <xsl:value-of select="$language_current"/>
5330
+ </xsl:when>
5331
+ <xsl:otherwise>
5332
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5333
+ <xsl:choose>
5334
+ <xsl:when test="$language_current_2 != ''">
5335
+ <xsl:value-of select="$language_current_2"/>
5336
+ </xsl:when>
5337
+ <xsl:otherwise>
5338
+ <xsl:value-of select=".//*[local-name()='bibdata']//*[local-name()='language']"/>
5339
+ </xsl:otherwise>
5340
+ </xsl:choose>
5341
+ </xsl:otherwise>
5342
+ </xsl:choose>
5343
+ </xsl:variable>
5344
+
5345
+ <xsl:choose>
5346
+ <xsl:when test="$language = 'English'">en</xsl:when>
5347
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
5348
+ </xsl:choose>
5349
+ </xsl:template>
5350
+
5296
5351
  <xsl:template name="capitalizeWords">
5297
5352
  <xsl:param name="str"/>
5298
5353
  <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
@@ -5929,7 +5984,7 @@
5929
5984
  <xsl:template match="*[local-name() = 'figure']" name="figure">
5930
5985
  <xsl:variable name="isAdded" select="@added"/>
5931
5986
  <xsl:variable name="isDeleted" select="@deleted"/>
5932
- <fo:block-container id="{@id}">
5987
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
5933
5988
 
5934
5989
  <xsl:call-template name="setTrackChangesStyles">
5935
5990
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -6920,7 +6975,13 @@
6920
6975
  </xsl:template>
6921
6976
 
6922
6977
  <xsl:template match="text()" mode="contents_item">
6923
- <xsl:call-template name="keep_together_standard_number"/>
6978
+ <xsl:variable name="text">
6979
+ <!-- to split by '_' and other chars -->
6980
+ <text><xsl:call-template name="add-zero-spaces-java"/></text>
6981
+ </xsl:variable>
6982
+ <xsl:for-each select="xalan:nodeset($text)/text/text()">
6983
+ <xsl:call-template name="keep_together_standard_number"/>
6984
+ </xsl:for-each>
6924
6985
  </xsl:template>
6925
6986
 
6926
6987
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
@@ -6931,35 +6992,53 @@
6931
6992
  <!-- =============== -->
6932
6993
  <!-- sourcecode -->
6933
6994
  <!-- =============== -->
6934
- <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
6935
6995
 
6936
- <xsl:variable name="sourcecode_attributes">
6937
- <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
6938
- <xsl:variable name="_font-size">
6996
+ <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
6997
+ <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
6998
+ <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
6939
6999
 
6940
- <!-- 9 -->
7000
+ <xsl:template match="*[local-name() = 'property']" mode="css">
7001
+ <xsl:attribute name="{@name}">
7002
+ <xsl:value-of select="@value"/>
7003
+ </xsl:attribute>
7004
+ </xsl:template>
6941
7005
 
6942
- <!-- <xsl:if test="$namespace = 'ieee'">
6943
- <xsl:if test="$current_template = 'standard'">8</xsl:if>
6944
- </xsl:if> -->
7006
+ <xsl:template name="get_sourcecode_attributes">
7007
+ <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
7008
+ <xsl:variable name="_font-size">
6945
7009
 
6946
- 10
6947
- </xsl:variable>
7010
+ <!-- inherit -->
6948
7011
 
6949
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
6950
- <xsl:if test="$font-size != ''">
6951
- <xsl:attribute name="font-size">
6952
- <xsl:choose>
6953
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
6954
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
6955
- <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
6956
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
6957
- </xsl:choose>
6958
- </xsl:attribute>
6959
- </xsl:if>
6960
- </xsl:element>
7012
+ <!-- <xsl:if test="$namespace = 'ieee'">
7013
+ <xsl:if test="$current_template = 'standard'">8</xsl:if>
7014
+ </xsl:if> -->
7015
+
7016
+ 10
7017
+ </xsl:variable>
7018
+
7019
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
7020
+ <xsl:if test="$font-size != ''">
7021
+ <xsl:attribute name="font-size">
7022
+ <xsl:choose>
7023
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
7024
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
7025
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
7026
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
7027
+ </xsl:choose>
7028
+ </xsl:attribute>
7029
+ </xsl:if>
7030
+ <xsl:apply-templates select="$sourcecode_css//class[@name = 'sourcecode']" mode="css"/>
7031
+ </xsl:element>
7032
+ </xsl:template>
7033
+
7034
+ <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
7035
+
7036
+ <xsl:variable name="sourcecode_attributes">
7037
+ <xsl:call-template name="get_sourcecode_attributes"/>
6961
7038
  </xsl:variable>
6962
7039
 
7040
+ <!-- <xsl:copy-of select="$sourcecode_css"/> -->
7041
+
6963
7042
  <xsl:choose>
6964
7043
  <xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
6965
7044
  <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
@@ -7013,9 +7092,10 @@
7013
7092
  </xsl:choose>
7014
7093
  </xsl:template>
7015
7094
 
7016
- <xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
7095
+ <xsl:template match="*[local-name()='sourcecode']/text() | *[local-name()='sourcecode']//*[local-name()='span']/text()" priority="2">
7017
7096
  <xsl:choose>
7018
- <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
7097
+ <!-- disabled -->
7098
+ <xsl:when test="1 = 2 and normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
7019
7099
  <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
7020
7100
  <xsl:choose>
7021
7101
  <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
@@ -7030,8 +7110,75 @@
7030
7110
  <xsl:call-template name="add_spaces_to_sourcecode"/>
7031
7111
  </xsl:otherwise>
7032
7112
  </xsl:choose>
7113
+ </xsl:template>
7114
+
7115
+ <!-- add sourcecode highlighting -->
7116
+ <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
7117
+ <xsl:variable name="class" select="@class"/>
7118
+ <xsl:choose>
7119
+ <xsl:when test="$sourcecode_css//class[@name = $class]">
7120
+ <fo:inline>
7121
+ <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
7122
+ <xsl:apply-templates/>
7123
+ </fo:inline>
7124
+ </xsl:when>
7125
+ <xsl:otherwise>
7126
+ <xsl:apply-templates/>
7127
+ </xsl:otherwise>
7128
+ </xsl:choose>
7129
+ </xsl:template>
7130
+
7131
+ <!-- outer table with line numbers for sourcecode -->
7132
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
7133
+ <fo:block>
7134
+ <fo:table width="100%" table-layout="fixed">
7135
+ <xsl:copy-of select="@id"/>
7136
+ <fo:table-column column-width="8%"/>
7137
+ <fo:table-column column-width="92%"/>
7138
+ <fo:table-body>
7139
+ <xsl:apply-templates/>
7140
+ </fo:table-body>
7141
+ </fo:table>
7142
+ </fo:block>
7143
+ </xsl:template>
7144
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
7145
+ <xsl:apply-templates/>
7146
+ </xsl:template>
7147
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
7148
+ <fo:table-row>
7149
+ <xsl:apply-templates/>
7150
+ </fo:table-row>
7151
+ </xsl:template>
7152
+ <!-- first td with line numbers -->
7153
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
7154
+ <fo:table-cell>
7155
+ <fo:block>
7156
+
7157
+ <!-- set attibutes for line numbers - same as sourcecode -->
7158
+ <xsl:variable name="sourcecode_attributes">
7159
+ <xsl:for-each select="following-sibling::*[local-name() = 'td']/*[local-name() = 'sourcecode']">
7160
+ <xsl:call-template name="get_sourcecode_attributes"/>
7161
+ </xsl:for-each>
7162
+ </xsl:variable>
7163
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
7164
+ <xsl:attribute name="{local-name()}">
7165
+ <xsl:value-of select="."/>
7166
+ </xsl:attribute>
7167
+ </xsl:for-each>
7033
7168
 
7169
+ <xsl:apply-templates/>
7170
+ </fo:block>
7171
+ </fo:table-cell>
7034
7172
  </xsl:template>
7173
+ <!-- second td with sourcecode -->
7174
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
7175
+ <fo:table-cell>
7176
+ <fo:block>
7177
+ <xsl:apply-templates/>
7178
+ </fo:block>
7179
+ </fo:table-cell>
7180
+ </xsl:template>
7181
+ <!-- END outer table with line numbers for sourcecode -->
7035
7182
 
7036
7183
  <xsl:template name="add_spaces_to_sourcecode">
7037
7184
  <xsl:variable name="text_step1">
@@ -8714,160 +8861,53 @@
8714
8861
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
8715
8862
 
8716
8863
  <xsl:template name="processBibitem">
8864
+ <xsl:param name="biblio_tag_part">both</xsl:param>
8717
8865
 
8718
8866
  <!-- start UNECE bibitem processing -->
8719
- <fo:inline padding-right="5mm">[<xsl:value-of select="un:docidentifier"/>]</fo:inline><xsl:value-of select="un:docidentifier"/>
8720
- <xsl:text> </xsl:text>
8867
+ <fo:inline padding-right="5mm">
8868
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
8869
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
8870
+ </xsl:apply-templates>
8871
+ </fo:inline>
8872
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
8873
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
8874
+ </xsl:apply-templates>
8875
+
8721
8876
  <xsl:apply-templates select="un:formattedref"/>
8722
8877
  <!-- END UNECE bibitem processing -->
8723
8878
 
8724
8879
  </xsl:template> <!-- processBibitem (bibitem) -->
8725
8880
 
8726
- <xsl:template name="processBibitemDocId">
8727
- <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')]"/>
8728
- <xsl:choose>
8729
- <xsl:when test="normalize-space($_doc_ident) != ''">
8730
- <!-- <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"/>
8731
- <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
8732
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
8733
- </xsl:if> -->
8734
- <xsl:value-of select="$_doc_ident"/>
8735
- </xsl:when>
8736
- <xsl:otherwise>
8737
- <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
8738
- <xsl:if test="$type != ''">
8739
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
8740
- </xsl:if> -->
8741
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
8742
- </xsl:otherwise>
8743
- </xsl:choose>
8744
- </xsl:template> <!-- processBibitemDocId -->
8881
+ <xsl:template match="*[local-name() = 'title']" mode="title">
8882
+ <fo:inline><xsl:apply-templates/></fo:inline>
8883
+ </xsl:template>
8745
8884
 
8746
- <xsl:template name="processPersonalAuthor">
8885
+ <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
8886
+
8887
+ <xsl:template match="*[local-name() = 'formattedref']">
8888
+ <!-- <xsl:if test="$namespace = 'unece' or $namespace = 'unece-rec'">
8889
+ <xsl:text>, </xsl:text>
8890
+ </xsl:if> -->
8891
+ <xsl:apply-templates/>
8892
+ </xsl:template>
8893
+
8894
+ <xsl:template match="*[local-name() = 'biblio-tag']">
8895
+ <xsl:param name="biblio_tag_part">both</xsl:param>
8747
8896
  <xsl:choose>
8748
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
8749
- <author>
8750
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
8751
- </author>
8752
- </xsl:when>
8753
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
8754
- <author>
8755
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
8756
- <xsl:text> </xsl:text>
8757
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
8758
- </author>
8897
+ <xsl:when test="$biblio_tag_part = 'first' and *[local-name() = 'tab']">
8898
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
8759
8899
  </xsl:when>
8760
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
8761
- <author>
8762
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
8763
- <xsl:text> </xsl:text>
8764
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
8765
- </author>
8900
+ <xsl:when test="$biblio_tag_part = 'last'">
8901
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
8766
8902
  </xsl:when>
8767
8903
  <xsl:otherwise>
8768
8904
  <xsl:apply-templates/>
8769
8905
  </xsl:otherwise>
8770
8906
  </xsl:choose>
8771
- </xsl:template> <!-- processPersonalAuthor -->
8772
-
8773
- <xsl:template name="renderDate">
8774
- <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
8775
- <xsl:value-of select="*[local-name() = 'on']"/>
8776
- </xsl:if>
8777
- <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
8778
- <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
8779
- </xsl:if>
8780
8907
  </xsl:template>
8781
8908
 
8782
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
8783
- <xsl:value-of select="translate(.,'. ','')"/>
8784
- </xsl:template>
8785
-
8786
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
8787
- <xsl:value-of select="substring(.,1,1)"/>
8788
- </xsl:template>
8789
-
8790
- <xsl:template match="*[local-name() = 'title']" mode="title">
8791
- <fo:inline><xsl:apply-templates/></fo:inline>
8792
- </xsl:template>
8793
-
8794
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
8795
- <!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
8796
- <fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
8797
- <xsl:apply-templates/>
8798
- </fo:inline>
8799
- </xsl:template>
8800
-
8801
- <!-- bibitem/note renders as footnote -->
8802
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
8803
-
8804
- <!-- list of footnotes to calculate actual footnotes number -->
8805
- <xsl:variable name="p_fn_">
8806
- <xsl:call-template name="get_fn_list"/>
8807
- </xsl:variable>
8808
- <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
8809
- <xsl:variable name="gen_id" select="generate-id(.)"/>
8810
- <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
8811
- <!-- fn sequence number in document -->
8812
- <xsl:variable name="current_fn_number">
8813
- <xsl:choose>
8814
- <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
8815
- <xsl:otherwise>
8816
- <!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
8817
- <xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
8818
- </xsl:otherwise>
8819
- </xsl:choose>
8820
- </xsl:variable>
8821
- <fo:footnote>
8822
- <xsl:variable name="number">
8823
-
8824
- <xsl:value-of select="$current_fn_number"/>
8825
-
8826
- </xsl:variable>
8827
-
8828
- <xsl:variable name="current_fn_number_text">
8829
- <xsl:value-of select="$number"/>
8830
-
8831
- </xsl:variable>
8832
-
8833
- <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
8834
- <fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
8835
- <xsl:value-of select="$current_fn_number_text"/>
8836
- </fo:basic-link>
8837
- </fo:inline>
8838
- <fo:footnote-body>
8839
- <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
8840
- <fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
8841
- <xsl:value-of select="$current_fn_number_text"/>
8842
- </fo:inline>
8843
- <xsl:apply-templates/>
8844
- </fo:block>
8845
- </fo:footnote-body>
8846
- </fo:footnote>
8847
- </xsl:template>
8848
-
8849
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
8850
- <xsl:text> edition </xsl:text>
8851
- <xsl:value-of select="."/>
8852
- </xsl:template>
8853
-
8854
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
8855
- <xsl:text> (</xsl:text>
8856
- <fo:inline xsl:use-attribute-sets="link-style">
8857
- <fo:basic-link external-destination="." fox:alt-text=".">
8858
- <xsl:value-of select="."/>
8859
- </fo:basic-link>
8860
- </fo:inline>
8861
- <xsl:text>)</xsl:text>
8862
- </xsl:template>
8863
-
8864
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
8865
-
8866
- <xsl:template match="*[local-name() = 'formattedref']">
8867
-
8868
- <xsl:text>, </xsl:text>
8869
-
8870
- <xsl:apply-templates/>
8909
+ <xsl:template match="*[local-name() = 'biblio-tag']/*[local-name() = 'tab']" priority="2">
8910
+ <xsl:text> </xsl:text>
8871
8911
  </xsl:template>
8872
8912
 
8873
8913
  <!-- ======================= -->
@@ -9301,6 +9341,12 @@
9301
9341
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
9302
9342
  <xsl:apply-templates mode="update_xml_step1"/>
9303
9343
  </xsl:template>
9344
+ <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
9345
+ <xsl:copy>
9346
+ <xsl:copy-of select="@*"/>
9347
+ <xsl:apply-templates mode="update_xml_step1"/>
9348
+ </xsl:copy>
9349
+ </xsl:template>
9304
9350
  <!-- =========================================================================== -->
9305
9351
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9306
9352
  <!-- =========================================================================== -->
@@ -9781,6 +9827,10 @@
9781
9827
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
9782
9828
  </xsl:template>
9783
9829
 
9830
+ <xsl:template name="getDocumentId_fromCurrentNode">
9831
+ <xsl:call-template name="getLang_fromCurrentNode"/><xsl:value-of select=".//*[local-name() = 'p'][1]/@id"/>
9832
+ </xsl:template>
9833
+
9784
9834
  <xsl:template name="namespaceCheck">
9785
9835
  <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
9786
9836
  <xsl:variable name="XSLNS">
@@ -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 UN
3
- VERSION = "0.10.0".freeze
3
+ VERSION = "0.10.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-un
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.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: iso-639