metanorma-csa 2.0.7 → 2.0.8

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: 3b0a1705cdddcbb2d90adb9ec5afb73ea1b146b4c4ef5429427b62ee88992525
4
- data.tar.gz: aba8725802eacee441af7594229d1f587759008a065d4b1a6c15180d4f7ff90b
3
+ metadata.gz: 4383aed015d0b125c68bf6d02dbbd93688b6672c8b302295c181ebae7df9cd24
4
+ data.tar.gz: 46df39c4b6a759009ba2ea03fcc45e850348f5bc6c2370dfec1b7b2ff5f59577
5
5
  SHA512:
6
- metadata.gz: 491b5bd8d6ade019c40461496de89fc152f7a7517968d4516fb15afdac036900bdec5409f7428a2991dae29a83a85e0c2c6e44dc29e6f2197dab3ad51887b417
7
- data.tar.gz: 71f599ff9ff0e5a5cf6bf9099ee0160a6741c5cc68502f3f1bd56643484b4904c128b4d38dda23fe83facfe2d8f319e7ed4cdb84af077e846bf09d72d714ad22
6
+ metadata.gz: f7b3ff486721934e1f41fefaef1b4fc8227b7ca6ba593092abca761366d1b2be6005c554c002b104b9d2c400168563310a7f184764ee063f0383c4e1a2200e62
7
+ data.tar.gz: 828d2554c73bdb4b725ad8d74e802550f3684d236c8e4d92b49c9a11695192dc5cb7e5461fe6a7b6bfe8a9716ba1e183d283969119ea422ac26f3d4a34fb6ea5
@@ -27,7 +27,13 @@
27
27
 
28
28
  <xsl:template match="/">
29
29
  <xsl:call-template name="namespaceCheck"/>
30
- <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
30
+ <fo:root xml:lang="{$lang}">
31
+ <xsl:variable name="root-style">
32
+ <root-style xsl:use-attribute-sets="root-style"/>
33
+ </xsl:variable>
34
+ <xsl:call-template name="insertRootStyle">
35
+ <xsl:with-param name="root-style" select="$root-style"/>
36
+ </xsl:call-template>
31
37
  <fo:layout-master-set>
32
38
  <!-- Cover page -->
33
39
  <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
@@ -717,7 +723,30 @@
717
723
 
718
724
 
719
725
 
720
- </xsl:attribute-set><xsl:attribute-set name="copyright-statement-style">
726
+ </xsl:attribute-set><xsl:template name="insertRootStyle">
727
+ <xsl:param name="root-style"/>
728
+ <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
729
+
730
+ <xsl:variable name="additional_fonts_">
731
+ <xsl:for-each select="//*[local-name() = 'misc-container'][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
732
+ <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
733
+ </xsl:for-each>
734
+ </xsl:variable>
735
+ <xsl:variable name="additional_fonts" select="normalize-space($additional_fonts_)"/>
736
+
737
+ <xsl:for-each select="$root-style_/root-style/@*">
738
+ <xsl:choose>
739
+ <xsl:when test="local-name() = 'font-family' and $additional_fonts != ''">
740
+ <xsl:attribute name="{local-name()}">
741
+ <xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/>
742
+ </xsl:attribute>
743
+ </xsl:when>
744
+ <xsl:otherwise>
745
+ <xsl:copy-of select="."/>
746
+ </xsl:otherwise>
747
+ </xsl:choose>
748
+ </xsl:for-each>
749
+ </xsl:template><xsl:attribute-set name="copyright-statement-style">
721
750
 
722
751
  </xsl:attribute-set><xsl:attribute-set name="copyright-statement-title-style">
723
752
 
@@ -1221,7 +1250,7 @@
1221
1250
 
1222
1251
 
1223
1252
 
1224
- </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1253
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1225
1254
 
1226
1255
 
1227
1256
 
@@ -3610,24 +3639,28 @@
3610
3639
  </xsl:template><xsl:template name="add-zero-spaces-equal">
3611
3640
  <xsl:param name="text" select="."/>
3612
3641
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
3642
+ <xsl:variable name="regex_zero-space-after-equals">(==========)</xsl:variable>
3613
3643
  <xsl:variable name="zero-space-after-equal">=</xsl:variable>
3644
+ <xsl:variable name="regex_zero-space-after-equal">(=)</xsl:variable>
3614
3645
  <xsl:variable name="zero-space">​</xsl:variable>
3615
3646
  <xsl:choose>
3616
3647
  <xsl:when test="contains($text, $zero-space-after-equals)">
3617
- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
3648
+ <!-- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
3618
3649
  <xsl:value-of select="$zero-space-after-equals"/>
3619
3650
  <xsl:value-of select="$zero-space"/>
3620
3651
  <xsl:call-template name="add-zero-spaces-equal">
3621
3652
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equals)"/>
3622
- </xsl:call-template>
3653
+ </xsl:call-template> -->
3654
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equals,concat('$1',$zero_width_space))"/>
3623
3655
  </xsl:when>
3624
3656
  <xsl:when test="contains($text, $zero-space-after-equal)">
3625
- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
3657
+ <!-- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
3626
3658
  <xsl:value-of select="$zero-space-after-equal"/>
3627
3659
  <xsl:value-of select="$zero-space"/>
3628
3660
  <xsl:call-template name="add-zero-spaces-equal">
3629
3661
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
3630
- </xsl:call-template>
3662
+ </xsl:call-template> -->
3663
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equal,concat('$1',$zero_width_space))"/>
3631
3664
  </xsl:when>
3632
3665
  <xsl:otherwise>
3633
3666
  <xsl:value-of select="$text"/>
@@ -4107,7 +4140,12 @@
4107
4140
 
4108
4141
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
4109
4142
 
