metanorma-cc 1.5.3 → 1.5.4

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: 7e7ea8aa4a98c9025bee7fe799d5fceef2e3509ecc5418805f66feae05184edd
4
- data.tar.gz: 9d4d96365f854898f09da7b73593991aa8c0a8b8b4c6dad051fc94b9b05a6873
3
+ metadata.gz: a6d45f32ac56da049460224a7b9a264fc302db06a9023abdda10b53ab8df4e18
4
+ data.tar.gz: ac4e8e88813d02bca6a2fdbec491435cedd0f50de19d4de7e5cf67748341b0b5
5
5
  SHA512:
6
- metadata.gz: 8c473d1ed5976283580bf9f5569aff23d1f545d9f5ea4b093ef990fe94db6cf7900e13e1060cbcf30d00c7fd7241060ccc212d9e3e027589003d562efe7fe23f
7
- data.tar.gz: 9643f9dbbafe84104aaaa774bbc21bd708a39c9509526da74851978b7447a87ed414433bf77d35f0446336b04ccc0bfe18b94c8158a49dd5fb43929ce0039f8d
6
+ metadata.gz: 67cbd5fcc368c00e569451d9842db371be1ad415a4bb74a318edee209bb8fbb982263b3879613cf957f9a13f006f90d638c57ca6e236b11b6c24fe5e026b853a
7
+ data.tar.gz: 934db04e842a3a686d2bd30bf671e61f71456adc98605f48ad420e410197b2ee56fbfc575c207aac59ec1f25364990a56332977508a44ee1a8fa116a5e48b178
@@ -158,17 +158,7 @@
158
158
  <data type="ID"/>
159
159
  </attribute>
160
160
  <oneOrMore>
161
- <choice>
162
- <ref name="formula"/>
163
- <ref name="ul"/>
164
- <ref name="ol"/>
165
- <ref name="dl"/>
166
- <ref name="quote"/>
167
- <ref name="sourcecode"/>
168
- <ref name="paragraph"/>
169
- <ref name="table"/>
170
- <ref name="figure"/>
171
- </choice>
161
+ <ref name="paragraph"/>
172
162
  </oneOrMore>
173
163
  </element>
174
164
  </define>
@@ -1028,6 +1018,9 @@
1028
1018
  <value>alphabet_upper</value>
1029
1019
  </choice>
1030
1020
  </attribute>
1021
+ <optional>
1022
+ <attribute name="start"/>
1023
+ </optional>
1031
1024
  <oneOrMore>
1032
1025
  <ref name="li"/>
1033
1026
  </oneOrMore>
@@ -96,6 +96,13 @@
96
96
  </include>
97
97
  <define name="csd-standard">
98
98
  <element name="csd-standard">
99
+ <attribute name="version"/>
100
+ <attribute name="type">
101
+ <choice>
102
+ <value>semantic</value>
103
+ <value>presentation</value>
104
+ </choice>
105
+ </attribute>
99
106
  <ref name="bibdata"/>
100
107
  <zeroOrMore>
101
108
  <ref name="termdocsource"/>
@@ -64,6 +64,11 @@
64
64
  </choice>
65
65
  </attribute>
66
66
  </optional>
67
+ <optional>
68
+ <attribute name="droploc">
69
+ <data type="boolean"/>
70
+ </attribute>
71
+ </optional>
67
72
  <text/>
68
73
  </element>
69
74
  </define>
@@ -859,6 +864,13 @@
859
864
  </define>
860
865
  <define name="standard-document">
861
866
  <element name="standard-document">
867
+ <attribute name="version"/>
868
+ <attribute name="type">
869
+ <choice>
870
+ <value>semantic</value>
871
+ <value>presentation</value>
872
+ </choice>
873
+ </attribute>
862
874
  <ref name="bibdata"/>
863
875
  <optional>
864
876
  <ref name="boilerplate"/>
@@ -880,7 +892,7 @@
880
892
  <oneOrMore>
881
893
  <choice>
882
894
  <ref name="content"/>
883
- <ref name="preface_abstract"/>
895
+ <ref name="abstract"/>
884
896
  <ref name="foreword"/>
885
897
  <ref name="introduction"/>
886
898
  <ref name="acknowledgements"/>
@@ -1481,11 +1493,6 @@
1481
1493
  </optional>
1482
1494
  </element>
1483
1495
  </define>
1484
- <define name="preface_abstract">
1485
- <element name="abstract">
1486
- <ref name="Basic-Section"/>
1487
- </element>
1488
- </define>
1489
1496
  <define name="term-clause">
1490
1497
  <element name="clause">
1491
1498
  <optional>
@@ -108,7 +108,10 @@
108
108
  </fo:layout-master-set>
109
109
 
110
110
  <xsl:call-template name="addPDFUAmeta"/>
111
-
111
+
112
+ <xsl:call-template name="addBookmarks">
113
+ <xsl:with-param name="contents" select="$contents"/>
114
+ </xsl:call-template>
112
115
 
113
116
  <!-- Cover Page -->
114
117
  <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
@@ -225,7 +228,7 @@
225
228
  </xsl:variable>
226
229
  <fo:block font-size="14pt" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
227
230
 
228
- <xsl:for-each select="xalan:nodeset($contents)//item"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
231
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
229
232
 
230
233
  <fo:block>
231
234
  <xsl:if test="@level = 1">
@@ -249,8 +252,8 @@
249
252
  </fo:list-item-label>
250
253
  <fo:list-item-body start-indent="body-start()">
251
254
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
252
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
253
- <xsl:apply-templates/>
255
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
256
+ <xsl:apply-templates select="title"/>
254
257
  <fo:inline keep-together.within-line="always">
255
258
  <fo:leader leader-pattern="dots"/>
256
259
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
@@ -315,14 +318,20 @@
315
318
 
316
319
  <xsl:variable name="display">
317
320
  <xsl:choose>
318
- <xsl:when test="ancestor-or-self::csd:bibitem">false</xsl:when>
319
- <xsl:when test="ancestor-or-self::csd:term">false</xsl:when>
320
321
  <xsl:when test="$level &gt; 2">false</xsl:when>
321
322
  <xsl:otherwise>true</xsl:otherwise>
322
323
  </xsl:choose>
323
324
  </xsl:variable>
324
325
 
325
- <xsl:if test="$display = 'true'">
326
+ <xsl:variable name="skip">
327
+ <xsl:choose>
328
+ <xsl:when test="ancestor-or-self::csd:bibitem">true</xsl:when>
329
+ <xsl:when test="ancestor-or-self::csd:term">true</xsl:when>
330
+ <xsl:otherwise>false</xsl:otherwise>
331
+ </xsl:choose>
332
+ </xsl:variable>
333
+
334
+ <xsl:if test="$skip = 'false'">
326
335
 
327
336
  <xsl:variable name="section">
328
337
  <xsl:call-template name="getSection"/>
@@ -332,10 +341,12 @@
332
341
  <xsl:call-template name="getName"/>
333
342
  </xsl:variable>
334
343
 
335
- <item id="{@id}" level="{$level}" section="{$section}">
336
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
344
+ <item id="{@id}" level="{$level}" section="{$section}" display="{$display}">
345
+ <title>
346
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
347
+ </title>
348
+ <xsl:apply-templates mode="contents"/>
337
349
  </item>
338
- <xsl:apply-templates mode="contents"/>
339
350
  </xsl:if>
340
351
 
341
352
  </xsl:template>
@@ -803,6 +814,12 @@
803
814
 
804
815
  </title-edition>
805
816
 
817
+ <title-edition lang="fr">
818
+
819
+ <xsl:text>Édition </xsl:text>
820
+
821
+ </title-edition>
822
+
806
823
 
807
824
  <title-toc lang="en">
808
825
 
@@ -911,7 +928,9 @@
911
928
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
912
929
  </xsl:otherwise>
