metanorma-csa 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: ad12d8a38ab08e75aefc9fb672d35b9e363980d1f71a61ae9b38c5af9e42fc4c
4
- data.tar.gz: 054c0100481db949965516221c1a7ae499d6b612461173c67f9ab133b34a885e
3
+ metadata.gz: 3f685276b592de3a6020087f07bffbe7e6b616a4fe297942b455f48ec609e858
4
+ data.tar.gz: af28b9eeffc3381c801ccddd18c31e67a69342938291a0c713bdfd2245418e8c
5
5
  SHA512:
6
- metadata.gz: eaa7d0cd126bb5b61ece5c2c625ba1c50460f085eda890ce4e68886ea8e1a8bf39188e4718340fceb65367fd312f4d60820b18ec197090e307142f95bdcc1ff2
7
- data.tar.gz: ce4a488caecc3d2620c88ed0b78c0994234e53544b85ada7e3e7704b62d162522f6d3d539263e50cb33cd9c3d091ce74a8c11ff4f3f9deec538bea96a1912873
6
+ metadata.gz: 1ba656baf21d649630fa8d9cb68050f6156b040f11604856553496ba34c9fac5056aca4bc15b44fc32e9697c744d5c6df19b177c9e0d6aca07855ae0259452a6
7
+ data.tar.gz: 7259d9fbef72983e99749dca8eee07bfb09d6d9a02bfd8f5a458c356ed46293385a5a37b6f27853eee0261f2758def49f066e351aa123fbcb87066e386313641
@@ -1346,6 +1346,12 @@
1346
1346
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1347
1347
  </xsl:attribute-set>
1348
1348
 
1349
+ <xsl:attribute-set name="figure-block-style">
1350
+
1351
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1352
+
1353
+ </xsl:attribute-set>
1354
+
1349
1355
  <xsl:attribute-set name="figure-style">
1350
1356
 
1351
1357
  </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">6pt</xsl:attribute>
1365
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
1360
1366
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1361
1367
 
1362
1368
  </xsl:attribute-set>
@@ -2765,6 +2771,10 @@
2765
2771
  <xsl:with-param name="continued">true</xsl:with-param>
2766
2772
  </xsl:apply-templates>
2767
2773
 
2774
+ <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
2775
+ <fo:block/>
2776
+ </xsl:if>
2777
+
2768
2778
  </fo:table-cell>
2769
2779
  </fo:table-row>
2770
2780
  </xsl:template> <!-- table-header-title -->
@@ -3149,7 +3159,22 @@
3149
3159
 
3150
3160
  <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3151
3161
  <xsl:variable name="footnote_inline">
3152
- <fo:inline xsl:use-attribute-sets="fn-num-style">
3162
+ <fo:inline>
3163
+
3164
+ <xsl:variable name="fn_styles">
3165
+ <xsl:choose>
3166
+ <xsl:when test="ancestor::*[local-name() = 'bibitem']">
3167
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
3168
+ </xsl:when>
3169
+ <xsl:otherwise>
3170
+ <fn_styles xsl:use-attribute-sets="fn-num-style"/>
3171
+ </xsl:otherwise>
3172
+ </xsl:choose>
3173
+ </xsl:variable>
3174
+
3175
+ <xsl:for-each select="xalan:nodeset($fn_styles)/fn_styles/@*">
3176
+ <xsl:copy-of select="."/>
3177
+ </xsl:for-each>
3153
3178
 
3154
3179
  <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
3155
3180
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
@@ -3213,7 +3238,10 @@
3213
3238
  </xsl:for-each>
3214
3239
  <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']/*">
3215
3240
  <xsl:sort select="@displayorder" data-type="number"/>
3216
- <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])]">
3241
+ <!-- commented:
3242
+ .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
3243
+ because 'fn' there is in biblio-tag -->
3244
+ <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])]">
3217
3245
  <!-- copy unique fn -->
3218
3246
  <fn gen_id="{generate-id(.)}">