4143
+ <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
4144
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
4145
+ </xsl:if>
4146
+
4110
4147
 
4148
+
4111
4149
 
4112
4150
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
4113
4151
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
@@ -5085,17 +5123,15 @@
5085
5123
 
5086
5124
  <!-- split text by zero-width space -->
5087
5125
  <xsl:variable name="text_step4">
5088
- <xsl:call-template name="split">
5126
+ <xsl:call-template name="split_for_interspers">
5089
5127
  <xsl:with-param name="pText" select="$text_step3"/>
5090
5128
  <xsl:with-param name="sep" select="$zero_width_space"/>
5091
- <xsl:with-param name="normalize-space">false</xsl:with-param>
5092
- <xsl:with-param name="keep_sep">true</xsl:with-param>
5093
5129
  </xsl:call-template>
5094
5130
  </xsl:variable>
5095
5131
 
5096
- <xsl:for-each select="xalan:nodeset($text_step4)/item">
5132
+ <xsl:for-each select="xalan:nodeset($text_step4)/node()">
5097
5133
  <xsl:choose>
5098
- <xsl:when test="string-length() &gt; 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
5134
+ <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
5099
5135
  <xsl:call-template name="interspers">
5100
5136
  <xsl:with-param name="str" select="."/>
5101
5137
  </xsl:call-template>
@@ -5106,6 +5142,30 @@
5106
5142
  </xsl:choose>
5107
5143
  </xsl:for-each>
5108
5144
 
5145
+ </xsl:template><xsl:variable name="interspers_tag_open">###interspers123###</xsl:variable><xsl:variable name="interspers_tag_close">###/interspers123###</xsl:variable><xsl:template name="split_for_interspers">
5146
+ <xsl:param name="pText" select="."/>
5147
+ <xsl:param name="sep" select="','"/>
5148
+ <!-- word with length more than 30 will be interspersed with zero-width space -->
5149
+ <xsl:variable name="regex" select="concat('([^', $zero_width_space, ']{31,})')"/> <!-- sequence of characters (more 31), that doesn't contains zero-width space -->
5150
+ <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new($pText),$regex,concat($interspers_tag_open,'$1',$interspers_tag_close))"/>
5151
+ <xsl:call-template name="replace_tag_interspers">
5152
+ <xsl:with-param name="text" select="$text"/>
5153
+ </xsl:call-template>
5154
+ </xsl:template><xsl:template name="replace_tag_interspers">
5155
+ <xsl:param name="text"/>
5156
+ <xsl:choose>
5157
+ <xsl:when test="contains($text, $interspers_tag_open)">
5158
+ <xsl:value-of select="substring-before($text, $interspers_tag_open)"/>
5159
+ <xsl:variable name="text_after" select="substring-after($text, $interspers_tag_open)"/>
5160
+ <interspers>
5161
+ <xsl:value-of select="substring-before($text_after, $interspers_tag_close)"/>
5162
+ </interspers>
5163
+ <xsl:call-template name="replace_tag_interspers">
5164
+ <xsl:with-param name="text" select="substring-after($text_after, $interspers_tag_close)"/>
5165
+ </xsl:call-template>
5166
+ </xsl:when>
5167
+ <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
5168
+ </xsl:choose>
5109
5169
  </xsl:template><xsl:template name="interspers">
5110
5170
  <xsl:param name="str"/>
5111
5171
  <xsl:param name="char" select="$zero_width_space"/>
@@ -5553,7 +5613,7 @@
5553
5613
  </xsl:otherwise>
5554
5614
  </xsl:choose> -->
5555
5615
  </fo:block>
5556
- </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ')]" priority="2">
5616
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ') or starts-with(., '[SOURCE: Quoted from: ') or starts-with(., '[SOURCE: Modified from: ')]" priority="2">
5557
5617
  <xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/>
5558
5618
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
5559
5619
  <xsl:if test="normalize-space() != ''">
@@ -527,7 +527,7 @@
527
527
  </define>
528
528
  <define name="LocalityType">
529
529
  <data type="string">
530
- <param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
530
+ <param name="pattern">section|clause|part|paragraph|chapter|page|title|line|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
531
531
  </data>
532
532
  </define>
533
533
  <define name="referenceFrom">
@@ -677,6 +677,9 @@
677
677
  <zeroOrMore>
678
678
  <ref name="extent"/>
679
679
  </zeroOrMore>
680
+ <optional>
681
+ <ref name="bibliographic_size"/>
682
+ </optional>
680
683
  <zeroOrMore>
681
684
  <ref name="accesslocation"/>
682
685
  </zeroOrMore>
@@ -922,9 +925,29 @@
922
925
  <text/>
923
926
  </element>
924
927
  </define>
928
+ <define name="sizevalue">
929
+ <element name="value">
930
+ <attribute name="type"/>
931
+ <text/>
932
+ </element>
933
+ </define>
934
+ <define name="bibliographic_size">
935
+ <element name="size">
936
+ <oneOrMore>
937
+ <ref name="sizevalue"/>
938
+ </oneOrMore>
939
+ </element>
940
+ </define>
925
941
  <define name="extent">
926
942
  <element name="extent">
927
- <ref name="BibItemLocality"/>
943
+ <choice>
944
+ <zeroOrMore>
945
+ <ref name="locality"/>
946
+ </zeroOrMore>
947
+ <zeroOrMore>
948
+ <ref name="localityStack"/>
949
+ </zeroOrMore>
950
+ </choice>
928
951
  </element>
929
952
  </define>
930
953
  <define name="series">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csa
3
- VERSION = "2.0.7".freeze
3
+ VERSION = "2.0.8".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.0.7
4
+ version: 2.0.8
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-04-04 00:00:00.000000000 Z
11
+ date: 2022-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic