metanorma-generic 3.0.1 → 3.0.3

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: 7b9fbaa1e091c0f6edaa501c80a824e4ff03da4f2298cc0c7eb448b8022559d0
4
- data.tar.gz: 74607e5b5d24376bde715a7e00596265b3d32c1b5b4550608783d089109f813b
3
+ metadata.gz: 84ebc0f57d2adc50481a82940e80e0d2f89972c088df6677744719d717f6495b
4
+ data.tar.gz: 6e8b384f78ec51468642c1dd0d308a56f5e7f326927a58a0e8ed48800b3d2289
5
5
  SHA512:
6
- metadata.gz: f898b9d663f6619d91ad5d46d7d9e48a656f4c013006124d76b95a992b3ff87821d98fa4eae34aacdcc076c5a31c9b597bf957371d6abcca79c0ca1eb3bf9fa2
7
- data.tar.gz: d29162d79ecfb40d3f4b3655ebb856a48d575b19f727302cf2cad5b9b77c58228e027ce01102af616fc64059da2c7a3d14c6e00ccf66e46d2de6c413304b0e79
6
+ metadata.gz: 8f54dde566062f0f1e52dc32764f5dbd288d092acf366ae2279cf74c52b76a584329efd5e6bb666bac4f54e5f7b15c1d70a268c600904ac37d68d35442f6a5dd
7
+ data.tar.gz: cc4d7755a5eae79d1150e45cae14a87086df65609217fd015e9c2901c8142223c124f2f4512a41eb2bed6ba42a1b081d09126b17785d155e05f73a528418d224
@@ -267,6 +267,10 @@ in a document (e.g. sourcecode annotations)</a:documentation>
267
267
  <value>justified</value>
268
268
  </choice>
269
269
  </define>
270
+ <define name="IdRefType">
271
+ <a:documentation>Type of cross-references to elements. In BasicDoc, these always point to id { xsd:ID } </a:documentation>
272
+ <data type="IDREF"/>
273
+ </define>
270
274
  <define name="RequiredId">
271
275
  <a:documentation>Mandatory anchor of element, to be used for cross-references within the document</a:documentation>
272
276
  <attribute name="id">
@@ -382,33 +386,7 @@ in a document (e.g. sourcecode annotations)</a:documentation>
382
386
  <a:documentation>Block intended to capture reviewer comments about some text in the document</a:documentation>
383
387
  <element name="review">
384
388
  <ref name="RequiredId"/>
385
- <attribute name="reviewer">
386
- <a:documentation>The party who has offered the comment</a:documentation>
387
- </attribute>
388
- <optional>
389
- <attribute name="type">
390
- <a:documentation>The type of reviewer comment</a:documentation>
391
- </attribute>
392
- </optional>
393
- <optional>
394
- <attribute name="date">
395
- <a:documentation>The date when the comment was made</a:documentation>
396
- <data type="dateTime"/>
397
- </attribute>
398
- </optional>
399
- <optional>
400
- <attribute name="from">
401
- <a:documentation>Identifier for the start of the text or point in the text to which the comment applies.
402
- If not provided, the comment applies in the vicinity of the place it has been inserted into the text</a:documentation>
403
- <data type="IDREF"/>
404
- </attribute>
405
- </optional>
406
- <optional>
407
- <attribute name="to">
408
- <a:documentation>Identifier for the end of the text to which the comment applies</a:documentation>
409
- <data type="IDREF"/>
410
- </attribute>
411
- </optional>
389
+ <ref name="ReviewAttributes"/>
412
390
  <oneOrMore>
413
391
  <ref name="paragraph">
414
392
  <a:documentation>Reviewer comments content</a:documentation>
@@ -416,6 +394,35 @@ If not provided, the comment applies in the vicinity of the place it has been in
416
394
  </oneOrMore>
417
395
  </element>
418
396
  </define>
397
+ <define name="ReviewAttributes">
398
+ <attribute name="reviewer">
399
+ <a:documentation>The party who has offered the comment</a:documentation>
400
+ </attribute>
401
+ <optional>
402
+ <attribute name="type">
403
+ <a:documentation>The type of reviewer comment</a:documentation>
404
+ </attribute>
405
+ </optional>
406
+ <optional>
407
+ <attribute name="date">
408
+ <a:documentation>The date when the comment was made</a:documentation>
409
+ <data type="dateTime"/>
410
+ </attribute>
411
+ </optional>
412
+ <optional>
413
+ <attribute name="from">
414
+ <a:documentation>Identifier for the start of the text or point in the text to which the comment applies.
415
+ If not provided, the comment applies in the vicinity of the place it has been inserted into the text</a:documentation>
416
+ <ref name="IdRefType"/>
417
+ </attribute>
418
+ </optional>
419
+ <optional>
420
+ <attribute name="to">
421
+ <a:documentation>Identifier for the end of the text to which the comment applies</a:documentation>
422
+ <ref name="IdRefType"/>
423
+ </attribute>
424
+ </optional>
425
+ </define>
419
426
  <define name="NumberingAttributes">
420
427
  <optional>
421
428
  <attribute name="unnumbered">
@@ -857,6 +864,7 @@ in case the table cannot be rendered accessibly (HTML 5)</a:documentation>
857
864
  <define name="tr">