3219
3247
  <xsl:copy-of select="@*"/>
@@ -4064,7 +4092,7 @@
4064
4092
  10
4065
4093
 
4066
4094
 
4067
- <!-- 10 -->
4095
+ <!-- inherit -->
4068
4096
 
4069
4097
  </xsl:variable>
4070
4098
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -5032,6 +5060,33 @@
5032
5060
  </xsl:choose>
5033
5061
  </xsl:template>
5034
5062
 
5063
+ <xsl:template name="getLang_fromCurrentNode">
5064
+ <xsl:variable name="language_current" select="normalize-space(.//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5065
+ <xsl:variable name="language">
5066
+ <xsl:choose>
5067
+ <xsl:when test="$language_current != ''">
5068
+ <xsl:value-of select="$language_current"/>
5069
+ </xsl:when>
5070
+ <xsl:otherwise>
5071
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
5072
+ <xsl:choose>
5073
+ <xsl:when test="$language_current_2 != ''">
5074
+ <xsl:value-of select="$language_current_2"/>
5075
+ </xsl:when>
5076
+ <xsl:otherwise>
5077
+ <xsl:value-of select=".//*[local-name()='bibdata']//*[local-name()='language']"/>
5078
+ </xsl:otherwise>
5079
+ </xsl:choose>
5080
+ </xsl:otherwise>
5081
+ </xsl:choose>
5082
+ </xsl:variable>
5083
+
5084
+ <xsl:choose>
5085
+ <xsl:when test="$language = 'English'">en</xsl:when>
5086
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
5087
+ </xsl:choose>
5088
+ </xsl:template>
5089
+
5035
5090
  <xsl:template name="capitalizeWords">
5036
5091
  <xsl:param name="str"/>
5037
5092
  <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
@@ -5650,7 +5705,7 @@
5650
5705
  <xsl:template match="*[local-name() = 'figure']" name="figure">
5651
5706
  <xsl:variable name="isAdded" select="@added"/>
5652
5707
  <xsl:variable name="isDeleted" select="@deleted"/>
5653
- <fo:block-container id="{@id}">
5708
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
5654
5709
 
5655
5710
  <xsl:call-template name="setTrackChangesStyles">
5656
5711
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -6636,7 +6691,13 @@
6636
6691
  </xsl:template>
6637
6692
 
6638
6693
  <xsl:template match="text()" mode="contents_item">
6639
- <xsl:call-template name="keep_together_standard_number"/>
6694
+ <xsl:variable name="text">
6695
+ <!-- to split by '_' and other chars -->
6696
+ <text><xsl:call-template name="add-zero-spaces-java"/></text>
6697
+ </xsl:variable>
6698
+ <xsl:for-each select="xalan:nodeset($text)/text/text()">
6699
+ <xsl:call-template name="keep_together_standard_number"/>
6700
+ </xsl:for-each>
6640
6701
  </xsl:template>
6641
6702
 
6642
6703
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
@@ -6647,36 +6708,54 @@
6647
6708
  <!-- =============== -->
6648
6709
  <!-- sourcecode -->
6649
6710
  <!-- =============== -->
6650
- <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
6651
6711
 
6652
- <xsl:variable name="sourcecode_attributes">
6653
- <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
6654
- <xsl:variable name="_font-size">
6655
- 10
6712
+ <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
6713
+ <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
6714
+ <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
6656
6715
 
6716
+ <xsl:template match="*[local-name() = 'property']" mode="css">
6717
+ <xsl:attribute name="{@name}">
6718
+ <xsl:value-of select="@value"/>
6719
+ </xsl:attribute>
6720
+ </xsl:template>
6657
6721
 
6658
- <!-- 9 -->
6722
+ <xsl:template name="get_sourcecode_attributes">
6723
+ <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
6724
+ <xsl:variable name="_font-size">
6725
+ 10
6659
6726
 
6660
- <!-- <xsl:if test="$namespace = 'ieee'">
6661
- <xsl:if test="$current_template = 'standard'">8</xsl:if>
6662
- </xsl:if> -->
6663
6727
 
6664
- </xsl:variable>
6728
+ <!-- inherit -->
6665
6729
 
6666
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
6667
- <xsl:if test="$font-size != ''">
6668
- <xsl:attribute name="font-size">
6669
- <xsl:choose>
6670
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
6671
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
6672
- <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
6673
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
6674
- </xsl:choose>
6675
- </xsl:attribute>
6676
- </xsl:if>
6677
- </xsl:element>
6730
+ <!-- <xsl:if test="$namespace = 'ieee'">
6731
+ <xsl:if test="$current_template = 'standard'">8</xsl:if>
6732
+ </xsl:if> -->
6733
+
6734
+ </xsl:variable>
6735
+
6736
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
6737
+ <xsl:if test="$font-size != ''">
6738
+ <xsl:attribute name="font-size">
6739
+ <xsl:choose>
6740
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
6741
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
6742
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
6743
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
6744
+ </xsl:choose>
6745
+ </xsl:attribute>
6746
+ </xsl:if>
6747
+ <xsl:apply-templates select="$sourcecode_css//class[@name = 'sourcecode']" mode="css"/>
6748
+ </xsl:element>
6749
+ </xsl:template>
6750
+
6751
+ <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
6752
+
6753
+ <xsl:variable name="sourcecode_attributes">
6754
+ <xsl:call-template name="get_sourcecode_attributes"/>
6678
6755
  </xsl:variable>
6679
6756
 
6757
+ <!-- <xsl:copy-of select="$sourcecode_css"/> -->
6758
+
6680
6759
  <xsl:choose>
6681
6760
  <xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
6682
6761
  <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
@@ -6730,9 +6809,10 @@
6730
6809
  </xsl:choose>
6731
6810
  </xsl:template>
6732
6811
 
6733
- <xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
6812
+ <xsl:template match="*[local-name()='sourcecode']/text() | *[local-name()='sourcecode']//*[local-name()='span']/text()" priority="2">
6734
6813
  <xsl:choose>
6735
- <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
6814
+ <!-- disabled -->
6815
+ <xsl:when test="1 = 2 and normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
6736
6816
  <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
6737
6817
  <xsl:choose>
6738
6818
  <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
@@ -6747,8 +6827,75 @@
6747
6827
  <xsl:call-template name="add_spaces_to_sourcecode"/>
6748
6828
  </xsl:otherwise>
6749
6829
  </xsl:choose>
6830
+ </xsl:template>
6831
+
6832
+ <!-- add sourcecode highlighting -->
6833
+ <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
6834
+ <xsl:variable name="class" select="@class"/>
6835
+ <xsl:choose>
6836
+ <xsl:when test="$sourcecode_css//class[@name = $class]">
6837
+ <fo:inline>
6838
+ <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
6839
+ <xsl:apply-templates/>
6840
+ </fo:inline>
6841
+ </xsl:when>
6842
+ <xsl:otherwise>
6843
+ <xsl:apply-templates/>
6844
+ </xsl:otherwise>
6845
+ </xsl:choose>
6846
+ </xsl:template>
6750
6847
 
