metanorma-csa 2.1.10 → 2.1.12

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: a9f5a4e8f56c0b5a0979a16624c3d21b2e432ab1110a84eaff137992b69334a4
4
- data.tar.gz: 677ffd51fb6a6ea4d8af6c458e24b4d892788f16cfc0e3c0ba2325b8ae4a5a2e
3
+ metadata.gz: 2ed7577204aa05f248716397889b7d00a083adc256eab0398ca263f074c3b004
4
+ data.tar.gz: cd1352318dea593aebecc9fe9c70e23634e2186c0147690d810b055cc03ab617
5
5
  SHA512:
6
- metadata.gz: e461563d1f98fb34ae74a425a629319b9129c546e830150164a4c374b24915b1416a9d38e4a5fca0f6f58562c6660dda8e299d3c96add4b93b1f6b598281ed63
7
- data.tar.gz: d7f702a163e010b8a06eaacf54a79572b2930a481b4c20e86e16b21e20cf8384e937ae27104cfe1241d4a4b302fd95f0f9a609291235c5ee216253cebf763b76
6
+ metadata.gz: c224a58107249bbba5a6b8c42ffdd5a9ecdf0d706ee4edf39075d461dd783f5af879d8fbcebb206bb0220817e66f0ba496d203713363ad7f97edc893775a1318
7
+ data.tar.gz: 8970cef3f0f992119692ea783b234cd1b92c9a7a05fef7fa1a9ef526f5aced6465585c5e522ad34d29ed49aae2c1e1751ede08206c7b71c3b7bb04b4077d387b
@@ -1089,6 +1089,11 @@
1089
1089
  </xsl:variable>
1090
1090
  <xsl:variable name="table-border" select="normalize-space($table-border_)"/>
1091
1091
 
1092
+ <xsl:variable name="table-cell-border_">
1093
+
1094
+ </xsl:variable>
1095
+ <xsl:variable name="table-cell-border" select="normalize-space($table-cell-border_)"/>
1096
+
1092
1097
  <xsl:attribute-set name="table-container-style">
1093
1098
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
1094
1099
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -1098,8 +1103,6 @@
1098
1103
  <xsl:attribute-set name="table-style">
1099
1104
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
1100
1105
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
1101
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
1102
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
1103
1106
 
1104
1107
  </xsl:attribute-set><!-- table-style -->
1105
1108
 
@@ -2203,10 +2206,18 @@
2203
2206
  <xsl:variable name="table_attributes">
2204
2207
 
2205
2208
  <xsl:element name="table_attributes" use-attribute-sets="table-style">
2209
+
2210
+ <xsl:if test="$margin-side != 0">
2211
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2212
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2213
+ </xsl:if>
2214
+
2206
2215
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
2207
2216
 
2208
- <xsl:attribute name="margin-left"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
2209
- <xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
2217
+ <xsl:if test="$margin-side != 0">
2218
+ <xsl:attribute name="margin-left"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
2219
+ <xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
2220
+ </xsl:if>
2210
2221
 
2211
2222
  </xsl:element>
2212
2223
  </xsl:variable>
@@ -2962,6 +2973,10 @@
2962
2973
  <xsl:template match="*[local-name()='tr']">
2963
2974
  <fo:table-row xsl:use-attribute-sets="table-body-row-style">
2964
2975
 
2976
+ <xsl:if test="*[local-name() = 'th']">
2977
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2978
+ </xsl:if>
2979
+
2965
2980
  <xsl:call-template name="setTableRowAttributes"/>
2966
2981
  <xsl:apply-templates/>
2967
2982
  </fo:table-row>
@@ -3999,8 +4014,17 @@
3999
4014
  </fo:inline>
4000
4015
  </xsl:template> <!-- tt -->
4001
4016
 
4017
+ <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
4002
4018
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
4003
- <xsl:call-template name="add_spaces_to_sourcecode"/>
4019
+ <xsl:choose>
4020
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
4021
+ <!-- url -->
4022
+ <xsl:call-template name="add-zero-spaces-link-java"/>
4023
+ </xsl:when>
4024
+ <xsl:otherwise>
4025
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
4026
+ </xsl:otherwise>
4027
+ </xsl:choose>
4004
4028
  </xsl:template>
4005
4029
 
4006
4030
  <xsl:template match="*[local-name()='underline']">
@@ -4356,8 +4380,11 @@
4356
4380
 
4357
4381
  <xsl:template name="add-zero-spaces-link-java">
4358
4382
  <xsl:param name="text" select="."/>
4383
+
4384
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
4385
+ <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
4359
4386
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4360
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
4387
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
4361
4388
  </xsl:template>
4362
4389
 