858
865
  <a:documentation>Sequence of cells to be displayed as a row in a table</a:documentation>
859
866
  <element name="tr">
867
+ <ref name="TrAttributes"/>
860
868
  <oneOrMore>
861
869
  <choice>
862
870
  <ref name="td">
@@ -869,6 +877,9 @@ in case the table cannot be rendered accessibly (HTML 5)</a:documentation>
869
877
  </oneOrMore>
870
878
  </element>
871
879
  </define>
880
+ <define name="TrAttributes">
881
+ <empty/>
882
+ </define>
872
883
  <define name="tr-no-id">
873
884
  <a:documentation>Sequence of cells to be displayed as a row in a table: optional ID attributes recursively (for use in Relaton, metadata)</a:documentation>
874
885
  <element name="tr">
@@ -1497,7 +1508,7 @@ Restricted recursively to contain only other such inline elements with no identi
1497
1508
  <attribute name="to">
1498
1509
  <a:documentation>A reference to an anchor element (typically a bookmark),
1499
1510
  to indicate that the index range covers a range of locations between the current index element and the `to` anchor</a:documentation>
1500
- <data type="IDREF"/>
1511
+ <ref name="IdRefType"/>
1501
1512
  </attribute>
1502
1513
  </optional>
1503
1514
  <ref name="index-primary">
@@ -1655,7 +1666,7 @@ which can be bookmarks as well as block or section references</a:documentation>
1655
1666
  <define name="XrefAttributes">
1656
1667
  <attribute name="target">
1657
1668
  <a:documentation>The identifier of a section, block or inlined element being referenced</a:documentation>
1658
- <data type="IDREF"/>
1669
+ <ref name="IdRefType"/>
1659
1670
  </attribute>
1660
1671
  <optional>
1661
1672
  <attribute name="type">
@@ -1694,23 +1705,29 @@ which can be bookmarks as well as block or section references</a:documentation>
1694
1705
  <a:documentation>Inline reference to a paragraph or paragraphs, appearing as a footnote.
1695
1706
  The target of a footnote is the location it is embedded in within the text</a:documentation>
1696
1707
  <element name="fn">
1697
- <attribute name="reference">
1698
- <a:documentation>The number of the footnote, used to identify it visually</a:documentation>
1699
- </attribute>
1700
- <oneOrMore>
1701
- <ref name="paragraph">
1702
- <a:documentation>The content of the footnote</a:documentation>
1703
- </ref>
1704
- </oneOrMore>
1708
+ <ref name="FnAttributes"/>
1709
+ <ref name="FnBody"/>
1705
1710
  </element>
1706
1711
  </define>
1712
+ <define name="FnBody">
1713
+ <oneOrMore>
1714
+ <ref name="paragraph">
1715
+ <a:documentation>The content of the footnote</a:documentation>
1716
+ </ref>
1717
+ </oneOrMore>
1718
+ </define>
1719
+ <define name="FnAttributes">
1720
+ <attribute name="reference">
1721
+ <a:documentation>The number of the footnote, used to identify it visually</a:documentation>
1722
+ </attribute>
1723
+ </define>
1707
1724
  <define name="callout">
1708
1725
  <a:documentation>Inline reference to a paragraph or paragraphs, appearing as annotation of source code</a:documentation>
1709
1726
  <element name="callout">
1710
1727
  <attribute name="target">
1711
1728
  <a:documentation>The target of the callout is understood to be the location of the callout within the source code;
1712
1729
  the extent of the target is not expressed overtly</a:documentation>
1713
- <data type="IDREF"/>
1730
+ <ref name="IdRefType"/>
1714
1731
  </attribute>
1715
1732
  <text>
1716
1733
  <a:documentation>The label of the callout, used to identify its target within the source code</a:documentation>
@@ -1,13 +1,14 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" 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
3
  <include href="biblio.rng">
4
+ <!-- ALERT: we cannot have comments on root element, as they intervene with https://github.com/metanorma/metanorma/issues/437 fix -->
5
+ <!--
6
+ Add-ons to biblio.rnc for standoc model: defines the extension point BibDataExtensionType
7
+ of relaton
8
+
9
+ Specialisations as for biblio.rnc. Extension point can be redefined completely for a flavour of standoc
10
+ (SDO); but other elements in Bibdata can only be extended (more specialised vocabularies for Bibdata)
11
+ -->
11
12
  <define name="BibData">
12
13
  <a:documentation>The bibliographic description of a standardisation document</a:documentation>
13
14
  <ref name="StandardBibliographicItem"/>
@@ -91,6 +92,9 @@ a standards definition organization</a:documentation>
91
92
  <a:documentation>Representation of the identifier for the standardisation document, giving its individual semantic components</a:documentation>
92
93
  </ref>
93
94
  </zeroOrMore>
95
+ <ref name="DocumentImages">
96
+ <a:documentation>Coverpage and other images to be rendered with document</a:documentation>
97
+ </ref>
94
98
  </define>
95
99
  <define name="doctype">
96
100
  <a:documentation>Classification of the standardisation document</a:documentation>
@@ -268,6 +272,32 @@ and not those document components</a:documentation>
268
272
  </optional>
269
273
  </element>
270
274
  </define>