6848
+ <!-- outer table with line numbers for sourcecode -->
6849
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
6850
+ <fo:block>
6851
+ <fo:table width="100%" table-layout="fixed">
6852
+ <xsl:copy-of select="@id"/>
6853
+ <fo:table-column column-width="8%"/>
6854
+ <fo:table-column column-width="92%"/>
6855
+ <fo:table-body>
6856
+ <xsl:apply-templates/>
6857
+ </fo:table-body>
6858
+ </fo:table>
6859
+ </fo:block>
6860
+ </xsl:template>
6861
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
6862
+ <xsl:apply-templates/>
6863
+ </xsl:template>
6864
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
6865
+ <fo:table-row>
6866
+ <xsl:apply-templates/>
6867
+ </fo:table-row>
6868
+ </xsl:template>
6869
+ <!-- first td with line numbers -->
6870
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
6871
+ <fo:table-cell>
6872
+ <fo:block>
6873
+
6874
+ <!-- set attibutes for line numbers - same as sourcecode -->
6875
+ <xsl:variable name="sourcecode_attributes">
6876
+ <xsl:for-each select="following-sibling::*[local-name() = 'td']/*[local-name() = 'sourcecode']">
6877
+ <xsl:call-template name="get_sourcecode_attributes"/>
6878
+ </xsl:for-each>
6879
+ </xsl:variable>
6880
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
6881
+ <xsl:attribute name="{local-name()}">
6882
+ <xsl:value-of select="."/>
6883
+ </xsl:attribute>
6884
+ </xsl:for-each>
6885
+
6886
+ <xsl:apply-templates/>
6887
+ </fo:block>
6888
+ </fo:table-cell>
6889
+ </xsl:template>
6890
+ <!-- second td with sourcecode -->
6891
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
6892
+ <fo:table-cell>
6893
+ <fo:block>
6894
+ <xsl:apply-templates/>
6895
+ </fo:block>
6896
+ </fo:table-cell>
6751
6897
  </xsl:template>
6898
+ <!-- END outer table with line numbers for sourcecode -->
6752
6899
 
6753
6900
  <xsl:template name="add_spaces_to_sourcecode">
6754
6901
  <xsl:variable name="text_step1">
@@ -8417,203 +8564,59 @@
8417
8564
 
8418
8565
  <!-- start CSA bibitem processing -->
8419
8566
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-style">
8420
-
8421
- <xsl:variable name="docidentifier">
8422
- <xsl:value-of select="csa:docidentifier[@type = 'metanorma-ordinal']"/>
8423
- <xsl:if test="not(csa:docidentifier[@type = 'metanorma-ordinal'])">
8424
- <xsl:number format="[1]" count="*[local-name()='bibitem'][not(@hidden = 'true')]"/>
8425
- </xsl:if>
8426
- </xsl:variable>
8427
-
8428
- <xsl:value-of select="$docidentifier"/>
8429
- <xsl:apply-templates select="*[local-name() = 'note']"/>
8430
- <xsl:text> </xsl:text>
8431
-
8567
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']"/>
8432
8568
  <xsl:apply-templates select="csa:formattedref"/>
8433
-
8434
8569
  </fo:block>
8435
8570
  <!-- END CSA bibitem processing -->
8436
8571
 
8437
8572
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
8438
8573
 
8439
8574
  <xsl:template name="processBibitem">
8575
+ <xsl:param name="biblio_tag_part">both</xsl:param>
8440
8576
 
8441
8577
  <!-- start bibitem processing -->
8442
8578
  <xsl:if test=".//*[local-name() = 'fn']">
8443
8579
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
8444
8580
  </xsl:if>
8445
8581
 
8446
- <!-- display document identifier, not number [1] -->
8447
- <xsl:variable name="docidentifier">
8448
- <xsl:choose>
8449
- <xsl:when test="*[local-name() = 'docidentifier']/@type = 'metanorma'"/>
8450
- <xsl:otherwise><xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma-ordinal')]"/></xsl:otherwise>
8451
- </xsl:choose>
8452
- </xsl:variable>
8453
- <xsl:value-of select="$docidentifier"/>
8454
-
8455
- <xsl:apply-templates select="*[local-name() = 'note']"/>
8456
-
8457
- <xsl:if test="normalize-space($docidentifier) != '' and *[local-name() = 'formattedref']">
8458
-
8459
- <xsl:text> </xsl:text>
8460
- </xsl:if>
8461
-
8582
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
8583
+ <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
8584
+ </xsl:apply-templates>
8462
8585
  <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
8463
8586
  <!-- end bibitem processing -->
8464
8587
 
8465
8588
  </xsl:template> <!-- processBibitem (bibitem) -->
8466
8589
 
