metanorma-plateau 1.0.5 → 1.0.6

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: c609b148685814ec8ad7f93c55bc329fbe5f7d5c2929d1d48ab68b56334056b6
4
- data.tar.gz: 764ccd4a3889970984b66b10c5d71e6fd265be250b602d3821931d2383279a65
3
+ metadata.gz: 1a9ed515d8944a3fe1393bd3cc0d79ab427593c75754ceb41314d8c375c4ce25
4
+ data.tar.gz: e66ac9687f1580fea492af55e69f105f1dcc0c77f3753c442fd53dc9e2d2b90a
5
5
  SHA512:
6
- metadata.gz: f5bb6d2afa21d161e260137d51c345ac1c08c20183eaf503fe78fd41ecd32df57d954220209a0e9b00fb04c32418259ee21aabd409e1eb62ce0f3c82537213c6
7
- data.tar.gz: 26bfc22f00eb089892edc7162e3b07d6001abee22328a3dcf9791c0fddd083c286ad942121e80c0adc800d3b7308bf24da5797ef4cc09f567f1a3ebfe7ee931b
6
+ metadata.gz: 7528bbd5cbdce23a406eb52ae7180b271e04ec320de3323c394bf99afb4b8beb92c820288ff93a88d322a206ba07e18cbeda9adc003f5cc5d7715663aea07081
7
+ data.tar.gz: b2e0257b4402b85348304d78a7e3a3aba9b18e2b1d69d276f62b09c01ff82fc5e7f648044dcc8983f316094228f84214f5cbb03df7dd9cb5514665795ce2b0b4
@@ -13,6 +13,19 @@ module IsoDoc
13
13
  end
14
14
  end
15
15
 
16
+ def clause_etc1(clause, out, num)
17
+ out.div **attr_code(
18
+ id: clause["id"],
19
+ class: clause.name == "definitions" ? "Symbols" : nil,
20
+ ) do |div|
21
+ num = num + 1
22
+ clause_name(clause, clause&.at(ns("./fmt-title")), div, nil)
23
+ clause.elements.each do |e|
24
+ parse(e, div) unless %w{fmt-title}.include? e.name
25
+ end
26
+ end
27
+ end
28
+
16
29
  include Init
17
30
  end
18
31
  end
@@ -10380,11 +10380,11 @@
10380
10380
  </xsl:template>
10381
10381
 
10382
10382
  <!-- figure/fn -->
10383
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
10383
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'fn']" priority="2"/>
10384
10384
  <!-- figure/note -->
10385
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
10385
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'note']" priority="2"/>
10386
10386
  <!-- figure/example -->
10387
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
10387
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'example']" priority="2"/>
10388
10388
 
10389
10389
  <!-- figure/note[@type = 'units'] -->
10390
10390
  <!-- image/note[@type = 'units'] -->
@@ -13875,6 +13875,9 @@
13875
13875
  <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
13876
13876
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
13877
13877
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
13878
+ <!-- https://github.com/metanorma/isodoc/issues/687 -->
13879
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_step1"/>
13880
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_pres"/>
13878
13881
 
13879
13882
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
13880
13883
  <xsl:copy>
@@ -14157,6 +14160,20 @@
14157
14160
  </xsl:element>
14158
14161
  </xsl:template>
14159
14162
 
14163
+ <xsl:template match="*[local-name() = 'fmt-source']"/>
14164
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_step1">
14165
+ <xsl:element name="source" namespace="{$namespace_full}">
14166
+ <xsl:copy-of select="@*"/>
14167
+ <xsl:apply-templates mode="update_xml_step1"/>
14168
+ </xsl:element>
14169
+ </xsl:template>
14170
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_pres">
14171
+ <xsl:element name="source" namespace="{$namespace_full}">
14172
+ <xsl:copy-of select="@*"/>
14173
+ <xsl:apply-templates mode="update_xml_pres"/>
14174
+ </xsl:element>
14175
+ </xsl:template>
14176
+
14160
14177
  <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
14161
14178
  <xsl:apply-templates mode="update_xml_step1"/>
14162
14179
  </xsl:template>
@@ -15628,6 +15645,12 @@
15628
15645
  </xsl:if>
15629
15646
  </xsl:template>
15630
15647
 
15648
+ <xsl:template name="setIDforNamedDestinationInline">
15649
+ <xsl:if test="@named_dest">
15650
+ <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
15651
+ </xsl:if>
15652
+ </xsl:template>
15653
+
15631
15654
  <xsl:template name="setNamedDestination">
15632
15655
  <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
15633
15656
  <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
@@ -24,29 +24,27 @@ module IsoDoc
24
24
  ret
25
25
  end
26
26
 
27
- def source(docxml)
27
+ def source_types(docxml)
28
28
  super