275
+ <define name="DocumentImages">
276
+ <zeroOrMore>
277
+ <element name="coverpage-image">
278
+ <a:documentation>Images to be displayed on the coverpage of the document</a:documentation>
279
+ <ref name="image-no-id"/>
280
+ </element>
281
+ </zeroOrMore>
282
+ <zeroOrMore>
283
+ <element name="innercoverpage-image">
284
+ <a:documentation>Images to be displayed on the inner coverpage of the document</a:documentation>
285
+ <ref name="image-no-id"/>
286
+ </element>
287
+ </zeroOrMore>
288
+ <zeroOrMore>
289
+ <element name="tocside-image">
290
+ <a:documentation>Images to be displayed on the Table of Contents page of the document</a:documentation>
291
+ <ref name="image-no-id"/>
292
+ </element>
293
+ </zeroOrMore>
294
+ <zeroOrMore>
295
+ <element name="backpage-image">
296
+ <a:documentation>Images to be displayed on the backpage of the document</a:documentation>
297
+ <ref name="image-no-id"/>
298
+ </element>
299
+ </zeroOrMore>
300
+ </define>
271
301
  <define name="StandardBibliographicItem">
272
302
  <ref name="BibliographicItem"/>
273
303
  <zeroOrMore>
@@ -1,23 +1,25 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <!--
3
- instantiations of this grammar may replace leaf strings
4
- with more elaborated types; e.g. title (text) replaced with
5
- title-main, title-intro, title-part; type replaced with
6
- enum.
7
-
8
- some renaming at leaf nodes is permissible
9
-
10
- obligations can change both from optional to mandatory,
11
- and from mandatory to optional; optional elements may
12
- be omitted; freely positioned alternatives may be replaced
13
- with strict ordering
14
-
15
- DO NOT introduce a namespace here. We do not want a distinct namespace
16
- for these elements, and a distinct namespace for any grammar inheriting
17
- these elements; we just want one namespace for any child grammars
18
- of this.
19
- -->
20
2
  <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">
3
+ <!--
4
+ ALERT: we cannot have comments on root element, as they intervene with https://github.com/metanorma/metanorma/issues/437 fix
5
+
6
+ Instantiations of this grammar may replace leaf strings
7
+ with more elaborated types; e.g. title (text) replaced with
8
+ title-main, title-intro, title-part; type replaced with
9
+ enum.
10
+
11
+ Some renaming at leaf nodes is permissible
12
+
13
+ Obligations can change both from optional to mandatory,
14
+ and from mandatory to optional; optional elements may
15
+ be omitted; freely positioned alternatives may be replaced
16
+ with strict ordering
17
+
18
+ DO NOT introduce a namespace here. We do not want a distinct namespace
19
+ for these elements, and a distinct namespace for any grammar inheriting
20
+ these elements; we just want one namespace for any child grammars
21
+ of this.
22
+ -->
21
23
  <!--
22
24
  https://www.myintervals.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/
23
25
  iso8601date = xsd:string { pattern = "([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([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])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?" }
@@ -1241,6 +1243,11 @@ Refer to `BibliographicItem` for definitions</a:documentation>
1241
1243
  </define>
1242
1244
  <define name="formattedref">
1243
1245
  <element name="formattedref">
1246
+ <optional>
1247
+ <attribute name="format">
1248
+ <a:documentation>format of formatted reference; Metanorma assumes references are formatted as Metanorma XML</a:documentation>
1249
+ </attribute>
1250
+ </optional>
1244
1251
  <oneOrMore>
1245
1252
  <ref name="TextElement"/>
1246
1253
  </oneOrMore>
@@ -1812,6 +1819,11 @@ May be used to differentiate rendering of notes in bibliographies</a:documentati
1812
1819
  <a:documentation>Abstract of bibliographic item</a:documentation>
1813
1820
  <element name="abstract">
1814
1821
  <ref name="LocalizedStringAttributes"/>
1822
+ <optional>
1823
+ <attribute name="format">
1824
+ <a:documentation>What format the formatted abstract is in. In Metanorma, assumed to be Metanorma XML</a:documentation>
1825
+ </attribute>
1826
+ </optional>
1815
1827
  <choice>
1816
1828
  <oneOrMore>
1817
1829
  <ref name="BasicBlockNoId">
@@ -8,22 +8,11 @@ require "pathname"
8
8
  module Metanorma
9
9
  module Generic
10
10
  class Converter < Standoc::Converter
11
- XML_ROOT_TAG = "generic-standard".freeze
12
- XML_NAMESPACE = "https://www.metanorma.org/ns/generic".freeze
13
-
14
11
  register_for "generic"
15
12
 
16
- #def xml_root_tag
17
- #configuration.xml_root_tag || XML_ROOT_TAG
18
- #end
19
- #
20
- #def xml_namespace
21
- #configuration.document_namespace || XML_NAMESPACE
22
- #end
23
-
24
13
  def baselocation(loc)
25
14
  loc.nil? and return nil
26
- return loc
15
+ loc
27
16
  end
28
17
 
29
18
  def docidentifier_cleanup(xmldoc)
@@ -46,7 +35,7 @@ module Metanorma
46
35
  end
47
36
  type = @default_doctype || configuration.doctypes.keys[0]