8467
- <xsl:template name="processBibitemDocId">
8468
- <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')]"/>
8469
- <xsl:choose>
8470
- <xsl:when test="normalize-space($_doc_ident) != ''">
8471
- <!-- <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"/>
8472
- <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
8473
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
8474
- </xsl:if> -->
8475
- <xsl:value-of select="$_doc_ident"/>
8476
- </xsl:when>
8477
- <xsl:otherwise>
8478
- <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
8479
- <xsl:if test="$type != ''">
8480
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
8481
- </xsl:if> -->
8482
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
8483
- </xsl:otherwise>
8484
- </xsl:choose>
8485
- </xsl:template> <!-- processBibitemDocId -->
8590
+ <xsl:template match="*[local-name() = 'title']" mode="title">
8591
+ <fo:inline><xsl:apply-templates/></fo:inline>
8592
+ </xsl:template>
8593
+
8594
+ <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
8486
8595
 
8487
- <xsl:template name="processPersonalAuthor">
8596
+ <xsl:template match="*[local-name() = 'formattedref']">
8597
+ <!-- <xsl:if test="$namespace = 'unece' or $namespace = 'unece-rec'">
8598
+ <xsl:text>, </xsl:text>
8599
+ </xsl:if> -->
8600
+ <xsl:apply-templates/>
8601
+ </xsl:template>
8602
+
8603
+ <xsl:template match="*[local-name() = 'biblio-tag']">
8604
+ <xsl:param name="biblio_tag_part">both</xsl:param>
8488
8605
  <xsl:choose>
8489
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
8490
- <author>
8491
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
8492
- </author>
8606
+ <xsl:when test="$biblio_tag_part = 'first' and *[local-name() = 'tab']">
8607
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
8493
8608
  </xsl:when>
8494
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
8495
- <author>
8496
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
8497
- <xsl:text> </xsl:text>
8498
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
8499
- </author>
8500
- </xsl:when>
8501
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
8502
- <author>
8503
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
8504
- <xsl:text> </xsl:text>
8505
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
8506
- </author>
8609
+ <xsl:when test="$biblio_tag_part = 'last'">
8610
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
8507
8611
  </xsl:when>
8508
8612
  <xsl:otherwise>
8509
8613
  <xsl:apply-templates/>
8510
8614
  </xsl:otherwise>
8511
8615
  </xsl:choose>
8512
- </xsl:template> <!-- processPersonalAuthor -->
8513
-
8514
- <xsl:template name="renderDate">
8515
- <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
8516
- <xsl:value-of select="*[local-name() = 'on']"/>
8517
- </xsl:if>
8518
- <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
8519
- <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
8520
- </xsl:if>
8521
- </xsl:template>
8522
-
8523
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
8524
- <xsl:value-of select="translate(.,'. ','')"/>
8525
- </xsl:template>
8526
-
8527
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
8528
- <xsl:value-of select="substring(.,1,1)"/>
8529
- </xsl:template>
8530
-
8531
- <xsl:template match="*[local-name() = 'title']" mode="title">
8532
- <fo:inline><xsl:apply-templates/></fo:inline>
8533
- </xsl:template>
8534
-
8535
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
8536
- <!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
8537
- <fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
8538
- <xsl:apply-templates/>
8539
- </fo:inline>
8540
8616
  </xsl:template>
8541
8617
 
