metanorma-cc 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 +4 -4
- data/lib/isodoc/cc/cc.standard.xsl +73 -13
- data/lib/metanorma/cc/biblio.rng +25 -2
- data/lib/metanorma/cc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4e32f9f56124c2b505b0c200b08218fe707fdfcf6a5a90eb2cb8be3c303ab6e
|
4
|
+
data.tar.gz: a0c8c48ff1a1150c8a4ec42c7db5f22bdef611269b2ae4977eed54ce0b5181fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ffa0ec8f2ae42a01735fec0ec2b9b528aa7a530ebe219b371a56d48c85893a373d7473ed46f95950b312bca2d76bdf89400833cfcc79f35e6cf5f07ffc14538
|
7
|
+
data.tar.gz: 7500c23346c84d5de86c11fecbc8888b0b52c1cdab2f66cd7b12322ea3cf4e574e339e6d293a52d421d023e8462c617cf7b933a2c1805c6146dde15243b155d0
|
@@ -32,7 +32,13 @@
|
|
32
32
|
|
33
33
|
<xsl:template match="/">
|
34
34
|
<xsl:call-template name="namespaceCheck"/>
|
35
|
-
<fo:root
|
35
|
+
<fo:root xml:lang="{$lang}">
|
36
|
+
<xsl:variable name="root-style">
|
37
|
+
<root-style xsl:use-attribute-sets="root-style"/>
|
38
|
+
</xsl:variable>
|
39
|
+
<xsl:call-template name="insertRootStyle">
|
40
|
+
<xsl:with-param name="root-style" select="$root-style"/>
|
41
|
+
</xsl:call-template>
|
36
42
|
<fo:layout-master-set>
|
37
43
|
<!-- Cover page -->
|
38
44
|
<fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
@@ -712,7 +718,30 @@
|
|
712
718
|
|
713
719
|
|
714
720
|
|
715
|
-
</xsl:attribute-set><xsl:
|
721
|
+
</xsl:attribute-set><xsl:template name="insertRootStyle">
|
722
|
+
<xsl:param name="root-style"/>
|
723
|
+
<xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
|
724
|
+
|
725
|
+
<xsl:variable name="additional_fonts_">
|
726
|
+
<xsl:for-each select="//*[local-name() = 'misc-container'][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
|
727
|
+
<xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
|
728
|
+
</xsl:for-each>
|
729
|
+
</xsl:variable>
|
730
|
+
<xsl:variable name="additional_fonts" select="normalize-space($additional_fonts_)"/>
|
731
|
+
|
732
|
+
<xsl:for-each select="$root-style_/root-style/@*">
|
733
|
+
<xsl:choose>
|
734
|
+
<xsl:when test="local-name() = 'font-family' and $additional_fonts != ''">
|
735
|
+
<xsl:attribute name="{local-name()}">
|
736
|
+
<xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/>
|
737
|
+
</xsl:attribute>
|
738
|
+
</xsl:when>
|
739
|
+
<xsl:otherwise>
|
740
|
+
<xsl:copy-of select="."/>
|
741
|
+
</xsl:otherwise>
|
742
|
+
</xsl:choose>
|
743
|
+
</xsl:for-each>
|
744
|
+
</xsl:template><xsl:attribute-set name="copyright-statement-style">
|
716
745
|
|
717
746
|
</xsl:attribute-set><xsl:attribute-set name="copyright-statement-title-style">
|
718
747
|
|
@@ -1225,7 +1254,7 @@
|
|
1225
1254
|
|
1226
1255
|
|
1227
1256
|
|
1228
|
-
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
1257
|
+
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
1229
1258
|
|
1230
1259
|
|
1231
1260
|
|
@@ -3581,24 +3610,28 @@
|
|
3581
3610
|
</xsl:template><xsl:template name="add-zero-spaces-equal">
|
3582
3611
|
<xsl:param name="text" select="."/>
|
3583
3612
|
<xsl:variable name="zero-space-after-equals">==========</xsl:variable>
|
3613
|
+
<xsl:variable name="regex_zero-space-after-equals">(==========)</xsl:variable>
|
3584
3614
|
<xsl:variable name="zero-space-after-equal">=</xsl:variable>
|
3615
|
+
<xsl:variable name="regex_zero-space-after-equal">(=)</xsl:variable>
|
3585
3616
|
<xsl:variable name="zero-space"></xsl:variable>
|
3586
3617
|
<xsl:choose>
|
3587
3618
|
<xsl:when test="contains($text, $zero-space-after-equals)">
|
3588
|
-
<xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
|
3619
|
+
<!-- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
|
3589
3620
|
<xsl:value-of select="$zero-space-after-equals"/>
|
3590
3621
|
<xsl:value-of select="$zero-space"/>
|
3591
3622
|
<xsl:call-template name="add-zero-spaces-equal">
|
3592
3623
|
<xsl:with-param name="text" select="substring-after($text, $zero-space-after-equals)"/>
|
3593
|
-
</xsl:call-template>
|
3624
|
+
</xsl:call-template> -->
|
3625
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equals,concat('$1',$zero_width_space))"/>
|
3594
3626
|
</xsl:when>
|
3595
3627
|
<xsl:when test="contains($text, $zero-space-after-equal)">
|
3596
|
-
<xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
|
3628
|
+
<!-- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
|
3597
3629
|
<xsl:value-of select="$zero-space-after-equal"/>
|
3598
3630
|
<xsl:value-of select="$zero-space"/>
|
3599
3631
|
<xsl:call-template name="add-zero-spaces-equal">
|
3600
3632
|
<xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
|
3601
|
-
</xsl:call-template>
|
3633
|
+
</xsl:call-template> -->
|
3634
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equal,concat('$1',$zero_width_space))"/>
|
3602
3635
|
</xsl:when>
|
3603
3636
|
<xsl:otherwise>
|
3604
3637
|
<xsl:value-of select="$text"/>
|
@@ -4074,7 +4107,12 @@
|
|
4074
4107
|
|
4075
4108
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
4076
4109
|
|
4110
|
+
<xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
|
4111
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
4112
|
+
</xsl:if>
|
4113
|
+
|
4077
4114
|
|
4115
|
+
|
4078
4116
|
|
4079
4117
|
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
|
4080
4118
|
<!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
|
@@ -5052,17 +5090,15 @@
|
|
5052
5090
|
|
5053
5091
|
<!-- split text by zero-width space -->
|
5054
5092
|
<xsl:variable name="text_step4">
|
5055
|
-
<xsl:call-template name="
|
5093
|
+
<xsl:call-template name="split_for_interspers">
|
5056
5094
|
<xsl:with-param name="pText" select="$text_step3"/>
|
5057
5095
|
<xsl:with-param name="sep" select="$zero_width_space"/>
|
5058
|
-
<xsl:with-param name="normalize-space">false</xsl:with-param>
|
5059
|
-
<xsl:with-param name="keep_sep">true</xsl:with-param>
|
5060
5096
|
</xsl:call-template>
|
5061
5097
|
</xsl:variable>
|
5062
5098
|
|
5063
|
-
<xsl:for-each select="xalan:nodeset($text_step4)/
|
5099
|
+
<xsl:for-each select="xalan:nodeset($text_step4)/node()">
|
5064
5100
|
<xsl:choose>
|
5065
|
-
<xsl:when test="
|
5101
|
+
<xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
|
5066
5102
|
<xsl:call-template name="interspers">
|
5067
5103
|
<xsl:with-param name="str" select="."/>
|
5068
5104
|
</xsl:call-template>
|
@@ -5073,6 +5109,30 @@
|
|
5073
5109
|
</xsl:choose>
|
5074
5110
|
</xsl:for-each>
|
5075
5111
|
|
5112
|
+
</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">
|
5113
|
+
<xsl:param name="pText" select="."/>
|
5114
|
+
<xsl:param name="sep" select="','"/>
|
5115
|
+
<!-- word with length more than 30 will be interspersed with zero-width space -->
|
5116
|
+
<xsl:variable name="regex" select="concat('([^', $zero_width_space, ']{31,})')"/> <!-- sequence of characters (more 31), that doesn't contains zero-width space -->
|
5117
|
+
<xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new($pText),$regex,concat($interspers_tag_open,'$1',$interspers_tag_close))"/>
|
5118
|
+
<xsl:call-template name="replace_tag_interspers">
|
5119
|
+
<xsl:with-param name="text" select="$text"/>
|
5120
|
+
</xsl:call-template>
|
5121
|
+
</xsl:template><xsl:template name="replace_tag_interspers">
|
5122
|
+
<xsl:param name="text"/>
|
5123
|
+
<xsl:choose>
|
5124
|
+
<xsl:when test="contains($text, $interspers_tag_open)">
|
5125
|
+
<xsl:value-of select="substring-before($text, $interspers_tag_open)"/>
|
5126
|
+
<xsl:variable name="text_after" select="substring-after($text, $interspers_tag_open)"/>
|
5127
|
+
<interspers>
|
5128
|
+
<xsl:value-of select="substring-before($text_after, $interspers_tag_close)"/>
|
5129
|
+
</interspers>
|
5130
|
+
<xsl:call-template name="replace_tag_interspers">
|
5131
|
+
<xsl:with-param name="text" select="substring-after($text_after, $interspers_tag_close)"/>
|
5132
|
+
</xsl:call-template>
|
5133
|
+
</xsl:when>
|
5134
|
+
<xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
|
5135
|
+
</xsl:choose>
|
5076
5136
|
</xsl:template><xsl:template name="interspers">
|
5077
5137
|
<xsl:param name="str"/>
|
5078
5138
|
<xsl:param name="char" select="$zero_width_space"/>
|
@@ -5520,7 +5580,7 @@
|
|
5520
5580
|
</xsl:otherwise>
|
5521
5581
|
</xsl:choose> -->
|
5522
5582
|
</fo:block>
|
5523
|
-
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ')]" priority="2">
|
5583
|
+
</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">
|
5524
5584
|
<xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/>
|
5525
5585
|
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
|
5526
5586
|
<xsl:if test="normalize-space() != ''">
|
data/lib/metanorma/cc/biblio.rng
CHANGED
@@ -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
|
-
<
|
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">
|
data/lib/metanorma/cc/version.rb
CHANGED
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.0.
|
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-
|
11
|
+
date: 2022-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|