29
- docxml.xpath(ns("//p/source")).each { |f| parasource(f) }
30
- docxml.xpath(ns("//ul/source")).each { |f| listsource(f) }
31
- docxml.xpath(ns("//ol/source")).each { |f| listsource(f) }
32
- docxml.xpath(ns("//dl/source")).each { |f| listsource(f) }
29
+ docxml.xpath(ns("//p/fmt-source")).each { |f| parasource(f) }
30
+ docxml.xpath(ns("//ul/fmt-source")).each { |f| listsource(f, :ul) }
31
+ docxml.xpath(ns("//ol/fmt-source")).each { |f| listsource(f, :ol) }
32
+ docxml.xpath(ns("//dl/fmt-source")).each { |f| listsource(f, :dl) }
33
33
  end
34
34
 
35
35
  def parasource(elem)
36
- source1(elem)
36
+ source1(elem, :para)
37
37
  # if we haven't already removed it...
38
38
  elem.parent or return
39
- elem.name = "p"
40
- elem.delete("status")
41
- elem.parent.next = elem
39
+ #elem.parent.next = "<p>#{to_xml(elem.remove)}</p>"
40
+ elem.parent.next = elem.remove
42
41
  end
43
42
 
44
- def listsource(elem)
45
- source1(elem)
43
+ def listsource(elem, ancestor)
44
+ source1(elem, ancestor)
46
45
  elem.parent or return
47
- elem.name = "p"
48
- elem.delete("status")
49
- elem.parent.next = elem
46
+ #elem.parent.next = "<p>#{to_xml(elem.remove)}</p>"
47
+ elem.parent.next = elem.remove
50
48
  end
51
49
 
52
50
  def middle_title(docxml); end
@@ -124,14 +122,14 @@ module IsoDoc
124
122
 
125
123
  def table1(node)
126
124
  super
127
- # move dl, notes, footnotes, source, fmt-footnote-container inside tfoot
125
+ # move dl, notes, footnotes, fmt-source, fmt-footnote-container inside tfoot
128
126
  if node.at(ns("./dl"))
129
127
  tf = initial_tfoot_cell(node)
130
128
  node.xpath(ns("./dl")).reverse_each do |x|
131
129
  tf.children.first.previous = x.remove
132
130
  end
133
131
  end
134
- if node.at(ns("./note | ./source | ./example | ./fmt-footnote-container"))
132
+ if node.at(ns("./note | ./fmt-source | ./example | ./fmt-footnote-container"))
135
133
  tf = final_tfoot_cell(node)
136
134
  node.xpath(ns("./example")).each do |x|
137
135
  tf.children.last.next = x.remove
@@ -140,7 +138,7 @@ module IsoDoc
140
138
  node.xpath(ns("./fmt-footnote-container")).each do |x|
141
139
  tf.children.last.next = x.remove
142
140
  end
143
- node.xpath(ns("./source")).each do |x|
141
+ node.xpath(ns("./fmt-source")).each do |x|
144
142
  tf.children.last.next = x.remove
145
143
  end
146
144
  end
@@ -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">
@@ -409,13 +413,13 @@ in a document (e.g. sourcecode annotations)</a:documentation>
409
413
  <attribute name="from">
410
414
  <a:documentation>Identifier for the start of the text or point in the text to which the comment applies.
411
415
  If not provided, the comment applies in the vicinity of the place it has been inserted into the text</a:documentation>
412
- <data type="IDREF"/>
416
+ <ref name="IdRefType"/>
413
417
  </attribute>
414
418
  </optional>
415
419
  <optional>
416
420
  <attribute name="to">
417
421
  <a:documentation>Identifier for the end of the text to which the comment applies</a:documentation>
418
- <data type="IDREF"/>
422
+ <ref name="IdRefType"/>
419
423
  </attribute>
420
424
  </optional>
421
425
  </define>
@@ -1504,7 +1508,7 @@ Restricted recursively to contain only other such inline elements with no identi
1504
1508
  <attribute name="to">
1505
1509
  <a:documentation>A reference to an anchor element (typically a bookmark),
1506
1510
  to indicate that the index range covers a range of locations between the current index element and the `to` anchor</a:documentation>
1507
- <data type="IDREF"/>
1511
+ <ref name="IdRefType"/>
1508
1512
  </attribute>
1509
1513
  </optional>
1510
1514
  <ref name="index-primary">
@@ -1662,7 +1666,7 @@ which can be bookmarks as well as block or section references</a:documentation>
1662
1666
  <define name="XrefAttributes">
1663
1667
  <attribute name="target">
1664
1668
  <a:documentation>The identifier of a section, block or inlined element being referenced</a:documentation>
1665
- <data type="IDREF"/>
1669
+ <ref name="IdRefType"/>
1666
1670
  </attribute>
1667
1671
  <optional>
1668
1672
  <attribute name="type">
@@ -1723,7 +1727,7 @@ The target of a footnote is the location it is embedded in within the text</a:do
1723
1727
  <attribute name="target">
1724
1728
  <a:documentation>The target of the callout is understood to be the location of the callout within the source code;
