metanorma-ribose 2.0.7 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06f3ac2765345f6611750588e9950f4d77f552665142fc737ce5fe8be375001c
4
- data.tar.gz: bb2b7c923e2945cbf3f0bdbb7a490d6042e753901301eb13559530b179a8287d
3
+ metadata.gz: '059b88946e08617f9a036ee2b91e80bc9214e327eab48afc92459ac70eb7448c'
4
+ data.tar.gz: de5db665aa4f2454b1776e6265c485694232949a083d8b9de5b6613c6b00fb81
5
5
  SHA512:
6
- metadata.gz: 745b5a44ef93701355dcddd77f59acdc3a256ca17b9d4d4c6b921cb43704ff19a949aa195197762ddb45aaa46361f5c8a8819b450f90910b8c41d616af50459a
7
- data.tar.gz: 38c1ce002c351d4e6a31f8c88f56a5ebd5910620d6d5e75231c354ba901a9a46a07d2712b791933b7ebad492f805e4939f4ffef098a18066574d9640e26ac8b2
6
+ metadata.gz: 1416372c9e996e68ecfb40f12986c67a9cd188c9dfd9dd712cfe55a31defd53ebb76075ca6b64b7c447a2e63371b47fd7006026038ee950101dcdcda3106b770
7
+ data.tar.gz: 56c4b7c06d00ba074d23f87430028418a590ce73132d76d33635892eee12047f93902ca2230008b3400e97f55e2ca7c189b82c18bdfc177dbb9cc37940b30448
@@ -54,7 +54,13 @@
54
54
 
55
55
  <xsl:template match="/">
56
56
  <xsl:call-template name="namespaceCheck"/>
57
- <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
57
+ <fo:root xml:lang="{$lang}">
58
+ <xsl:variable name="root-style">
59
+ <root-style xsl:use-attribute-sets="root-style"/>
60
+ </xsl:variable>
61
+ <xsl:call-template name="insertRootStyle">
62
+ <xsl:with-param name="root-style" select="$root-style"/>
63
+ </xsl:call-template>
58
64
  <fo:layout-master-set>
59
65
 
60
66
  <!-- Cover page -->
@@ -1361,7 +1367,30 @@
1361
1367
  <xsl:attribute name="color">rgb(88, 88, 90)</xsl:attribute>
1362
1368
 
1363
1369
 
1364
- </xsl:attribute-set><xsl:attribute-set name="copyright-statement-style">
1370
+ </xsl:attribute-set><xsl:template name="insertRootStyle">
1371
+ <xsl:param name="root-style"/>
1372
+ <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
1373
+
1374
+ <xsl:variable name="additional_fonts_">
1375
+ <xsl:for-each select="//*[local-name() = 'misc-container'][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
1376
+ <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
1377
+ </xsl:for-each>
1378
+ </xsl:variable>
1379
+ <xsl:variable name="additional_fonts" select="normalize-space($additional_fonts_)"/>
1380
+
1381
+ <xsl:for-each select="$root-style_/root-style/@*">
1382
+ <xsl:choose>
1383
+ <xsl:when test="local-name() = 'font-family' and $additional_fonts != ''">
1384
+ <xsl:attribute name="{local-name()}">
1385
+ <xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/>
1386
+ </xsl:attribute>
1387
+ </xsl:when>
1388
+ <xsl:otherwise>
1389
+ <xsl:copy-of select="."/>
1390
+ </xsl:otherwise>
1391
+ </xsl:choose>
1392
+ </xsl:for-each>
1393
+ </xsl:template><xsl:attribute-set name="copyright-statement-style">
1365
1394
 
1366
1395
  </xsl:attribute-set><xsl:attribute-set name="copyright-statement-title-style">
1367
1396
 
@@ -1909,15 +1938,15 @@
1909
1938
 
1910
1939
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1911
1940
 
1912
- </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1941
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1913
1942
 
1914
1943
 
1915
1944
 
1916
1945
 
1917
- <xsl:attribute name="font-weight">bold</xsl:attribute>
1918
- <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
1919
- <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
1920
-
1946
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1947
+ <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
1948
+ <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
1949
+
1921
1950
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1922
1951
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
1923
1952
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
@@ -4347,24 +4376,28 @@
4347
4376
  </xsl:template><xsl:template name="add-zero-spaces-equal">
4348
4377
  <xsl:param name="text" select="."/>
4349
4378
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
4379
+ <xsl:variable name="regex_zero-space-after-equals">(==========)</xsl:variable>
4350
4380
  <xsl:variable name="zero-space-after-equal">=</xsl:variable>
4381
+ <xsl:variable name="regex_zero-space-after-equal">(=)</xsl:variable>
4351
4382
  <xsl:variable name="zero-space">​</xsl:variable>
4352
4383
  <xsl:choose>
4353
4384
  <xsl:when test="contains($text, $zero-space-after-equals)">
4354
- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
4385
+ <!-- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
4355
4386
  <xsl:value-of select="$zero-space-after-equals"/>
4356
4387
  <xsl:value-of select="$zero-space"/>
4357
4388
  <xsl:call-template name="add-zero-spaces-equal">
4358
4389
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equals)"/>
4359
- </xsl:call-template>
4390
+ </xsl:call-template> -->
4391
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equals,concat('$1',$zero_width_space))"/>
4360
4392
  </xsl:when>
4361
4393
  <xsl:when test="contains($text, $zero-space-after-equal)">
4362
- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
4394
+ <!-- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
4363
4395
  <xsl:value-of select="$zero-space-after-equal"/>
4364
4396
  <xsl:value-of select="$zero-space"/>
4365
4397
  <xsl:call-template name="add-zero-spaces-equal">
4366
4398
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
4367
- </xsl:call-template>
4399
+ </xsl:call-template> -->
4400
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equal,concat('$1',$zero_width_space))"/>
4368
4401
  </xsl:when>
4369
4402
  <xsl:otherwise>
4370
4403
  <xsl:value-of select="$text"/>
@@ -4851,7 +4884,12 @@
4851
4884
 
4852
4885
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
4853
4886
 
4887
+ <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
4888
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
4889
+ </xsl:if>
4890
+
4854
4891
 
4892
+
4855
4893
 
4856
4894
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
4857
4895
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
@@ -5851,17 +5889,15 @@
5851
5889
 
5852
5890
  <!-- split text by zero-width space -->
5853
5891
  <xsl:variable name="text_step4">
5854
- <xsl:call-template name="split">
5892
+ <xsl:call-template name="split_for_interspers">
5855
5893
  <xsl:with-param name="pText" select="$text_step3"/>
5856
5894
  <xsl:with-param name="sep" select="$zero_width_space"/>
5857
- <xsl:with-param name="normalize-space">false</xsl:with-param>
5858
- <xsl:with-param name="keep_sep">true</xsl:with-param>
5859
5895
  </xsl:call-template>
5860
5896
  </xsl:variable>
5861
5897
 
5862
- <xsl:for-each select="xalan:nodeset($text_step4)/item">
5898
+ <xsl:for-each select="xalan:nodeset($text_step4)/node()">
5863
5899
  <xsl:choose>
5864
- <xsl:when test="string-length() &gt; 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
5900
+ <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
5865
5901
  <xsl:call-template name="interspers">
5866
5902
  <xsl:with-param name="str" select="."/>
5867
5903
  </xsl:call-template>
@@ -5872,6 +5908,30 @@
5872
5908
  </xsl:choose>
5873
5909
  </xsl:for-each>
5874
5910
 
5911
+ </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">
5912
+ <xsl:param name="pText" select="."/>
5913
+ <xsl:param name="sep" select="','"/>
5914
+ <!-- word with length more than 30 will be interspersed with zero-width space -->
5915
+ <xsl:variable name="regex" select="concat('([^', $zero_width_space, ']{31,})')"/> <!-- sequence of characters (more 31), that doesn't contains zero-width space -->
5916
+ <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new($pText),$regex,concat($interspers_tag_open,'$1',$interspers_tag_close))"/>
5917
+ <xsl:call-template name="replace_tag_interspers">
5918
+ <xsl:with-param name="text" select="$text"/>
5919
+ </xsl:call-template>
5920
+ </xsl:template><xsl:template name="replace_tag_interspers">
5921
+ <xsl:param name="text"/>
5922
+ <xsl:choose>
5923
+ <xsl:when test="contains($text, $interspers_tag_open)">
5924
+ <xsl:value-of select="substring-before($text, $interspers_tag_open)"/>
5925
+ <xsl:variable name="text_after" select="substring-after($text, $interspers_tag_open)"/>
5926
+ <interspers>
5927
+ <xsl:value-of select="substring-before($text_after, $interspers_tag_close)"/>
5928
+ </interspers>
5929
+ <xsl:call-template name="replace_tag_interspers">
5930
+ <xsl:with-param name="text" select="substring-after($text_after, $interspers_tag_close)"/>
5931
+ </xsl:call-template>
5932
+ </xsl:when>
5933
+ <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
5934
+ </xsl:choose>
5875
5935
  </xsl:template><xsl:template name="interspers">
5876
5936
  <xsl:param name="str"/>
5877
5937
  <xsl:param name="char" select="$zero_width_space"/>
@@ -6329,7 +6389,7 @@
6329
6389
  </xsl:otherwise>
6330
6390
  </xsl:choose> -->
6331
6391
  </fo:block>
6332
- </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ')]" priority="2">
6392
+ </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">
6333
6393
  <xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/>
6334
6394
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
6335
6395
  <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 Ribose
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-ribose
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