8542
- <!-- bibitem/note renders as footnote -->
8543
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
8544
-
8545
- <!-- list of footnotes to calculate actual footnotes number -->
8546
- <xsl:variable name="p_fn_">
8547
- <xsl:call-template name="get_fn_list"/>
8548
- </xsl:variable>
8549
- <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
8550
- <xsl:variable name="gen_id" select="generate-id(.)"/>
8551
- <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
8552
- <!-- fn sequence number in document -->
8553
- <xsl:variable name="current_fn_number">
8554
- <xsl:choose>
8555
- <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
8556
- <xsl:otherwise>
8557
- <!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
8558
- <xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
8559
- </xsl:otherwise>
8560
- </xsl:choose>
8561
- </xsl:variable>
8562
- <fo:footnote>
8563
- <xsl:variable name="number">
8564
-
8565
- <xsl:choose>
8566
- <xsl:when test="ancestor::*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]">
8567
- <xsl:number level="any" count="*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]//*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
8568
- </xsl:when>
8569
- <xsl:otherwise>
8570
- <xsl:value-of select="$current_fn_number"/>
8571
- </xsl:otherwise>
8572
- </xsl:choose>
8573
-
8574
- </xsl:variable>
8575
-
8576
- <xsl:variable name="current_fn_number_text">
8577
- <xsl:value-of select="$number"/>
8578
-
8579
- </xsl:variable>
8580
-
8581
- <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
8582
- <fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
8583
- <xsl:value-of select="$current_fn_number_text"/>
8584
- </fo:basic-link>
8585
- </fo:inline>
8586
- <fo:footnote-body>
8587
- <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
8588
- <fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
8589
- <xsl:value-of select="$current_fn_number_text"/>
8590
- </fo:inline>
8591
- <xsl:apply-templates/>
8592
- </fo:block>
8593
- </fo:footnote-body>
8594
- </fo:footnote>
8595
- </xsl:template>
8596
-
8597
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
8598
- <xsl:text> edition </xsl:text>
8599
- <xsl:value-of select="."/>
8600
- </xsl:template>
8601
-
8602
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
8603
- <xsl:text> (</xsl:text>
8604
- <fo:inline xsl:use-attribute-sets="link-style">
8605
- <fo:basic-link external-destination="." fox:alt-text=".">
8606
- <xsl:value-of select="."/>
8607
- </fo:basic-link>
8608
- </fo:inline>
8609
- <xsl:text>)</xsl:text>
8610
- </xsl:template>
8611
-
8612
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
8613
-
8614
- <xsl:template match="*[local-name() = 'formattedref']">
8615
-
8616
- <xsl:apply-templates/>
8618
+ <xsl:template match="*[local-name() = 'biblio-tag']/*[local-name() = 'tab']" priority="2">
8619
+ <xsl:text> </xsl:text>
8617
8620
  </xsl:template>
8618
8621
 
8619
8622
  <!-- ======================= -->
@@ -9038,6 +9041,12 @@
9038
9041
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
9039
9042
  <xsl:apply-templates mode="update_xml_step1"/>
9040
9043
  </xsl:template>
9044
+ <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
9045
+ <xsl:copy>
9046
+ <xsl:copy-of select="@*"/>
9047
+ <xsl:apply-templates mode="update_xml_step1"/>
9048
+ </xsl:copy>
9049
+ </xsl:template>
9041
9050
  <!-- =========================================================================== -->
9042
9051
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9043
9052
  <!-- =========================================================================== -->
@@ -9518,6 +9527,10 @@
9518
9527
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
9519
9528
  </xsl:template>
9520
9529
 
9530
+ <xsl:template name="getDocumentId_fromCurrentNode">
9531
+ <xsl:call-template name="getLang_fromCurrentNode"/><xsl:value-of select=".//*[local-name() = 'p'][1]/@id"/>
9532
+ </xsl:template>
9533
+
9521
9534
  <xsl:template name="namespaceCheck">
9522
9535
  <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
9523
9536
  <xsl:variable name="XSLNS">
@@ -596,8 +596,11 @@ a:hover {
596
596
  background: #4D7EA5;
597
597
  box-shadow: 3px 0 0 #4D7EA5, -3px 0 0 #4D7EA5; }
598
598
 
599
- ::selection,
600
- ::-moz-selection {
599
+ *::selection {
600
+ background: #4D7EA5;
601
+ color: white; }
602
+
603
+ *::-moz-selection {
601
604
  background: #4D7EA5;
602
605
  color: white; }
603
606
 
@@ -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 Csa
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-csa
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