48
37
  if !configuration.doctypes.key?(d)
49
- (node.attr("doctype") && node.attr("doctype") != "article") and # factory default
38
+ node.attr("doctype") && node.attr("doctype") != "article" and # factory default
50
39
  @log.add("Document Attributes", nil,
51
40
  "#{d} is not a legal document type: reverting to '#{type}'")
52
41
  d = type
@@ -98,11 +87,13 @@ module Metanorma
98
87
  nil, false, "#{@filename}.pdf")
99
88
  end
100
89
 
101
- def validate(doc)
102
- content_validate(doc)
103
- schema_validate(formattedstr_strip(doc.dup),
104
- baselocation(configuration.validate_rng_file) ||
105
- File.join(File.dirname(__FILE__), "generic.rng"))
90
+ def schema_location
91
+ baselocation(configuration.validate_rng_file) ||
92
+ File.join(File.dirname(__FILE__), "generic.rng")
93
+ end
94
+
95
+ def schema_file
96
+ configuration.validate_rng_file || "generic.rng"
106
97
  end
107
98
 
108
99
  def content_validate(doc)
@@ -118,7 +109,7 @@ module Metanorma
118
109
  def stage_validate(xmldoc)
119
110
  stages = configuration.stage_abbreviations&.keys || return
120
111
  stages.empty? and return
121
- stage = xmldoc&.at("//bibdata/status/stage")&.text
112
+ stage = xmldoc.at("//bibdata/status/stage")&.text
122
113
  stages.include? stage or
123
114
  @log.add("Document Attributes", nil,
124
115
  "#{stage} is not a recognised status")
@@ -150,7 +141,8 @@ module Metanorma
150
141
  def presentation_xml_converter(node)
151
142
  IsoDoc::Generic::PresentationXMLConvert
152
143
  .new(html_extract_attributes(node)
153
- .merge(output_formats: ::Metanorma::Generic::Processor.new.output_formats))
144
+ .merge(output_formats: ::Metanorma::Generic::Processor.new
145
+ .output_formats))
154
146
  end
155
147
 
156
148
  alias_method :pdf_converter, :html_converter
@@ -1,11 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar ns='https://www.metanorma.org/ns/standoc' xmlns="http://relaxng.org/ns/structure/1.0">
3
- <!--
4
- VERSION v1.2.1
5
- Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
6
- we cannot have a new default namespace: we will end up with a grammar with two different
7
- namespaces, one for isostandard and one for csand additions. And we do not want that.
8
- -->
9
3
  <include href="biblio-standoc.rng"/>
10
4
  <include href="isodoc.rng">
11
5
  <define name="standard-document">
@@ -1,24 +1,27 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <!--
3
- instantiations of this grammar may replace leaf strings
4
- with more elaborated types; e.g. title (text) replaced with
5
- title-main, title-intro, title-part; type replaced with
6
- enum.
7
-
8
- some renaming at leaf nodes is permissible
9
-
10
- obligations can change both from optional to mandatory,
11
- and from mandatory to optional; optional elements may
12
- be omitted; freely positioned alternatives may be replaced
13
- with strict ordering
14
-
15
- DO NOT introduce a namespace here. We do not want a distinct namespace
16
- for these elements, and a distinct namespace for any grammar inheriting
17
- these elements; we just want one namespace for any child grammars
18
- of this.
19
- -->
20
- <!-- VERSION v2.0.0 -->
21
2
  <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">
3
+ <!-- VERSION v2.0.6 -->
4
+
5
+ <!--
6
+ ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
7
+
8
+ instantiations of this grammar may replace leaf strings
9
+ with more elaborated types; e.g. title (text) replaced with
10
+ title-main, title-intro, title-part; type replaced with
11
+ enum.
12
+
13
+ some renaming at leaf nodes is permissible
14
+
15
+ obligations can change both from optional to mandatory,
16
+ and from mandatory to optional; optional elements may
17
+ be omitted; freely positioned alternatives may be replaced
18
+ with strict ordering
19
+
20
+ DO NOT introduce a namespace here. We do not want a distinct namespace
21
+ for these elements, and a distinct namespace for any grammar inheriting
22
+ these elements; we just want one namespace for any child grammars
23
+ of this.
24
+ -->
22
25
  <include href="reqt.rng"/>
23
26
  <include href="basicdoc.rng">
24
27
  <define name="amend">
@@ -33,6 +36,12 @@
33
36
  </zeroOrMore>
34
37
  </element>
35
38
  </define>
39
+ <define name="IdRefType">
40
+ <a:documentation>Cross-references are not normalised to xsd:IDREF in Semantic XML: that is deferred to Presentation XML.
41
+ All IdRefType instances point not to `@id` in Semantic XML, which is the Content GUID for an element,
42
+ but to `@anchor`, the user-supplied cross-reference</a:documentation>
43
+ <text/>
44
+ </define>
36
45
  <define name="index-primary">
37
46
  <element name="primary">
38
47
  <oneOrMore>
@@ -235,7 +244,7 @@
235
244
  <a:documentation>Notes specific to this block</a:documentation>
236
245
  </ref>
237
246
  </zeroOrMore>
238
- <ref name="TermSource">
247
+ <ref name="BlockSource">
239
248
  <a:documentation>A source for the table</a:documentation>
