metanorma-cc 2.8.8 → 2.8.10

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.
@@ -0,0 +1,289 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ MathML 4 (Strict Content)
4
+ #########################
5
+ -->
6
+ <!--
7
+ Copyright 1998-2026 W3C (MIT, ERCIM, Keio, Beihang)
8
+
9
+ Use and distribution of this code are permitted under the terms
10
+ W3C Software Notice and License
11
+ http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
12
+ -->
13
+ <grammar ns="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
14
+ <start combine="choice">
15
+ <ref name="math.strict"/>
16
+ </start>
17
+ <define name="CommonAtt">
18
+ <optional>
19
+ <attribute name="id">
20
+ <data type="ID"/>
21
+ </attribute>
22
+ </optional>
23
+ <optional>
24
+ <attribute name="xref"/>
25
+ </optional>
26
+ </define>
27
+ <define name="math.strict">
28
+ <element name="math">
29
+ <ref name="math.attributes"/>
30
+ <zeroOrMore>
31
+ <ref name="ContExp"/>
32
+ </zeroOrMore>
33
+ </element>
34
+ </define>
35
+ <!--
36
+ METANORMA MODIFICATION (basicdoc-models#39): upstream combines CommonAtt
37
+ (id, xref) into math.attributes here; in the full-MathML composition the
38
+ math element already carries `id` via MathMLPGlobalAttributes
39
+ (mathml4-core.rnc) and `xref` via the presentation augmentation
40
+ (mathml4-presentation.rnc), so RELAX NG's duplicate-attribute restriction
41
+ rejects the composed grammar (jing: 'duplicate attribute "id"').
42
+ Upstream text was:
43
+ math.attributes &= CommonAtt
44
+ -->
45
+ <define name="ContExp">
46
+ <choice>
47
+ <ref name="semantics-contexp"/>
48
+ <ref name="cn"/>
49
+ <ref name="ci"/>
50
+ <ref name="csymbol"/>
51
+ <ref name="apply"/>
52
+ <ref name="bind"/>
53
+ <ref name="share"/>
54
+ <ref name="cerror"/>
55
+ <ref name="cbytes"/>
56
+ <ref name="cs"/>
57
+ </choice>
58
+ </define>
59
+ <define name="cn">
60
+ <element name="cn">
61
+ <ref name="cn.attributes"/>
62
+ <ref name="cn.content"/>
63
+ </element>
64
+ </define>
65
+ <define name="cn.content">
66
+ <text/>
67
+ </define>
68
+ <define name="cn.attributes">
69
+ <ref name="CommonAtt"/>
70
+ <attribute name="type">
71
+ <choice>
72
+ <value>integer</value>
73
+ <value>real</value>
74
+ <value>double</value>
75
+ <value>hexdouble</value>
76
+ </choice>
77
+ </attribute>
78
+ </define>
79
+ <define name="semantics-ci">
80
+ <element name="semantics">
81
+ <ref name="CommonAtt"/>
82
+ <choice>
83
+ <ref name="ci"/>
84
+ <ref name="semantics-ci"/>
85
+ </choice>
86
+ <zeroOrMore>
87
+ <choice>
88
+ <ref name="annotation"/>
89
+ <ref name="annotation-xml"/>
90
+ </choice>
91
+ </zeroOrMore>
92
+ </element>
93
+ </define>
94
+ <define name="semantics-contexp">
95
+ <element name="semantics">
96
+ <ref name="CommonAtt"/>
97
+ <ref name="MathExpression"/>
98
+ <zeroOrMore>
99
+ <choice>
100
+ <ref name="annotation"/>
101
+ <ref name="annotation-xml"/>
102
+ </choice>
103
+ </zeroOrMore>
104
+ </element>
105
+ </define>
106
+ <define name="annotation" combine="choice">
107
+ <element name="annotation">
108
+ <ref name="CommonAtt"/>
109
+ <text/>
110
+ </element>
111
+ </define>
112
+ <!--
113
+ METANORMA MODIFICATION (basicdoc-models#39): upstream re-opens
114
+ `anyElement` and `annotation-xml` here with combine=choice (|=). RELAX NG
115
+ permits only one combine method per name, which blocks the metanorma
116
+ wrapper's `&= notAllowed` bans (metanorma-mathml.rnc) of these foreign
117
+ markup escape hatches. The re-opens are dropped: the base definitions in
118
+ mathml4-core.rnc remain, and the wrapper forbids them outright anyway.
119
+ Upstream text was:
120
+ anyElement |= element (* - m:*) {(attribute * {text}|text| anyElement)*}
121
+ annotation-xml |= element annotation-xml {annotation-xml.attributes,
122
+ (MathExpression*|anyElement*)}
123
+ -->
124
+ <define name="annotation-xml.attributes" combine="interleave">
125
+ <ref name="CommonAtt"/>
126
+ <optional>
127
+ <ref name="cd"/>
128
+ </optional>
129
+ <optional>
130
+ <ref name="encoding"/>
131
+ </optional>
132
+ </define>
133
+ <!--
134
+ METANORMA MODIFICATION (basicdoc-models#39): upstream combines a second
135
+ `attribute encoding` into the `encoding` define (already defined in
136
+ mathml4-core.rnc); the interleave yields the same attribute twice wherever
137
+ the define is used, which RELAX NG forbids (jing: 'duplicate attribute
138
+ "encoding"').
139
+ Upstream text was:
140
+ encoding &= attribute encoding {xsd:string}
141
+ -->
142
+ <define name="ci">
143
+ <element name="ci">
144
+ <ref name="ci.attributes"/>
145
+ <ref name="ci.content"/>
146
+ </element>
147
+ </define>
148
+ <define name="ci.attributes">
149
+ <ref name="CommonAtt"/>
150
+ <optional>
151
+ <ref name="ci.type"/>
152
+ </optional>
153
+ </define>
154
+ <define name="ci.type">
155
+ <attribute name="type">
156
+ <choice>
157
+ <value>integer</value>
158
+ <value>rational</value>
159
+ <value>real</value>
160
+ <value>complex</value>
161
+ <value>complex-polar</value>
162
+ <value>complex-cartesian</value>
163
+ <value>constant</value>
164
+ <value>function</value>
165
+ <value>vector</value>
166
+ <value>list</value>
167
+ <value>set</value>
168
+ <value>matrix</value>
169
+ </choice>
170
+ </attribute>
171
+ </define>
172
+ <define name="ci.content">
173
+ <text/>
174
+ </define>
175
+ <define name="csymbol">
176
+ <element name="csymbol">
177
+ <ref name="csymbol.attributes"/>
178
+ <ref name="csymbol.content"/>
179
+ </element>
180
+ </define>
181
+ <define name="SymbolName">
182
+ <data type="NCName"/>
183
+ </define>
184
+ <define name="csymbol.attributes">
185
+ <ref name="CommonAtt"/>
186
+ <ref name="cd"/>
187
+ </define>
188
+ <define name="csymbol.content">
189
+ <ref name="SymbolName"/>
190
+ </define>
191
+ <define name="cd">
192
+ <attribute name="cd">
193
+ <data type="NCName"/>
194
+ </attribute>
195
+ </define>
196
+ <define name="name">
197
+ <attribute name="name">
198
+ <data type="NCName"/>
199
+ </attribute>
200
+ </define>
201
+ <define name="src">
202
+ <optional>
203
+ <attribute name="src">
204
+ <data type="anyURI"/>
205
+ </attribute>
206
+ </optional>
207
+ </define>
208
+ <define name="BvarQ">
209
+ <zeroOrMore>
210
+ <ref name="bvar"/>
211
+ </zeroOrMore>
212
+ </define>
213
+ <define name="bvar">
214
+ <element name="bvar">
215
+ <ref name="CommonAtt"/>
216
+ <choice>
217
+ <ref name="ci"/>
218
+ <ref name="semantics-ci"/>
219
+ </choice>
220
+ </element>
221
+ </define>
222
+ <define name="apply">
223
+ <element name="apply">
224
+ <ref name="CommonAtt"/>
225
+ <ref name="apply.content"/>
226
+ </element>
227
+ </define>
228
+ <define name="apply.content">
229
+ <oneOrMore>
230
+ <ref name="ContExp"/>
231
+ </oneOrMore>
232
+ </define>
233
+ <define name="bind">
234
+ <element name="bind">
235
+ <ref name="CommonAtt"/>
236
+ <ref name="bind.content"/>
237
+ </element>
238
+ </define>
239
+ <define name="bind.content">
240
+ <ref name="ContExp"/>
241
+ <zeroOrMore>
242
+ <ref name="bvar"/>
243
+ </zeroOrMore>
244
+ <ref name="ContExp"/>
245
+ </define>
246
+ <define name="share">
247
+ <element name="share">
248
+ <ref name="CommonAtt"/>
249
+ <ref name="src"/>
250
+ <empty/>
251
+ </element>
252
+ </define>
253
+ <define name="cerror">
254
+ <element name="cerror">
255
+ <ref name="cerror.attributes"/>
256
+ <ref name="csymbol"/>
257
+ <zeroOrMore>
258
+ <ref name="ContExp"/>
259
+ </zeroOrMore>
260
+ </element>
261
+ </define>
262
+ <define name="cerror.attributes">
263
+ <ref name="CommonAtt"/>
264
+ </define>
265
+ <define name="cbytes">
266
+ <element name="cbytes">
267
+ <ref name="cbytes.attributes"/>
268
+ <ref name="base64"/>
269
+ </element>
270
+ </define>
271
+ <define name="cbytes.attributes">
272
+ <ref name="CommonAtt"/>
273
+ </define>
274
+ <define name="base64">
275
+ <data type="base64Binary"/>
276
+ </define>
277
+ <define name="cs">
278
+ <element name="cs">
279
+ <ref name="cs.attributes"/>
280
+ <text/>
281
+ </element>
282
+ </define>
283
+ <define name="cs.attributes">
284
+ <ref name="CommonAtt"/>
285
+ </define>
286
+ <define name="MathExpression" combine="choice">
287
+ <ref name="ContExp"/>
288
+ </define>
289
+ </grammar>
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ MathML 4 (full)
4
+ ##############
5
+ -->
6
+ <!--
7
+ Copyright 1998-2026 W3C (MIT, ERCIM, Keio)
8
+
9
+ Use and distribution of this code are permitted under the terms
10
+ W3C Software Notice and License
11
+ http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
12
+ -->
13
+ <grammar ns="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0">
14
+ <!--
15
+ Presentation MathML
16
+ METANORMA MODIFICATION (basicdoc-models#39): upstream overrides
17
+ `anyElement` inside this include, but `anyElement` is defined in
18
+ mathml4-core.rnc, i.e. an include nested below mathml4-presentation.rnc;
19
+ libxml2's RELAX NG cannot override a define from a nested include (the
20
+ same constraint documented in metanorma-mathml.rnc). The override is
21
+ redundant for metanorma, whose wrapper bans anyElement outright.
22
+ Upstream text was:
23
+ include "mathml4-presentation.rnc" {
24
+ anyElement = element (* - m:*) {(attribute * {text}|text| anyElement)*}
25
+ }
26
+ -->
27
+ <include href="mathml4-presentation.rng"/>
28
+ <!-- Content MathML -->
29
+ <include href="mathml4-content.rng"/>
30
+ </grammar>
@@ -0,0 +1,59 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0">
3
+ <!--
4
+ Metanorma wrapper around the vendored W3C MathML 4 RelaxNG grammar
5
+ (vendored with marked modifications - - see README.adoc).
6
+ Includes the W3C grammar (start = math) and augments it with
7
+ metanorma's owned extension attributes. Referenced from basicdoc.rnc via:
8
+ mathml = external "mathml/metanorma-mathml.rnc"
9
+ Authoritative param list for data-metanorma-numberformat lives in plurimath
10
+ (Formatter::Standard::DEFAULT_OPTIONS); see metanorma/basicdoc-models#35.
11
+ MathML 3 -> 4 migration: metanorma/basicdoc-models#39 /
12
+ metanorma/metanorma#585.
13
+ -->
14
+ <include href="mathml4.rng"/>
15
+ <!--
16
+ metanorma number-formatting hint on <mn>; opaque comma-separated option
17
+ string parsed at presentation time (no-namespace data- attribute, which
18
+ the W3C MathMLPGlobalAttributes/NonMathMLAtt does not otherwise permit).
19
+ -->
20
+ <define name="mn.attributes" combine="interleave">
21
+ <optional>
22
+ <attribute name="data-metanorma-numberformat"/>
23
+ </optional>
24
+ </define>
25
+ <!--
26
+ Foreign annotation-xml considered harmful: the metanorma lutaml-model
27
+ serialiser emits no foreign markup, so the W3C annotation-xml escape hatch
28
+ (and its anyElement wildcard) is forbidden in the MathML we process. This
29
+ also removes the untyped `id` attribute the wildcard permits, which clashes
30
+ with xsd:ID under RELAX NG ID-type consistency (the callout-annotation
31
+ error). metanorma only emits presentation MathML; pre-empting the escape
32
+ hatch before semantic MathML is ever wired. Text-only <annotation> is
33
+ retained.
34
+
35
+ Expressed via `combine` (interleave with notAllowed) rather than an
36
+ include-override: annotation-xml/anyElement are defined in the transitively
37
+ included mathml4-core, and libxml2's RelaxNG (used by Nokogiri for fragment
38
+ / passthrough validation) cannot override a define from a nested include - -
39
+ it demands the combine attribute and otherwise fails to compile the whole
40
+ grammar (every passthrough then wrongly reports "Invalid passthrough
41
+ content"). jing accepts both forms; combine satisfies both. basicdoc-models#35
42
+ -->
43
+ <define name="annotation-xml" combine="interleave">
44
+ <notAllowed/>
45
+ </define>
46
+ <define name="anyElement" combine="interleave">
47
+ <notAllowed/>
48
+ </define>
49
+ </grammar>
50
+ <!--
51
+ NOTE on MathML 4's token content model: upstream `textorHTML`
52
+ (mathml4-core.rnc) admits embedded XHTML/SVG inside token elements
53
+ (mi/mn/mo/mtext/ms). That loosening is removed as a marked modification in
54
+ the vendored core file itself: libxml2's RELAX NG rejects the compiled svg
55
+ branch outright (breaking all passthrough validation), and metanorma's
56
+ serialiser never emits embedded HTML/SVG in math tokens. See the
57
+ METANORMA MODIFICATION comment in mathml4-core.rnc and
58
+ metanorma/basicdoc-models#39.
59
+ -->
@@ -39,7 +39,11 @@ the tag name of the top level containers</a:documentation>
39
39
  <data type="ID"/>
40
40
  </attribute>
41
41
  <ref name="NumberingAttributes"/>
42
- <ref name="BlockAttributes"/>
42
+ <ref name="BlockAttributesCore">
43
+ <a:documentation>requirement carries its own semantic `class` (provision class, below), so
44
+ it uses BlockAttributesCore to avoid duplicating the custom-class slot now
45
+ in BlockAttributes. See metanorma/metanorma-standoc#1197</a:documentation>
46
+ </ref>
43
47
  <optional>
44
48
  <attribute name="filename">
45
49
  <a:documentation>File name of the requirement model when exported</a:documentation>
@@ -225,7 +229,11 @@ machine-readable, and is not to be rendered as document output</a:documentation>
225
229
  <data type="boolean"/>
226
230
  </attribute>
227
231
  </optional>
228
- <ref name="BlockAttributes"/>
232
+ <ref name="BlockAttributesCore">
233
+ <a:documentation>component (a RequirementSubpart) carries its own semantic `class`, so this
234
+ uses BlockAttributesCore to avoid duplicating the custom-class slot in
235
+ BlockAttributes. See metanorma/metanorma-standoc#1197</a:documentation>
236
+ </ref>
229
237
  <oneOrMore>
230
238
  <choice>
231
239
  <a:documentation>Content of subpart: blocks, rather than provisions</a:documentation>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Cc
3
- VERSION = "2.8.8".freeze
3
+ VERSION = "2.8.10".freeze
4
4
  end
5
5
  end
data/metanorma-cc.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.bindir = "exe"
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ["lib"]
30
- spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
30
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.3.0")
31
31
 
32
32
  spec.add_dependency "metanorma-generic", "~> 3.4.0"
33
33
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.8
4
+ version: 2.8.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2026-06-22 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: metanorma-generic
@@ -205,7 +204,6 @@ extensions: []
205
204
  extra_rdoc_files: []
206
205
  files:
207
206
  - ".gitignore"
208
- - ".hound.yml"
209
207
  - ".rubocop.yml"
210
208
  - CODE_OF_CONDUCT.md
211
209
  - Gemfile
@@ -248,6 +246,12 @@ files:
248
246
  - lib/metanorma/cc/converter.rb
249
247
  - lib/metanorma/cc/isodoc.rng
250
248
  - lib/metanorma/cc/log.rb
249
+ - lib/metanorma/cc/mathml4-content.rng
250
+ - lib/metanorma/cc/mathml4-core.rng
251
+ - lib/metanorma/cc/mathml4-presentation.rng
252
+ - lib/metanorma/cc/mathml4-strict-content.rng
253
+ - lib/metanorma/cc/mathml4.rng
254
+ - lib/metanorma/cc/metanorma-mathml.rng
251
255
  - lib/metanorma/cc/processor.rb
252
256
  - lib/metanorma/cc/relaton-cc.rng
253
257
  - lib/metanorma/cc/reqt.rng
@@ -259,7 +263,6 @@ homepage: https://github.com/metanorma/metanorma-cc
259
263
  licenses:
260
264
  - BSD-2-Clause
261
265
  metadata: {}
262
- post_install_message:
263
266
  rdoc_options: []
264
267
  require_paths:
265
268
  - lib
@@ -267,15 +270,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
267
270
  requirements:
268
271
  - - ">="
269
272
  - !ruby/object:Gem::Version
270
- version: 3.1.0
273
+ version: 3.3.0
271
274
  required_rubygems_version: !ruby/object:Gem::Requirement
272
275
  requirements:
273
276
  - - ">="
274
277
  - !ruby/object:Gem::Version
275
278
  version: '0'
276
279
  requirements: []
277
- rubygems_version: 3.5.22
278
- signing_key:
280
+ rubygems_version: 4.0.10
279
281
  specification_version: 4
280
282
  summary: metanorma-cc lets you write CalConnect standards in AsciiDoc.
281
283
  test_files: []
data/.hound.yml DELETED
@@ -1,5 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- ruby:
4
- enabled: true
5
- config_file: .rubocop.yml