4363
4390
  <!-- add zero space after dash character (for table's entries) -->
@@ -4914,6 +4941,9 @@
4914
4941
  <xsl:value-of select="substring($str, 2)"/>
4915
4942
  </xsl:template>
4916
4943
 
4944
+ <!-- ======================================= -->
4945
+ <!-- math -->
4946
+ <!-- ======================================= -->
4917
4947
  <xsl:template match="mathml:math">
4918
4948
  <xsl:variable name="isAdded" select="@added"/>
4919
4949
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -4964,14 +4994,57 @@
4964
4994
  <xsl:value-of select="$comment_text"/>
4965
4995
  </xsl:template>
4966
4996
 
4997
+ <xsl:template match="*[local-name() = 'asciimath']">
4998
+ <xsl:param name="process" select="'false'"/>
4999
+ <xsl:if test="$process = 'true'">
5000
+ <xsl:apply-templates/>
5001
+ </xsl:if>
5002
+ </xsl:template>
5003
+
5004
+ <xsl:template match="*[local-name() = 'latexmath']"/>
5005
+
5006
+ <xsl:template name="getMathml_asciimath_text">
5007
+ <xsl:variable name="asciimath" select="../*[local-name() = 'asciimath']"/>
5008
+ <xsl:variable name="latexmath">
5009
+
5010
+ </xsl:variable>
5011
+ <xsl:variable name="asciimath_text_following">
5012
+ <xsl:choose>
5013
+ <xsl:when test="normalize-space($latexmath) != ''">
5014
+ <xsl:value-of select="$latexmath"/>
5015
+ </xsl:when>
5016
+ <xsl:when test="normalize-space($asciimath) != ''">
5017
+ <xsl:value-of select="$asciimath"/>
5018
+ </xsl:when>
5019
+ <xsl:otherwise>
5020
+ <xsl:value-of select="following-sibling::node()[1][self::comment()]"/>
5021
+ </xsl:otherwise>
5022
+ </xsl:choose>
5023
+ </xsl:variable>
5024
+ <xsl:variable name="asciimath_text_">
5025
+ <xsl:choose>
5026
+ <xsl:when test="normalize-space($asciimath_text_following) != ''">
5027
+ <xsl:value-of select="$asciimath_text_following"/>
5028
+ </xsl:when>
5029
+ <xsl:otherwise>
5030
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
5031
+ </xsl:otherwise>
5032
+ </xsl:choose>
5033
+ </xsl:variable>
5034
+ <xsl:variable name="asciimath_text_2" select="java:org.metanorma.fop.Util.unescape($asciimath_text_)"/>
5035
+ <xsl:variable name="asciimath_text" select="java:trim(java:java.lang.String.new($asciimath_text_2))"/>
5036
+ <xsl:value-of select="$asciimath_text"/>
5037
+ </xsl:template>
5038
+
4967
5039
  <xsl:template name="mathml_instream_object">
4968
- <xsl:param name="comment_text"/>
5040
+ <xsl:param name="asciimath_text"/>
4969
5041
  <xsl:param name="mathml_content"/>
4970
5042
 
4971
- <xsl:variable name="comment_text_">
5043
+ <xsl:variable name="asciimath_text_">
4972
5044
  <xsl:choose>
4973
- <xsl:when test="normalize-space($comment_text) != ''"><xsl:value-of select="$comment_text"/></xsl:when>
4974
- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise>
5045
+ <xsl:when test="normalize-space($asciimath_text) != ''"><xsl:value-of select="$asciimath_text"/></xsl:when>
5046
+ <!-- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise> -->
5047
+ <xsl:otherwise><xsl:call-template name="getMathml_asciimath_text"/></xsl:otherwise>
4975
5048
  </xsl:choose>
4976
5049
  </xsl:variable>
4977
5050
 
@@ -4988,10 +5061,10 @@
4988
5061
  </xsl:attribute>
4989
5062
 
4990
5063
  <!-- <xsl:if test="$add_math_as_text = 'true'"> -->
4991
- <xsl:if test="normalize-space($comment_text_) != ''">
5064
+ <xsl:if test="normalize-space($asciimath_text_) != ''">
4992
5065
  <!-- put Mathin Alternate Text -->
4993
5066
  <xsl:attribute name="fox:alt-text">
4994
- <xsl:value-of select="$comment_text_"/>
5067
+ <xsl:value-of select="$asciimath_text_"/>
4995
5068
  </xsl:attribute>
4996
5069
  </xsl:if>
4997
5070
  <!-- </xsl:if> -->
@@ -5064,6 +5137,29 @@
5064
5137
  <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
5065
5138
  </xsl:template>
5066
5139
 
5140
+ <!-- Examples:
5141
+ <stem type="AsciiMath">x = 1</stem>
5142
+ <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
5143
+ <stem type="AsciiMath"><asciimath>x = 1</asciimath><latexmath>x = 1</latexmath></stem>
5144
+ -->
5145
+ <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
5146
+ <fo:inline xsl:use-attribute-sets="mathml-style">
5147
+
5148
+ <xsl:choose>
5149
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
5150
+ <xsl:otherwise>
5151
+ <xsl:apply-templates>
5152
+ <xsl:with-param name="process">true</xsl:with-param>
5153
+ </xsl:apply-templates>
5154
+ </xsl:otherwise>
5155
+ </xsl:choose>
5156
+
5157
+ </fo:inline>
5158
+ </xsl:template>
5159
+ <!-- ======================================= -->
5160
+ <!-- END: math -->
5161
+ <!-- ======================================= -->
5162
+
5067
5163
  <xsl:template match="*[local-name()='localityStack']"/>
5068
5164
 
5069
5165
  <xsl:template match="*[local-name()='link']" name="link">
@@ -8771,7 +8867,7 @@
8771
8867
 
8772
8868
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
8773
8869
 
8774
- <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'])]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
8870
+ <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
8775
8871
 
8776
8872
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
8777
8873
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
@@ -9247,13 +9343,14 @@
9247
9343
  </xsl:template>
9248
9344
 
9249
9345
  <xsl:template name="setId">
9346
+ <xsl:param name="prefix"/>
9250
9347
  <xsl:attribute name="id">
9251
9348
  <xsl:choose>
9252
9349
  <xsl:when test="@id">
9253
- <xsl:value-of select="@id"/>
9350
+ <xsl:value-of select="concat($prefix, @id)"/>
9254
9351
  </xsl:when>
9255
9352
  <xsl:otherwise>
9256
- <xsl:value-of select="generate-id()"/>
9353
+ <xsl:value-of select="concat($prefix, generate-id())"/>
9257
9354
  </xsl:otherwise>
9258
9355
  </xsl:choose>
9259
9356
  </xsl:attribute>
@@ -1,10 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <include href="biblio.rng">
4
- <start>
5
- <ref name="document"/>
6
- </start>
7
- </include>
8
3
  <define name="document">
9
4
  <element name="document">
10
5
  <optional>
@@ -1125,26 +1120,4 @@
1125
1120
  </zeroOrMore>
1126
1121
  </element>
1127
1122
  </define>
1128
- <define name="ext">
1129
- <element name="ext">
1130
- <ref name="BibDataExtensionType"/>
1131
- </element>
1132
- </define>
1133
- <define name="BibDataExtensionType">
1134
- <ref name="doctype"/>
1135
- </define>
1136
- <define name="doctype">
1137
- <element name="doctype">
1138
- <ref name="DocumentType"/>
1139
- </element>
1140
- </define>
1141
- <define name="DocumentType">
1142
- <value>document</value>
1143
- </define>
1144
- <define name="BibData">
1145
- <ref name="BibliographicItem"/>
1146
- <optional>
1147
- <ref name="ext"/>
1148
- </optional>
1149
- </define>
1150
1123
  </grammar>
@@ -0,0 +1,164 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0">
3
+ <!--
4
+ Add-ons to biblio.rnc for standoc model: defines the extension point BibDataExtensionType
5
+ of relaton
6
+
7
+ Specialisations as for biblio.rnc. Extension point can be redefined completely for a flavour of standoc
8
+ (SDO); but other elements in Bibdata can only be extended (more specialised vocabularies for Bibdata)
9
+ -->
10
+ <include href="biblio.rng">
11
+ <define name="BibData">
12
+ <ref name="BibliographicItem"/>
13
+ <optional>
14
+ <ref name="ext"/>
15
+ </optional>
16
+ </define>
17
+ </include>
18
+ <define name="ext">
19
+ <element name="ext">
20
+ <ref name="BibDataExtensionType"/>
21
+ </element>
22
+ </define>
23
+ <define name="BibDataExtensionType">
24
+ <optional>
25
+ <attribute name="schema-version"/>
26
+ </optional>
27
+ <ref name="doctype"/>
28
+ <optional>
29
+ <ref name="docsubtype"/>
30
+ </optional>
31
+ <optional>
32
+ <ref name="editorialgroup"/>
33
+ </optional>
34
+ <zeroOrMore>
35
+ <ref name="ics"/>
36
+ </zeroOrMore>
37
+ <zeroOrMore>
38
+ <ref name="structuredidentifier"/>
39
+ </zeroOrMore>
40
+ </define>
41
+ <define name="doctype">
42
+ <element name="doctype">
43
+ <optional>
44
+ <attribute name="abbreviation"/>
45
+ </optional>
46
+ <ref name="DocumentType"/>
47
+ </element>
48
+ </define>
49
+ <define name="DocumentType">
50
+ <value>document</value>
51
+ </define>
52
+ <define name="docsubtype">
53
+ <element name="subdoctype">
54
+ <ref name="DocumentSubtype"/>
55
+ </element>
56
+ </define>
57
+ <define name="DocumentSubtype">
58
+ <text/>
59
+ </define>
60
+ <define name="editorialgroup">
61
+ <element name="editorialgroup">
62
+ <oneOrMore>
63
+ <ref name="technical-committee"/>
64
+ </oneOrMore>
65
+ </element>
66
+ </define>
67
+ <define name="technical-committee">
68
+ <element name="technical-committee">
69
+ <ref name="IsoWorkgroup"/>
70
+ </element>
71
+ </define>
72
+ <define name="IsoWorkgroup">
73
+ <optional>
74
+ <attribute name="number"/>
75
+ </optional>
76
+ <optional>
77
+ <attribute name="type"/>
78
+ </optional>
79
+ <optional>
80
+ <attribute name="identifier"/>
81
+ </optional>
82
+ <optional>
83
+ <attribute name="prefix"/>
84
+ </optional>
85
+ <text/>
86
+ </define>
87
+ <define name="ics">
88
+ <element name="ics">
89
+ <element name="code">
90
+ <text/>
91
+ </element>
92
+ <optional>
93
+ <element name="text">
94
+ <text/>
95
+ </element>
96
+ </optional>
97
+ </element>
98
+ </define>
99
+ <define name="structuredidentifier">
100
+ <element name="structuredidentifier">
101
+ <optional>
102
+ <attribute name="type"/>
103
+ </optional>
104
+ <oneOrMore>
105
+ <element name="agency">
106
+ <text/>
107
+ </element>
108
+ </oneOrMore>
109
+ <optional>
110
+ <element name="class">
111
+ <text/>
112
+ </element>
113
+ </optional>
114
+ <element name="docnumber">
115
+ <text/>
116
+ </element>
117
+ <optional>
118
+ <element name="partnumber">
119
+ <text/>
120
+ </element>
121
+ </optional>
122
+ <optional>
123
+ <element name="edition">
124
+ <text/>
125
+ </element>
126
+ </optional>
127
+ <optional>
128
+ <element name="version">
129
+ <text/>
130
+ </element>
131
+ </optional>
132
+ <optional>
133
+ <element name="supplementtype">
134
+ <text/>
135
+ </element>
136
+ </optional>
137
+ <optional>
138
+ <element name="supplementnumber">
139
+ <text/>
140
+ </element>
141
+ </optional>
142
+ <optional>
143
+ <element name="amendment">
144
+ <text/>
145
+ </element>
146
+ </optional>
147
+ <optional>
148
+ <element name="corrigendum">
149
+ <text/>
150
+ </element>
151
+ </optional>
152
+ <optional>
153
+ <element name="language">
154
+ <text/>
155
+ </element>
156
+ </optional>
157
+ <optional>
158
+ <element name="year">
159
+ <text/>
160
+ </element>
161
+ </optional>
162
+ </element>
163
+ </define>
164
+ </grammar>
@@ -33,9 +33,10 @@
33
33
  <param name="pattern">([\+\-]?\d{4})((-?)((0[1-9]|1[0-2])((-?)([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6]))))?</param>
34
34
  </data>
35
35
  </define>
36
- <start>
37
- <ref name="bibitem"/>
38
- </start>
36
+ <!-- start = bibitem -->
37
+ <define name="BibData">
38
+ <ref name="BibliographicItem"/>
39
+ </define>
39
40
  <define name="status">
40
41
  <element name="status">
41
42
  <ref name="stage"/>
@@ -170,27 +171,30 @@
170
171
  </define>
171
172
  <define name="contributor">
172
173
  <element name="contributor">
173
- <zeroOrMore>
174
+ <oneOrMore>
174
175
  <ref name="role"/>
175
- </zeroOrMore>
176
+ </oneOrMore>
176
177
  <ref name="ContributorInfo"/>
177
178
  </element>
178
179
  </define>
179
180
  <define name="role">
180
181
  <element name="role">
181
- <optional>
182
- <attribute name="type">
183
- <choice>
184
- <value>author</value>
185
- <value>performer</value>
186
- <value>publisher</value>
187
- <value>editor</value>
188
- <value>adapter</value>
189
- <value>translator</value>
190
- <value>distributor</value>
191
- </choice>
192
- </attribute>
193
- </optional>
182
+ <attribute name="type">
183
+ <choice>
184
+ <value>author</value>
185
+ <value>performer</value>
186
+ <value>publisher</value>
187
+ <value>editor</value>
188
+ <value>adapter</value>
189
+ <value>translator</value>
190
+ <value>distributor</value>
191
+ <value>realizer</value>
192
+ <value>owner</value>
193
+ <value>authorizer</value>
194
+ <value>enabler</value>
195
+ <value>subject</value>
196
+ </choice>
197
+ </attribute>
194
198
  <zeroOrMore>
195
199
  <ref name="roledescription"/>
196
200
  </zeroOrMore>
@@ -512,6 +516,17 @@
512
516
  </define>
513
517
  <define name="localityStack">
514
518
  <element name="localityStack">
519
+ <optional>
520
+ <attribute name="connective">
521
+ <choice>
522
+ <value>and</value>
523
+ <value>or</value>
524
+ <value>from</value>
525
+ <value>to</value>
526
+ <value/>
527
+ </choice>
528
+ </attribute>
529
+ </optional>
515
530
  <zeroOrMore>
516
531
  <ref name="locality"/>
517
532
  </zeroOrMore>
@@ -524,6 +539,17 @@
524
539
  </define>
525
540
  <define name="sourceLocalityStack">
526
541
  <element name="sourceLocalityStack">
542
+ <optional>
543
+ <attribute name="connective">
544
+ <choice>
545
+ <value>and</value>
546
+ <value>or</value>
547
+ <value>from</value>
548
+ <value>to</value>
549
+ <value/>
550
+ </choice>
551
+ </attribute>
552
+ </optional>
527
553
  <zeroOrMore>
528
554
  <ref name="sourceLocality"/>
529
555
  </zeroOrMore>
@@ -626,6 +652,9 @@
626
652
  <ref name="BibItemType"/>
627
653
  </attribute>
628
654
  </optional>
655
+ <optional>
656
+ <attribute name="schema-version"/>
657
+ </optional>
629
658
  <optional>
630
659
  <ref name="fetched"/>
631
660
  </optional>
@@ -720,6 +749,9 @@
720
749
  <ref name="BibItemType"/>
721
750
  </attribute>
722
751
  </optional>
752
+ <optional>
753
+ <attribute name="schema-version"/>
754
+ </optional>
723
755
  <optional>
724
756
  <ref name="fetched"/>
725
757
  </optional>
@@ -5,6 +5,7 @@
5
5
  we cannot have a new default namespace: we will end up with a grammar with two different
6
6
  namespaces, one for isostandard and one for csand additions. And we do not want that.
7
7
  -->
8
+ <include href="relaton-csa.rng"/>
8
9
  <include href="isodoc.rng">
9
10
  <start>
10
11
  <ref name="csand-standard"/>
@@ -55,46 +56,6 @@
55
56
  </choice>
56
57
  </element>
57
58
  </define>
58
- <define name="DocumentType">
59
- <choice>
60
- <value>guidance</value>
61
- <value>proposal</value>
62
- <value>standard</value>
63
- <value>report</value>
64
- <value>whitepaper</value>
65
- <value>charter</value>
66
- <value>policy</value>
67
- <value>glossary</value>
68
- <value>case-study</value>
69
- </choice>
70
- </define>
71
- <define name="BibDataExtensionType">
72
- <optional>
73
- <ref name="doctype"/>
74
- </optional>
75
- <optional>
76
- <ref name="docsubtype"/>
77
- </optional>
78
- <ref name="editorialgroup"/>
79
- <zeroOrMore>
80
- <ref name="ics"/>
81
- </zeroOrMore>
82
- </define>
83
- <define name="editorialgroup">
84
- <element name="editorialgroup">
85
- <oneOrMore>
86
- <ref name="technical-committee"/>
87
- </oneOrMore>
88
- </element>
89
- </define>
90
- <define name="technical-committee">
91
- <element name="committee">
92
- <optional>
93
- <attribute name="type"/>
94
- </optional>
95
- <text/>
96
- </element>
97
- </define>
98
59
  </include>
99
60
  <define name="csand-standard">
100
61
  <element name="csa-standard">
@@ -19,19 +19,7 @@
19
19
  -->
20
20
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
21
21
  <include href="reqt.rng"/>
22
- <!-- include "biblio.rnc" { } -->
23
22
  <include href="basicdoc.rng">
24
- <start>
25
- <ref name="standard-document"/>
26
- </start>
27
- <define name="doctype">
28
- <element name="doctype">
29
- <optional>
30
- <attribute name="abbreviation"/>
31
- </optional>
32
- <ref name="DocumentType"/>
33
- </element>
34
- </define>
35
23
  <define name="admonition">
36
24
  <element name="admonition">
37
25
  <attribute name="type">
@@ -117,24 +105,6 @@
117
105
  </optional>
118
106
  </element>
119
107
  </define>
120
- <define name="bibitem">
121
- <element name="bibitem">
122
- <attribute name="id">
123
- <data type="ID"/>
124
- </attribute>
125
- <optional>
126
- <attribute name="hidden">
127
- <data type="boolean"/>
128
- </attribute>
129
- </optional>
130
- <optional>
131
- <attribute name="suppress_identifier">
132
- <data type="boolean"/>
133
- </attribute>
134
- </optional>
135
- <ref name="BibliographicItem"/>
136
- </element>
137
- </define>
138
108
  <define name="section-title">
139
109
  <element name="title">
140
110
  <zeroOrMore>
@@ -207,11 +177,7 @@
207
177
  </optional>
208
178
  <optional>
209
179
  <attribute name="style">
210
- <choice>
211
- <value>basic</value>
212
- <value>full</value>
213
- <value>short</value>
214
- </choice>
180
+ <ref name="XrefStyleType"/>
215
181
  </attribute>
216
182
  </optional>
217
183
  <ref name="XrefBody"/>
@@ -248,42 +214,6 @@
248
214
  <ref name="PureTextElement"/>
249
215
  </oneOrMore>
250
216
  </define>
251
- <define name="localityStack">
252
- <element name="localityStack">
253
- <optional>
254
- <attribute name="connective">
255
- <choice>
256
- <value>and</value>
257
- <value>or</value>
258
- <value>from</value>
259
- <value>to</value>
260
- <value/>
261
- </choice>
262
- </attribute>
263
- </optional>
264
- <zeroOrMore>
265
- <ref name="locality"/>
266
- </zeroOrMore>
267
- </element>
268
- </define>
269
- <define name="sourceLocalityStack">
270
- <element name="sourceLocalityStack">
271
- <optional>
272
- <attribute name="connective">
273
- <choice>
274
- <value>and</value>
275
- <value>or</value>
276
- <value>from</value>
277
- <value>to</value>
278
- <value/>
279
- </choice>
280
- </attribute>
281
- </optional>
282
- <zeroOrMore>
283
- <ref name="sourceLocality"/>
284
- </zeroOrMore>
285
- </element>
286
- </define>
287
217
  <define name="ul">
288
218
  <element name="ul">
289
219
  <attribute name="id">
@@ -827,21 +757,6 @@
827
757
  </zeroOrMore>
828
758
  </element>
829
759
  </define>
830
- <define name="BibDataExtensionType">
831
- <ref name="doctype"/>
832
- <optional>
833
- <ref name="docsubtype"/>
834
- </optional>
835
- <optional>
836
- <ref name="editorialgroup"/>
837
- </optional>
838
- <zeroOrMore>
839
- <ref name="ics"/>
840
- </zeroOrMore>
841
- <zeroOrMore>
842
- <ref name="structuredidentifier"/>
843
- </zeroOrMore>
844
- </define>
845
760
  <!-- TitleType = text -->
846
761
  <define name="sections">
847
762
  <element name="sections">
@@ -881,7 +796,7 @@
881
796
  <ref name="BasicBlock"/>
882
797
  </zeroOrMore>
883
798
  <zeroOrMore>
884
- <ref name="bibitem"/>
799
+ <ref name="doc_bibitem"/>
885
800
  <zeroOrMore>
886
801
  <ref name="note"/>
887
802
  </zeroOrMore>
@@ -1112,6 +1027,7 @@
1112
1027
  <ref name="stem"/>
1113
1028
  <ref name="index"/>
1114
1029
  <ref name="eref"/>
1030
+ <ref name="erefstack"/>
1115
1031
  <ref name="xref"/>
1116
1032
  <ref name="hyperlink"/>
1117
1033
  </choice>
@@ -1126,6 +1042,7 @@
1126
1042
  <ref name="stem"/>
1127
1043
  <ref name="index"/>
1128
1044
  <ref name="eref"/>
1045
+ <ref name="erefstack"/>
1129
1046
  <ref name="xref"/>
1130
1047
  <ref name="hyperlink"/>
1131
1048
  </choice>
@@ -1139,6 +1056,7 @@
1139
1056
  <ref name="PureTextElement"/>
1140
1057
  <ref name="index"/>
1141
1058
  <ref name="eref"/>
1059
+ <ref name="erefstack"/>
1142
1060
  <ref name="xref"/>
1143
1061
  <ref name="hyperlink"/>
1144
1062
  </choice>
@@ -1219,6 +1137,24 @@
1219
1137
  </define>
1220
1138
  </include>
1221
1139
  <!-- end overrides -->
1140
+ <define name="doc_bibitem">
1141
+ <element name="bibitem">
1142
+ <attribute name="id">
1143
+ <data type="ID"/>
1144
+ </attribute>
1145
+ <optional>
1146
+ <attribute name="hidden">
1147
+ <data type="boolean"/>
1148
+ </attribute>
1149
+ </optional>
1150
+ <optional>
1151
+ <attribute name="suppress_identifier">
1152
+ <data type="boolean"/>
1153
+ </attribute>
1154
+ </optional>
1155
+ <ref name="BibliographicItem"/>
1156
+ </element>
1157
+ </define>
1222
1158
  <define name="image" combine="choice">
1223
1159
  <element name="svg">
1224
1160
  <oneOrMore>
@@ -1237,14 +1173,6 @@
1237
1173
  <value>tag</value>
1238
1174
  </choice>
1239
1175
  </define>
1240
- <define name="docsubtype">
1241
- <element name="subdoctype">
1242
- <ref name="DocumentSubtype"/>
1243
- </element>
1244
- </define>
1245
- <define name="DocumentSubtype">
1246
- <text/>
1247
- </define>
1248
1176
  <define name="colgroup">
1249
1177
  <element name="colgroup">
1250
1178
  <oneOrMore>
@@ -1266,6 +1194,7 @@
1266
1194
  <ref name="add"/>
1267
1195
  <ref name="del"/>
1268
1196
  <ref name="span"/>
1197
+ <ref name="erefstack"/>
1269
1198
  </choice>
1270
1199
  </define>
1271
1200
  <define name="add">
@@ -1273,6 +1202,7 @@
1273
1202
  <choice>
1274
1203
  <ref name="PureTextElement"/>
1275
1204
  <ref name="eref"/>
1205
+ <ref name="erefstack"/>
1276
1206
  <ref name="stem"/>
1277
1207
  <ref name="keyword"/>
1278
1208
  <ref name="xref"/>
@@ -1285,6 +1215,7 @@
1285
1215
  <choice>
1286
1216
  <ref name="PureTextElement"/>
1287
1217
  <ref name="eref"/>
1218
+ <ref name="erefstack"/>
1288
1219
  <ref name="stem"/>
1289
1220
  <ref name="keyword"/>
1290
1221
  <ref name="xref"/>
@@ -1349,6 +1280,7 @@
1349
1280
  </optional>
1350
1281
  <choice>
1351
1282
  <ref name="eref"/>
1283
+ <ref name="erefstack"/>
1352
1284
  <ref name="xref"/>
1353
1285
  <ref name="termref"/>
1354
1286
  </choice>
@@ -1606,45 +1538,6 @@
1606
1538
  </choice>
1607
1539
  </element>
1608
1540
  </define>
1609
- <define name="editorialgroup">
1610
- <element name="editorialgroup">
1611
- <oneOrMore>
1612
- <ref name="technical-committee"/>
1613
- </oneOrMore>
1614
- </element>
1615
- </define>
1616
- <define name="technical-committee">
1617
- <element name="technical-committee">
1618
- <ref name="IsoWorkgroup"/>
1619
- </element>
1620
- </define>
1621
- <define name="IsoWorkgroup">
1622
- <optional>
1623
- <attribute name="number"/>
1624
- </optional>
1625
- <optional>
1626
- <attribute name="type"/>
1627
- </optional>
1628
- <optional>
1629
- <attribute name="identifier"/>
1630
- </optional>
1631
- <optional>
1632
- <attribute name="prefix"/>
1633
- </optional>
1634
- <text/>
1635
- </define>
1636
- <define name="ics">
1637
- <element name="ics">
1638
- <element name="code">
1639
- <text/>
1640
- </element>
1641
- <optional>
1642
- <element name="text">
1643
- <text/>
1644
- </element>
1645
- </optional>
1646
- </element>
1647
- </define>
1648
1541
  <define name="standard-document">
1649
1542
  <element name="standard-document">
1650
1543
  <attribute name="version"/>
@@ -2080,6 +1973,7 @@
2080
1973
  </element>
2081
1974
  <choice>
2082
1975
  <ref name="eref"/>
1976
+ <ref name="erefstack"/>
2083
1977
  <ref name="xref"/>
2084
1978
  <ref name="termref"/>
2085
1979
  </choice>
@@ -2475,71 +2369,6 @@
2475
2369
  </optional>
2476
2370
  </element>
2477
2371
  </define>
2478
- <define name="structuredidentifier">
2479
- <element name="structuredidentifier">
2480
- <optional>
2481
- <attribute name="type"/>
2482
- </optional>
2483
- <oneOrMore>
2484
- <element name="agency">
2485
- <text/>
2486
- </element>
2487
- </oneOrMore>
2488
- <optional>
2489
- <element name="class">
2490
- <text/>
2491
- </element>
2492
- </optional>
2493
- <element name="docnumber">
2494
- <text/>
2495
- </element>
2496
- <optional>
2497
- <element name="partnumber">
2498
- <text/>
2499
- </element>
2500
- </optional>
2501
- <optional>
2502
- <element name="edition">
2503
- <text/>
2504
- </element>
2505
- </optional>
2506
- <optional>
2507
- <element name="version">
2508
- <text/>
2509
- </element>
2510
- </optional>
2511
- <optional>
2512
- <element name="supplementtype">
2513
- <text/>
2514
- </element>
2515
- </optional>
2516
- <optional>
2517
- <element name="supplementnumber">
2518
- <text/>
2519
- </element>
2520
- </optional>
2521
- <optional>
2522
- <element name="amendment">
2523
- <text/>
2524
- </element>
2525
- </optional>
2526
- <optional>
2527
- <element name="corrigendum">
2528
- <text/>
2529
- </element>
2530
- </optional>
2531
- <optional>
2532
- <element name="language">
2533
- <text/>
2534
- </element>
2535
- </optional>
2536
- <optional>
2537
- <element name="year">
2538
- <text/>
2539
- </element>
2540
- </optional>
2541
- </element>
2542
- </define>
2543
2372
  <define name="term-clause">
2544
2373
  <element name="clause">
2545
2374
  <optional>
@@ -2700,6 +2529,7 @@
2700
2529
  <ref name="xref"/>
2701
2530
  <ref name="hyperlink"/>
2702
2531
  <ref name="eref"/>
2532
+ <ref name="erefstack"/>
2703
2533
  </choice>
2704
2534
  <oneOrMore>
2705
2535
  <element name="coords">
@@ -2747,6 +2577,7 @@
2747
2577
  <ref name="xref"/>
2748
2578
  <ref name="hyperlink"/>
2749
2579
  <ref name="eref"/>
2580
+ <ref name="erefstack"/>
2750
2581
  </choice>
2751
2582
  </element>
2752
2583
  </zeroOrMore>
@@ -2795,6 +2626,15 @@
2795
2626
  <ref name="PureTextElement"/>
2796
2627
  </oneOrMore>
2797
2628
  </define>
2629
+ <define name="XrefConnectiveType">
2630
+ <choice>
2631
+ <value>and</value>
2632
+ <value>or</value>
2633
+ <value>from</value>
2634
+ <value>to</value>
2635
+ <value/>
2636
+ </choice>
2637
+ </define>
2798
2638
  <define name="XrefTarget">
2799
2639
  <element name="location">
2800
2640
  <attribute name="target">
@@ -2803,14 +2643,36 @@
2803
2643
  </data>
2804
2644
  </attribute>
2805
2645
  <attribute name="connective">
2806
- <choice>
2807
- <value>and</value>
2808
- <value>or</value>
2809
- <value>from</value>
2810
- <value>to</value>
2811
- <value/>
2812
- </choice>
2646
+ <ref name="XrefConnectiveType"/>
2813
2647
  </attribute>
2814
2648
  </element>
2815
2649
  </define>
2650
+ <define name="XrefStyleType">
2651
+ <choice>
2652
+ <value>basic</value>
2653
+ <value>full</value>
2654
+ <value>short</value>
2655
+ <value>id</value>
2656
+ </choice>
2657
+ </define>
2658
+ <define name="erefTypeWithConnective">
2659
+ <optional>
2660
+ <attribute name="connective">
2661
+ <ref name="XrefConnectiveType"/>
2662
+ </attribute>
2663
+ </optional>
2664
+ <ref name="erefType"/>
2665
+ </define>
2666
+ <define name="erefstack">
2667
+ <element name="erefstack">
2668
+ <oneOrMore>
2669
+ <element name="eref">
2670
+ <ref name="erefTypeWithConnective"/>
2671
+ </element>
2672
+ </oneOrMore>
2673
+ </element>
2674
+ </define>
2675
+ <start>
2676
+ <ref name="standard-document"/>
2677
+ </start>
2816
2678
  </grammar>
@@ -0,0 +1,48 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0">
3
+ <include href="biblio-standoc.rng">
4
+ <define name="DocumentType">
5
+ <choice>
6
+ <value>guidance</value>
7
+ <value>proposal</value>
8
+ <value>standard</value>
9
+ <value>report</value>
10
+ <value>whitepaper</value>
11
+ <value>charter</value>
12
+ <value>policy</value>
13
+ <value>glossary</value>
14
+ <value>case-study</value>
15
+ </choice>
16
+ </define>
17
+ <define name="BibDataExtensionType">
18
+ <optional>
19
+ <attribute name="schema-version"/>
20
+ </optional>
21
+ <optional>
22
+ <ref name="doctype"/>
23
+ </optional>
24
+ <optional>
25
+ <ref name="docsubtype"/>
26
+ </optional>
27
+ <ref name="editorialgroup"/>
28
+ <zeroOrMore>
29
+ <ref name="ics"/>
30
+ </zeroOrMore>
31
+ </define>
32
+ <define name="editorialgroup">
33
+ <element name="editorialgroup">
34
+ <oneOrMore>
35
+ <ref name="technical-committee"/>
36
+ </oneOrMore>
37
+ </element>
38
+ </define>
39
+ <define name="technical-committee">
40
+ <element name="committee">
41
+ <optional>
42
+ <attribute name="type"/>
43
+ </optional>
44
+ <text/>
45
+ </element>
46
+ </define>
47
+ </include>
48
+ </grammar>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csa
3
- VERSION = "2.1.10".freeze
3
+ VERSION = "2.1.12".freeze
4
4
  end
5
5
  end
@@ -21,12 +21,13 @@ Gem::Specification.new do |spec|
21
21
  spec.license = "BSD-2-Clause"
22
22
 
23
23
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
24
- f.match(%r{^(test|spec|features)/})
24
+ f.match(%r{^(test|spec|features|bin|.github)/}) \
25
+ || f.match(%r{Rakefile|bin/rspec})
25
26
  end
26
27
  spec.bindir = "exe"
27
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
29
  spec.require_paths = ["lib"]
29
- spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
30
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
30
31
 
31
32
  spec.add_dependency "metanorma-generic", "~> 2.2.2"
32
33
 
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.1.10
4
+ version: 2.1.12
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-10-10 00:00:00.000000000 Z
11
+ date: 2022-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -176,8 +176,6 @@ executables: []
176
176
  extensions: []
177
177
  extra_rdoc_files: []
178
178
  files:
179
- - ".github/workflows/rake.yml"
180
- - ".github/workflows/release.yml"
181
179
  - ".gitignore"
182
180
  - ".hound.yml"
183
181
  - ".rubocop.yml"
@@ -185,10 +183,6 @@ files:
185
183
  - Gemfile
186
184
  - LICENSE
187
185
  - README.adoc
188
- - Rakefile
189
- - bin/console
190
- - bin/rspec
191
- - bin/setup
192
186
  - lib/isodoc/csa/base_convert.rb
193
187
  - lib/isodoc/csa/csa.standard.xsl
194
188
  - lib/isodoc/csa/html/csa-logo-white.png
@@ -219,12 +213,14 @@ files:
219
213
  - lib/metanorma-csa.rb
220
214
  - lib/metanorma/csa.rb
221
215
  - lib/metanorma/csa/basicdoc.rng
216
+ - lib/metanorma/csa/biblio-standoc.rng
222
217
  - lib/metanorma/csa/biblio.rng
223
218
  - lib/metanorma/csa/boilerplate.xml
224
219
  - lib/metanorma/csa/converter.rb
225
220
  - lib/metanorma/csa/csa.rng
226
221
  - lib/metanorma/csa/isodoc.rng
227
222
  - lib/metanorma/csa/processor.rb
223
+ - lib/metanorma/csa/relaton-csa.rng
228
224
  - lib/metanorma/csa/reqt.rng
229
225
  - lib/metanorma/csa/version.rb
230
226
  - metanorma-csa.gemspec
@@ -241,14 +237,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
241
237
  requirements:
242
238
  - - ">="
243
239
  - !ruby/object:Gem::Version
244
- version: 2.5.0
240
+ version: 2.7.0
245
241
  required_rubygems_version: !ruby/object:Gem::Requirement
246
242
  requirements:
247
243
  - - ">="
248
244
  - !ruby/object:Gem::Version
249
245
  version: '0'
250
246
  requirements: []
251
- rubygems_version: 3.1.6
247
+ rubygems_version: 3.3.7
252
248
  signing_key:
253
249
  specification_version: 4
254
250
  summary: metanorma-csa lets you write CSA Normal Documents (CSAND) in AsciiDoc.
@@ -1,15 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: rake
4
-
5
- on:
6
- push:
7
- branches: [ master, main ]
8
- tags: [ v* ]
9
- pull_request:
10
-
11
- jobs:
12
- notify:
13
- uses: metanorma/ci/.github/workflows/mn-processor-rake.yml@main
14
- secrets:
15
- pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
@@ -1,24 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: release
4
-
5
- on:
6
- workflow_dispatch:
7
- inputs:
8
- next_version:
9
- description: |
10
- Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
11
- required: true
12
- default: 'skip'
13
- push:
14
- tags: [ v* ]
15
-
16
- jobs:
17
- release:
18
- uses: metanorma/ci/.github/workflows/rubygems-release.yml@main
19
- with:
20
- next_version: ${{ github.event.inputs.next_version }}
21
- secrets:
22
- rubygems-api-key: ${{ secrets.METANORMA_CI_RUBYGEMS_API_KEY }}
23
- pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
24
-
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
- require 'isodoc/gem_tasks'
4
-
5
- IsoDoc::GemTasks.install
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task :default => :spec
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'bundler/setup'
4
- require 'metanorma-csa'
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require 'irb'
14
- IRB.start(__FILE__)
data/bin/rspec DELETED
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'rspec' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require "pathname"
10
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path(
11
- "../../Gemfile", Pathname.new(__FILE__).realpath
12
- )
13
-
14
- require "rubygems"
15
- require "bundler/setup"
16
-
17
- load Gem.bin_path("rspec-core", "rspec")
18
-
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here