240
249
  </ref>
241
250
  </define>
@@ -259,10 +268,112 @@ and is intended to be referenced by a callout within the source code</a:document
259
268
  <a:documentation>Notes whose scope is the current block</a:documentation>
260
269
  </ref>
261
270
  </zeroOrMore>
262
- <ref name="TermSource">
271
+ <ref name="BlockSource">
263
272
  <a:documentation>A source for the block</a:documentation>
264
273
  </ref>
265
274
  </define>
275
+ <define name="FigureBody">
276
+ <optional>
277
+ <ref name="tname">
278
+ <a:documentation>The caption of the block</a:documentation>
279
+ </ref>
280
+ </optional>
281
+ <choice>
282
+ <a:documentation>Content of the figure</a:documentation>
283
+ <ref name="image"/>
284
+ <ref name="video"/>
285
+ <ref name="audio"/>
286
+ <ref name="pre"/>
287
+ <oneOrMore>
288
+ <ref name="paragraph-with-footnote"/>
289
+ </oneOrMore>
290
+ <zeroOrMore>
291
+ <ref name="figure"/>
292
+ </zeroOrMore>
293
+ </choice>
294
+ <zeroOrMore>
295
+ <ref name="fn">
296
+ <a:documentation>Footnotes specific to the figure</a:documentation>
297
+ </ref>
298
+ </zeroOrMore>
299
+ <optional>
300
+ <ref name="dl">
301
+ <a:documentation>An optional definitions list defining any symbols used in the figure</a:documentation>
302
+ </ref>
303
+ </optional>
304
+ <zeroOrMore>
305
+ <ref name="note">
306
+ <a:documentation>Notes whose scope is the current block</a:documentation>
307
+ </ref>
308
+ </zeroOrMore>
309
+ <ref name="BlockSource">
310
+ <a:documentation>A source for the block</a:documentation>
311
+ </ref>
312
+ </define>
313
+ <define name="FigureNoIdBody">
314
+ <optional>
315
+ <ref name="source">
316
+ <a:documentation>A URI or other reference intended to link to an externally hosted image (or equivalent)</a:documentation>
317
+ </ref>
318
+ </optional>
319
+ <optional>
320
+ <ref name="tname">
321
+ <a:documentation>The caption of the block</a:documentation>
322
+ </ref>
323
+ </optional>
324
+ <choice>
325
+ <a:documentation>Content of the figure</a:documentation>
326
+ <ref name="image-no-id"/>
327
+ <ref name="video-no-id"/>
328
+ <ref name="audio-no-id"/>
329
+ <ref name="pre-no-id"/>
330
+ <oneOrMore>
331
+ <ref name="paragraph-with-footnote-no-id"/>
332
+ </oneOrMore>
333
+ <zeroOrMore>
334
+ <ref name="figure-no-id"/>
335
+ </zeroOrMore>
336
+ </choice>
337
+ <zeroOrMore>
338
+ <ref name="fn">
339
+ <a:documentation>Footnotes specific to the figure</a:documentation>
340
+ </ref>
341
+ </zeroOrMore>
342
+ <optional>
343
+ <ref name="dl-no-id">
344
+ <a:documentation>An optional definitions list defining any symbols used in the figure</a:documentation>
345
+ </ref>
346
+ </optional>
347
+ <zeroOrMore>
348
+ <ref name="note-no-id">
349
+ <a:documentation>Notes whose scope is the current block</a:documentation>
350
+ </ref>
351
+ </zeroOrMore>
352
+ <ref name="BlockSource">
353
+ <a:documentation>A source for the block</a:documentation>
354
+ </ref>
355
+ </define>
356
+ <define name="source">
357
+ <element name="source">
358
+ <attribute name="status">
359
+ <a:documentation>The status of the term as it is used in this document, relative to its definition in the original document</a:documentation>
360
+ <ref name="SourceStatusType"/>
361
+ </attribute>
362
+ <attribute name="type">
363
+ <a:documentation>The type of the managed term in the present context</a:documentation>
364
+ <ref name="SourceTypeType"/>
365
+ </attribute>
366
+ <ref name="origin">
367
+ <a:documentation>The original document and location where the term definition has been obtained from</a:documentation>
368
+ </ref>
369
+ <optional>
370
+ <ref name="modification">
371
+ <a:documentation>Any changes that the definition of the term has undergone relative to the original document,
372
+ in order to be applicable in this standardisation document</a:documentation>
373
+ </ref>
374
+ </optional>
375
+ </element>
376
+ </define>
266
377
  <define name="sourcecodebody">
267
378
  <a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