913
930
  </xsl:choose>
914
- </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style">
931
+ </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="root-style">
932
+
933
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
915
934
 
916
935
  <xsl:attribute name="color">blue</xsl:attribute>
917
936
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -2831,12 +2850,101 @@
2831
2850
 
2832
2851
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2833
2852
  </fo:block>
2834
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
2853
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
2835
2854
  <xsl:apply-templates mode="contents"/>
2836
2855
  <xsl:text> </xsl:text>
2837
- </xsl:template><xsl:template match="text()" mode="contents">
2856
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
2857
+ <xsl:apply-templates mode="bookmarks"/>
2858
+ <xsl:text> </xsl:text>
2859
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
2860
+ <xsl:value-of select="."/>
2861
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
2838
2862
  <xsl:value-of select="."/>
2839
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
2863
+ </xsl:template><xsl:template match="node()" mode="contents">
2864
+ <xsl:apply-templates mode="contents"/>
2865
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
2866
+ <xsl:apply-templates mode="bookmarks"/>
2867
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
2868
+ <xsl:apply-templates select="."/>
2869
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
2870
+ <xsl:apply-templates mode="bookmarks"/>
2871
+ </xsl:template><xsl:template name="addBookmarks">
2872
+ <xsl:param name="contents"/>
2873
+ <xsl:if test="xalan:nodeset($contents)//item">
2874
+ <fo:bookmark-tree>
2875
+ <xsl:choose>
2876
+ <xsl:when test="xalan:nodeset($contents)/doc">
2877
+ <xsl:choose>
2878
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
2879
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
2880
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
2881
+ <fo:bookmark-title>
2882
+ <xsl:variable name="bookmark-title_">
2883
+ <xsl:choose>
2884
+ <xsl:when test="@lang = 'en'">
2885
+
2886
+
2887
+ </xsl:when>
2888
+ <xsl:when test="@lang = 'fr'">
2889
+
2890
+
2891
+ </xsl:when>
2892
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
2893
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
2894
+ </xsl:choose>
2895
+ </xsl:variable>
2896
+ <xsl:choose>
2897
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
2898
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
2899
+ </xsl:when>
2900
+ <xsl:otherwise>
2901
+ <xsl:choose>
2902
+ <xsl:when test="@lang = 'en'">English</xsl:when>
2903
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
2904
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
2905
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
2906
+ </xsl:choose>
2907
+ </xsl:otherwise>
2908
+ </xsl:choose>
2909
+ </fo:bookmark-title>
2910
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
2911
+ </fo:bookmark>
2912
+
2913
+ </xsl:for-each>
2914
+ </xsl:when>
2915
+ <xsl:otherwise>
2916
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
2917
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
2918
+ </xsl:for-each>
2919
+ </xsl:otherwise>
2920
+ </xsl:choose>
2921
+ </xsl:when>
2922
+ <xsl:otherwise>
2923
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
2924
+ </xsl:otherwise>
2925
+ </xsl:choose>
2926
+
2927
+
2928
+
2929
+
2930
+
2931
+
2932
+
2933
+
2934
+ </fo:bookmark-tree>
2935
+ </xsl:if>
2936
+ </xsl:template><xsl:template match="item" mode="bookmark">
2937
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
2938
+ <fo:bookmark-title>
2939
+ <xsl:if test="@section != ''">
2940
+ <xsl:value-of select="@section"/>
2941
+ <xsl:text> </xsl:text>
2942
+ </xsl:if>
2943
+ <xsl:value-of select="normalize-space(title)"/>
2944
+ </fo:bookmark-title>
2945
+ <xsl:apply-templates mode="bookmark"/>
2946
+ </fo:bookmark>
2947
+ </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
2840
2948
  <xsl:if test="normalize-space() != ''">
2841
2949
  <fo:block xsl:use-attribute-sets="figure-name-style">
2842
2950
 
@@ -2894,7 +3002,7 @@
2894
3002
  <xsl:apply-templates/>
2895
3003
  </xsl:otherwise>
2896
3004
  </xsl:choose>
2897
- </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
3005
+ </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
2898
3006
  <xsl:text> </xsl:text>
2899
3007
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
2900
3008
  <xsl:copy>
@@ -3505,20 +3613,29 @@
3505
3613
  <!-- 0xA0 to space replacement -->
3506
3614
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3507
3615
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3508
- <fo:block-container margin-left="0mm">
3509
- <xsl:if test="parent::*[local-name() = 'note']">
3510
- <xsl:attribute name="margin-left">
3511
- <xsl:choose>
3512
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3513
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3514
- </xsl:choose>
3515
- </xsl:attribute>
3516
-
3517
- </xsl:if>
3518
- <fo:block-container margin-left="0mm">
3519
- <xsl:apply-templates select="." mode="ul_ol"/>
3520
- </fo:block-container>
3521
- </fo:block-container>
3616
+ <xsl:choose>
3617
+ <xsl:when test="parent::*[local-name() = 'note']">
3618
+ <fo:block-container>
3619
+ <xsl:attribute name="margin-left">
3620
+ <xsl:choose>
3621
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3622
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3623
+ </xsl:choose>
3624
+ </xsl:attribute>
3625
+
3626
+ <fo:block-container margin-left="0mm">
3627
+ <fo:block>
3628
+ <xsl:apply-templates select="." mode="ul_ol"/>
3629
+ </fo:block>
3630
+ </fo:block-container>
3631
+ </fo:block-container>
3632
+ </xsl:when>
3633
+ <xsl:otherwise>
3634
+ <fo:block>
3635
+ <xsl:apply-templates select="." mode="ul_ol"/>
3636
+ </fo:block>
3637
+ </xsl:otherwise>
3638
+ </xsl:choose>
3522
3639
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3523
3640
  <!-- <row>
3524
3641
  <date>05-07-2013</date>
@@ -3814,6 +3931,7 @@
3814
3931
 
3815
3932
 
3816
3933
 
3934
+
3817
3935
  </xsl:variable>
3818
3936
  <xsl:if test="$documentNS != $XSLNS">
3819
3937
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3839,4 +3957,21 @@
3839
3957
  </xsl:otherwise>
3840
3958
  </xsl:choose>
3841
3959
  </xsl:attribute>
3960
+ </xsl:template><xsl:template name="add-letter-spacing">
3961
+ <xsl:param name="text"/>
3962
+ <xsl:param name="letter-spacing" select="'0.15'"/>
3963
+ <xsl:if test="string-length($text) &gt; 0">
3964
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
3965
+ <fo:inline padding-right="{$letter-spacing}mm">
3966
+ <xsl:if test="$char = '®'">
3967
+ <xsl:attribute name="font-size">58%</xsl:attribute>
3968
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
3969
+ </xsl:if>
3970
+ <xsl:value-of select="$char"/>
3971
+ </fo:inline>
3972
+ <xsl:call-template name="add-letter-spacing">
3973
+ <xsl:with-param name="text" select="substring($text, 2)"/>
3974
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
3975
+ </xsl:call-template>
3976
+ </xsl:if>
3842
3977
  </xsl:template></xsl:stylesheet>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
3
- VERSION = "1.5.3"
3
+ VERSION = "1.5.4"
4
4
  end
5
5
  end
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ["lib"]
29
29
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
30
30
 
31
- spec.add_dependency "metanorma-standoc", "~> 1.5.0"
31
+ spec.add_dependency "metanorma-standoc", "~> 1.6.0"
32
32
  spec.add_dependency "isodoc", "~> 1.2.0"
33
33
 
34
34
  spec.add_development_dependency "byebug", "~> 9.1"
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: 1.5.3
4
+ version: 1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-11 00:00:00.000000000 Z
11
+ date: 2020-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.5.0
19
+ version: 1.6.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.5.0
26
+ version: 1.6.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: isodoc
29
29
  requirement: !ruby/object:Gem::Requirement