1725
1729
  the extent of the target is not expressed overtly</a:documentation>
1726
- <data type="IDREF"/>
1730
+ <ref name="IdRefType"/>
1727
1731
  </attribute>
1728
1732
  <text>
1729
1733
  <a:documentation>The label of the callout, used to identify its target within the source code</a:documentation>
@@ -2,10 +2,9 @@ module Metanorma
2
2
  module Plateau
3
3
  class Converter < Jis::Converter
4
4
  def blocksource_cleanup(xmldoc)
5
- xmldoc.xpath("//termsource").each do |s|
5
+ xmldoc.xpath("//source").each do |s|
6
6
  p = s.previous_element or next
7
7
  %w[p ol ul dl].include? p.name or next
8
- s.name = "source"
9
8
  s.delete("type")
10
9
  s.parent = p
11
10
  end
@@ -6,9 +6,6 @@ module Metanorma
6
6
  class Converter < Jis::Converter
7
7
  register_for "plateau"
8
8
 
9
- XML_ROOT_TAG = "plateau-standard".freeze
10
- XML_NAMESPACE = "https://www.metanorma.org/ns/plateau".freeze
11
-
12
9
  def default_requirement_model
13
10
  "ogc"
14
11
  end
@@ -1,6 +1,6 @@
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
- <!-- VERSION v2.0.4 -->
3
+ <!-- VERSION v2.0.5 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -36,6 +36,12 @@
36
36
  </zeroOrMore>
37
37
  </element>
38
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>
39
45
  <define name="index-primary">
40
46
  <element name="primary">
41
47
  <oneOrMore>
@@ -238,7 +244,7 @@
238
244
  <a:documentation>Notes specific to this block</a:documentation>
239
245
  </ref>
240
246
  </zeroOrMore>
241
- <ref name="TermSource">
247
+ <ref name="BlockSource">
242
248
  <a:documentation>A source for the table</a:documentation>
243
249
  </ref>
244
250
  </define>
@@ -262,10 +268,112 @@ and is intended to be referenced by a callout within the source code</a:document
262
268
  <a:documentation>Notes whose scope is the current block</a:documentation>
263
269
  </ref>
264
270
  </zeroOrMore>
265
- <ref name="TermSource">
271
+ <ref name="BlockSource">
272
+ <a:documentation>A source for the block</a:documentation>
273
+ </ref>
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">
266
310
  <a:documentation>A source for the block</a:documentation>
267
311
  </ref>
268
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>
269
377
  <define name="sourcecodebody">
270
378
  <a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
271
379
  (The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
@@ -687,6 +795,20 @@ titlecase, or lowercase</a:documentation>
687
795
  </attribute>
688
796
  </optional>
689
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
+ </define>
805
+ <define name="OptionalId" combine="interleave">
806
+ <optional>
807
+ <attribute name="anchor">
808
+ <a:documentation> User-supplied anchor of element; replaced by content-based id, with all references to the anchor updated accordingly</a:documentation>
809
+ </attribute>
810
+ </optional>
811
+ </define>
690
812
  <define name="ObligationType">
691
813
  <a:documentation>The force of a clause in a standard document: whether it has normative or informative effect</a:documentation>
692
814
  <choice>
@@ -1081,7 +1203,7 @@ That concept may be defined as a term within the current document, or it may be
1081
1203
  <element name="label">
1082
1204
  <!-- Identifier of form input element that this element is a label of -->
1083
1205
  <attribute name="for">
1084
- <data type="IDREF"/>
1206
+ <ref name="IdRefType"/>
1085
1207
  </attribute>
1086
1208
  <zeroOrMore>
1087
1209
  <ref name="PureTextElement"/>
@@ -2121,7 +2243,7 @@ used in document amendments</a:documentation>
2121
2243
  </define>
2122
2244
  <define name="termsource">
2123
2245
  <a:documentation>The bibliographic source where a term is defined in the sense applicable in this standardisation document</a:documentation>
2124
- <element name="termsource">
2246
+ <element name="source">
2125
2247
  <attribute name="status">
2126
2248
  <a:documentation>The status of the term as it is used in this document, relative to its definition in the original document</a:documentation>
2127
2249
  <ref name="SourceStatusType"/>
@@ -2503,6 +2625,11 @@ Normative References contents contain normative references, but as a clause in t
2503
2625
  <ref name="termsource"/>
2504
2626
  </zeroOrMore>
2505
2627
  </define>
2628
+ <define name="BlockSource">
2629
+ <zeroOrMore>
2630
+ <ref name="source"/>
2631
+ </zeroOrMore>
2632
+ </define>
2506
2633
  <start>
2507
2634
  <ref name="standard-document"/>
2508
2635
  </start>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Plateau
3
- VERSION = "1.0.5".freeze
3
+ VERSION = "1.0.6".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-plateau
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-29 00:00:00.000000000 Z
11
+ date: 2025-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-jis