268
379
  (The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
@@ -414,6 +525,13 @@ normative or informative references, some split references into sections organiz
414
525
  </oneOrMore>
415
526
  </choice>
416
527
  </define>
528
+ <define name="TrAttributes">
529
+ <optional>
530
+ <attribute name="style">
531
+ <a:documentation>CSS style: only background-color supported</a:documentation>
532
+ </attribute>
533
+ </optional>
534
+ </define>
417
535
  <define name="table-note">
418
536
  <element name="note">
419
537
  <ref name="OptionalId"/>
@@ -476,6 +594,22 @@ gives an explicit page orientation</a:documentation>
476
594
  </define>
477
595
  </include>
478
596
  <!-- end overrides -->
597
+ <define name="FnAttributes" combine="interleave">
598
+ <optional>
599
+ <attribute name="hiddenref">
600
+ <a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
601
+ This is done if the footnote reference is already presented in some other form, e.g. within a figure image.</a:documentation>
602
+ <data type="boolean"/>
603
+ </attribute>
604
+ </optional>
605
+ </define>
606
+ <define name="TdAttributes" combine="interleave">
607
+ <optional>
608
+ <attribute name="style">
609
+ <a:documentation>CSS style: only background-color supported</a:documentation>
610
+ </attribute>
611
+ </optional>
612
+ </define>
479
613
  <define name="NumberingAttributes" combine="interleave">
480
614
  <optional>
481
615
  <attribute name="number">
@@ -654,6 +788,39 @@ titlecase, or lowercase</a:documentation>
654
788
  </attribute>
655
789
  </optional>
656
790
  </define>
791
+ <define name="Basic-Section-Attributes" combine="interleave">
792
+ <optional>
793
+ <attribute name="obligation">
794
+ <ref name="ObligationType"/>
795
+ </attribute>
796
+ </optional>
797
+ </define>
798
+ <define name="RequiredId" combine="interleave">
799
+ <optional>
800
+ <attribute name="anchor">
801
+ <a:documentation>User-supplied anchor of element; replaced by content-based id, with all references to the anchor updated accordingly</a:documentation>
802
+ </attribute>
803
+ </optional>
804
+ <optional>
805
+ <attribute name="source">
806
+ <a:documentation>Sourcing of the current element in an external data model</a:documentation>
807
+ <ref name="IdRefType"/>
808
+ </attribute>
809
+ </optional>
810
+ </define>
811
+ <define name="OptionalId" combine="interleave">
812
+ <optional>
813
+ <attribute name="anchor">
814
+ <a:documentation> User-supplied anchor of element; replaced by content-based id, with all references to the anchor updated accordingly</a:documentation>
815
+ </attribute>
816
+ </optional>
817
+ <optional>
818
+ <attribute name="source">
819
+ <a:documentation>Sourcing of the current element in an external data model</a:documentation>
820
+ <ref name="IdRefType"/>
821
+ </attribute>
822
+ </optional>
823
+ </define>
657
824
  <define name="ObligationType">
658
825
  <a:documentation>The force of a clause in a standard document: whether it has normative or informative effect</a:documentation>
659
826
  <choice>
@@ -799,6 +966,7 @@ titlecase, or lowercase</a:documentation>
799
966
  is used in particular to capture mutually agreed definitions of codepoints in Unicode Private Use Area</a:documentation>
800
967
  </attribute>
801
968
  </optional>
969
+ <ref name="OptionalId"/>
802
970
  <oneOrMore>
803
971
  <ref name="TextElement">
804
972
  <a:documentation>Textual content of span</a:documentation>
@@ -1048,7 +1216,7 @@ That concept may be defined as a term within the current document, or it may be
1048
1216
  <element name="label">
1049
1217
  <!-- Identifier of form input element that this element is a label of -->
1050
1218
  <attribute name="for">
1051
- <data type="IDREF"/>
1219
+ <ref name="IdRefType"/>
1052
1220
  </attribute>
1053
1221
  <zeroOrMore>
1054
1222
  <ref name="PureTextElement"/>
@@ -1168,13 +1336,6 @@ numbers</a:documentation>
1168
1336
  </attribute>
1169
1337
  </optional>
1170
1338
  </define>
1171
- <define name="Basic-Section-Attributes" combine="interleave">
1172
- <optional>
1173
- <attribute name="obligation">
1174
- <ref name="ObligationType"/>
1175
- </attribute>
1176
- </optional>
1177
- </define>
1178
1339
  <define name="reference-clause">
1179
1340
  <a:documentation>References clause with recursive nesting</a:documentation>
1180
1341
  <element name="clause">
@@ -1215,7 +1376,7 @@ numbers</a:documentation>
1215
1376
  </choice>
1216
1377
  </attribute>
1217
1378
  <attribute name="flavor">
1218
- <a:documentation>Metanorma flavor, indicating SDO whose requiremnts the realisation aligns to</a:documentation>
1379
+ <a:documentation>Metanorma flavor, indicating SDO whose requirements the realisation aligns to</a:documentation>
1219
1380
  </attribute>
1220
1381
  </define>
1221
1382
  <define name="standard-document">
@@ -1225,6 +1386,11 @@ numbers</a:documentation>
1225
1386
  <ref name="bibdata">
1226
1387
  <a:documentation>Bibliographic description of the document itself, expressed in the Relaton model</a:documentation>
1227
1388
  </ref>
1389
+ <zeroOrMore>
1390
+ <ref name="termdocsource">
1391
+ <a:documentation>Source for term definitions in the document</a:documentation>
1392
+ </ref>
1393
+ </zeroOrMore>
1228
1394
  <optional>
1229
1395
  <ref name="misccontainer">
1230
1396
  <a:documentation>Extension point for extraneous elements that need to be added to standards document as data</a:documentation>
@@ -1235,36 +1401,44 @@ numbers</a:documentation>
1235
1401
  <a:documentation>Front matter that is repeated at the start of documents issued from an SDO, with content not specific to the document</a:documentation>
1236
1402
  </ref>
1237
1403
  </optional>
1404
+ <ref name="DocumentBody"/>
1238
1405
  <optional>
1239
- <ref name="preface">
1240
- <a:documentation>Prefatory sections</a:documentation>
1241
- </ref>
1242
- </optional>
1243
- <ref name="sections">
1244
- <a:documentation>Main body of document</a:documentation>
1245
- </ref>
1246
- <zeroOrMore>
1247
- <ref name="annex">
1248
- <a:documentation>Annex sections</a:documentation>
1249
- </ref>
1250
- </zeroOrMore>
1251
- <optional>
1252
- <ref name="bibliography">
1253
- <a:documentation>Bibliographic sections</a:documentation>
1254
- </ref>
1255
- </optional>
1256
- <zeroOrMore>
1257
- <ref name="indexsect">
1258
- <a:documentation>Index of the document</a:documentation>
1259
- </ref>
1260
- </zeroOrMore>
1261
- <optional>
1262
- <ref name="colophon">
1263
- <a:documentation>Colophon or postface material</a:documentation>
1406
+ <ref name="review-container">
1407
+ <a:documentation>Annotations to the document</a:documentation>
1264
1408
  </ref>
1265
1409
  </optional>
1266
1410
  </element>
1267
1411
  </define>
1412
+ <define name="DocumentBody">
1413
+ <optional>
1414
+ <ref name="preface">
1415
+ <a:documentation>Prefatory sections</a:documentation>
1416
+ </ref>
1417
+ </optional>
1418
+ <ref name="sections">
1419
+ <a:documentation>Main body of document</a:documentation>
1420
+ </ref>
1421
+ <zeroOrMore>
1422
+ <ref name="annex">
1423
+ <a:documentation>Annex sections</a:documentation>
1424
+ </ref>
1425
+ </zeroOrMore>
1426
+ <optional>
1427
+ <ref name="bibliography">
1428
+ <a:documentation>Bibliographic sections</a:documentation>
1429
+ </ref>
1430
+ </optional>
1431
+ <zeroOrMore>
1432
+ <ref name="indexsect">
1433
+ <a:documentation>Index of the document</a:documentation>
1434
+ </ref>
1435
+ </zeroOrMore>
1436
+ <optional>
1437
+ <ref name="colophon">
1438
+ <a:documentation>Colophon or postface material</a:documentation>
1439
+ </ref>
1440
+ </optional>
1441
+ </define>
1268
1442
  <define name="misccontainer">
1269
1443
  <a:documentation>Elements added to metanorma-extension are open-ended, and constitute source data</a:documentation>
1270
1444
  <element name="metanorma-extension">
@@ -1273,6 +1447,13 @@ numbers</a:documentation>
1273
1447
  </oneOrMore>
1274
1448
  </element>
1275
1449
  </define>
1450
+ <define name="review-container">
1451
+ <element name="review-container">
1452
+ <oneOrMore>
1453
+ <ref name="review"/>
1454
+ </oneOrMore>
1455
+ </element>
1456
+ </define>
1276
1457
  <define name="preface">
1277
1458
  <element name="preface">
1278
1459
  <oneOrMore>
@@ -1282,6 +1463,7 @@ numbers</a:documentation>
1282
1463
  <ref name="foreword"/>
1283
1464
  <ref name="introduction"/>
1284
1465
  <ref name="acknowledgements"/>
1466
+ <ref name="executivesummary"/>
1285
1467
  </choice>
1286
1468
  </oneOrMore>
1287
1469
  </element>
@@ -1305,6 +1487,11 @@ numbers</a:documentation>
1305
1487
  <ref name="Content-Section"/>
1306
1488
  </element>
1307
1489
  </define>
1490
+ <define name="executivesummary">
1491
+ <element name="executivesummary">
1492
+ <ref name="Content-Section"/>
1493
+ </element>
1494
+ </define>
1308
1495
  <define name="indexsect">
1309
1496
  <element name="indexsect">
1310
1497
  <ref name="Content-Section"/>
@@ -1530,6 +1717,15 @@ used in document amendments</a:documentation>
1530
1717
  <define name="annex">
1531
1718
  <element name="annex">
1532
1719
  <ref name="Annex-Section"/>
1720
+ <zeroOrMore>
1721
+ <ref name="annex-appendix"/>
1722
+ </zeroOrMore>
1723
+ </element>
1724
+ </define>
1725
+ <define name="annex-appendix">
1726
+ <a:documentation>Appendix, distinct subclause type for annexes (annex to annex, rather than subclause to annex)</a:documentation>
1727
+ <element name="appendix">
1728
+ <ref name="Clause-Section"/>
1533
1729
  </element>
1534
1730
  </define>
1535
1731
  <define name="terms">
@@ -1572,9 +1768,7 @@ used in document amendments</a:documentation>
1572
1768
  <define name="term">
1573
1769
  <a:documentation>Terminology entry with its definition</a:documentation>
1574
1770
  <element name="term">
1575
- <ref name="OptionalId"/>
1576
- <ref name="LocalizedStringAttributes"/>
1577
- <ref name="BlockAttributes"/>
1771
+ <ref name="TermAttributes"/>
1578
1772
  <oneOrMore>
1579
1773
  <ref name="preferred">
1580
1774
  <a:documentation>One or more names under which the term being defined is canonically known</a:documentation>
@@ -1626,6 +1820,11 @@ used in document amendments</a:documentation>
1626
1820
  </ref>
1627
1821
  </element>
1628
1822
  </define>
1823
+ <define name="TermAttributes">
1824
+ <ref name="OptionalId"/>
1825
+ <ref name="LocalizedStringAttributes"/>
1826
+ <ref name="BlockAttributes"/>
1827
+ </define>
1629
1828
  <define name="preferred">
1630
1829
  <element name="preferred">
1631
1830
  <ref name="Designation"/>
@@ -2057,7 +2256,7 @@ used in document amendments</a:documentation>
2057
2256
  </define>
2058
2257
  <define name="termsource">
2059
2258
  <a:documentation>The bibliographic source where a term is defined in the sense applicable in this standardisation document</a:documentation>
2060
- <element name="termsource">
2259
+ <element name="source">
2061
2260
  <attribute name="status">
2062
2261
  <a:documentation>The status of the term as it is used in this document, relative to its definition in the original document</a:documentation>
2063
2262
  <ref name="SourceStatusType"/>
@@ -2287,26 +2486,32 @@ links within an SVG file, so that the SVG file can hyperlink to anchors within t
2287
2486
  </element>
2288
2487
  </define>
2289
2488
  <define name="ul_li">
2290
- <a:documentation>Unorderd list item for standards documents</a:documentation>
2489
+ <a:documentation>Unordered list item for standards documents</a:documentation>
2291
2490
  <element name="li">
2292
2491
  <ref name="OptionalId"/>
2293
- <optional>
2294
- <attribute name="uncheckedcheckbox">
2295
- <a:documentation>Include a checkbox for the list item</a:documentation>
2296
- <data type="boolean"/>
2297
- </attribute>
2298
- </optional>
2299
- <optional>
2300
- <attribute name="checkedcheckbox">
2301
- <a:documentation>Check the checkbox for the list item</a:documentation>
2302
- <data type="boolean"/>
2303
- </attribute>
2304
- </optional>
2305
- <oneOrMore>
2306
- <ref name="BasicBlock"/>
2307
- </oneOrMore>
2492
+ <ref name="UlLiAttributes"/>
2493
+ <ref name="UlLiBody"/>
2308
2494
  </element>
2309
2495
  </define>
2496
+ <define name="UlLiBody">
2497
+ <oneOrMore>
2498
+ <ref name="BasicBlock"/>
2499
+ </oneOrMore>
2500
+ </define>
2501
+ <define name="UlLiAttributes">
2502
+ <optional>
2503
+ <attribute name="uncheckedcheckbox">
2504
+ <a:documentation>Include a checkbox for the list item</a:documentation>
2505
+ <data type="boolean"/>
2506
+ </attribute>
2507
+ </optional>
2508
+ <optional>
2509
+ <attribute name="checkedcheckbox">
2510
+ <a:documentation>Check the checkbox for the list item</a:documentation>
2511
+ <data type="boolean"/>
2512
+ </attribute>
2513
+ </optional>
2514
+ </define>
2310
2515
  <define name="floating-title">
2311
2516
  <a:documentation>A floating title, outside of the clause hierarchy of the document</a:documentation>
2312
2517
  <element name="floating-title">
@@ -2433,6 +2638,11 @@ Normative References contents contain normative references, but as a clause in t
2433
2638
  <ref name="termsource"/>
2434
2639
  </zeroOrMore>
2435
2640
  </define>
2641
+ <define name="BlockSource">
2642
+ <zeroOrMore>
2643
+ <ref name="source"/>
2644
+ </zeroOrMore>
2645
+ </define>
2436
2646
  <start>
2437
2647
  <ref name="standard-document"/>
2438
2648
  </start>
@@ -1,5 +1,11 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <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">
3
+ <define name="requirement">
4
+ <element name="requirement">
5
+ <ref name="RequirementType"/>
6
+ </element>
7
+ </define>
8
+ <!-- ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437 -->
3
9
  <!--
4
10
  Presupposes isodoc.rnc, is included in it
5
11
  include "isodoc.rnc" { }
@@ -7,14 +13,9 @@
7
13
  This is the Metanorma default provisions model; it is overridden by other provisions models,
8
14
  such as Modspec
9
15
  -->
10
- <define name="requirement">
16
+ <define name="recommendation">
11
17
  <a:documentation>Specification of an attribute of a subject that is required.
12
18
  NOTE: A requirement can contain other requirements</a:documentation>
13
- <element name="requirement">
14
- <ref name="RequirementType"/>
15
- </element>
16
- </define>
17
- <define name="recommendation">
18
19
  <a:documentation>Specification of an attribute of a subject that is recommended</a:documentation>
19
20
  <element name="recommendation">
20
21
  <ref name="RequirementType"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Generic
3
- VERSION = "3.0.1".freeze
3
+ VERSION = "3.0.3".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-generic
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-04 00:00:00.000000000 Z
11
+ date: 2025-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc