metanorma-ogc 2.2.5 → 2.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/ogc/html/htmlstyle.css +6 -0
  3. data/lib/isodoc/ogc/html/htmlstyle.scss +1 -0
  4. data/lib/isodoc/ogc/metadata.rb +7 -6
  5. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +122 -16
  6. data/lib/isodoc/ogc/ogc.best-practice.xsl +122 -16
  7. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +122 -16
  8. data/lib/isodoc/ogc/ogc.community-practice.xsl +122 -16
  9. data/lib/isodoc/ogc/ogc.community-standard.xsl +122 -16
  10. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +122 -16
  11. data/lib/isodoc/ogc/ogc.draft-standard.xsl +10902 -0
  12. data/lib/isodoc/ogc/ogc.engineering-report.xsl +122 -16
  13. data/lib/isodoc/ogc/ogc.other.xsl +122 -16
  14. data/lib/isodoc/ogc/ogc.policy.xsl +122 -16
  15. data/lib/isodoc/ogc/ogc.reference-model.xsl +122 -16
  16. data/lib/isodoc/ogc/ogc.release-notes.xsl +122 -16
  17. data/lib/isodoc/ogc/ogc.standard.xsl +122 -16
  18. data/lib/isodoc/ogc/ogc.test-suite.xsl +122 -16
  19. data/lib/isodoc/ogc/ogc.user-guide.xsl +122 -16
  20. data/lib/isodoc/ogc/ogc.white-paper.xsl +120 -15
  21. data/lib/isodoc/ogc/pdf_convert.rb +5 -4
  22. data/lib/isodoc/ogc/presentation_xml_convert.rb +5 -5
  23. data/lib/metanorma/ogc/biblio.rng +5 -0
  24. data/lib/metanorma/ogc/cleanup.rb +14 -14
  25. data/lib/metanorma/ogc/converter.rb +2 -2
  26. data/lib/metanorma/ogc/front.rb +12 -8
  27. data/lib/metanorma/ogc/isodoc.rng +46 -12
  28. data/lib/metanorma/ogc/relaton-ogc.rng +1 -0
  29. data/lib/metanorma/ogc/validate.rb +15 -15
  30. data/lib/metanorma/ogc/version.rb +1 -1
  31. data/metanorma-ogc.gemspec +3 -2
  32. metadata +5 -11
  33. data/.github/workflows/automerge.yml +0 -31
  34. data/.github/workflows/rake.yml +0 -15
  35. data/.github/workflows/release.yml +0 -24
  36. data/Rakefile +0 -8
  37. data/bin/console +0 -14
  38. data/bin/rspec +0 -17
  39. data/bin/setup +0 -8
@@ -1060,6 +1060,14 @@
1060
1060
 
1061
1061
  </xsl:attribute-set>
1062
1062
 
1063
+ <xsl:attribute-set name="pre-style">
1064
+ <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
1065
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1066
+
1067
+ <xsl:attribute name="line-height">113%</xsl:attribute>
1068
+
1069
+ </xsl:attribute-set>
1070
+
1063
1071
  <xsl:attribute-set name="permission-style">
1064
1072
 
1065
1073
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -1208,6 +1216,11 @@
1208
1216
  </xsl:variable>
1209
1217
  <xsl:variable name="table-border" select="normalize-space($table-border_)"/>
1210
1218
 
1219
+ <xsl:variable name="table-cell-border_">
1220
+
1221
+ </xsl:variable>
1222
+ <xsl:variable name="table-cell-border" select="normalize-space($table-cell-border_)"/>
1223
+
1211
1224
  <xsl:attribute-set name="table-container-style">
1212
1225
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
1213
1226
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -1220,8 +1233,6 @@
1220
1233
  <xsl:attribute-set name="table-style">
1221
1234
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
1222
1235
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
1223
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
1224
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
1225
1236
 
1226
1237
  </xsl:attribute-set><!-- table-style -->
1227
1238
 
@@ -2407,6 +2418,12 @@
2407
2418
  <xsl:variable name="table_attributes">
2408
2419
 
2409
2420
  <xsl:element name="table_attributes" use-attribute-sets="table-style">
2421
+
2422
+ <xsl:if test="$margin-side != 0">
2423
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2424
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2425
+ </xsl:if>
2426
+
2410
2427
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
2411
2428
 
2412
2429
  </xsl:element>
@@ -3162,6 +3179,10 @@
3162
3179
  <xsl:template match="*[local-name()='tr']">
3163
3180
  <fo:table-row xsl:use-attribute-sets="table-body-row-style">
3164
3181
 
3182
+ <xsl:if test="*[local-name() = 'th']">
3183
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
3184
+ </xsl:if>
3185
+
3165
3186
  <xsl:call-template name="setTableRowAttributes"/>
3166
3187
  <xsl:apply-templates/>
3167
3188
  </fo:table-row>
@@ -5140,6 +5161,9 @@
5140
5161
  <xsl:value-of select="substring($str, 2)"/>
5141
5162
  </xsl:template>
5142
5163
 
5164
+ <!-- ======================================= -->
5165
+ <!-- math -->
5166
+ <!-- ======================================= -->
5143
5167
  <xsl:template match="mathml:math">
5144
5168
  <xsl:variable name="isAdded" select="@added"/>
5145
5169
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -5190,14 +5214,57 @@
5190
5214
  <xsl:value-of select="$comment_text"/>
5191
5215
  </xsl:template>
5192
5216
 
5217
+ <xsl:template match="*[local-name() = 'asciimath']">
5218
+ <xsl:param name="process" select="'false'"/>
5219
+ <xsl:if test="$process = 'true'">
5220
+ <xsl:apply-templates/>
5221
+ </xsl:if>
5222
+ </xsl:template>
5223
+
5224
+ <xsl:template match="*[local-name() = 'latexmath']"/>
5225
+
5226
+ <xsl:template name="getMathml_asciimath_text">
5227
+ <xsl:variable name="asciimath" select="../*[local-name() = 'asciimath']"/>
5228
+ <xsl:variable name="latexmath">
5229
+
5230
+ </xsl:variable>
5231
+ <xsl:variable name="asciimath_text_following">
5232
+ <xsl:choose>
5233
+ <xsl:when test="normalize-space($latexmath) != ''">
5234
+ <xsl:value-of select="$latexmath"/>
5235
+ </xsl:when>
5236
+ <xsl:when test="normalize-space($asciimath) != ''">
5237
+ <xsl:value-of select="$asciimath"/>
5238
+ </xsl:when>
5239
+ <xsl:otherwise>
5240
+ <xsl:value-of select="following-sibling::node()[1][self::comment()]"/>
5241
+ </xsl:otherwise>
5242
+ </xsl:choose>
5243
+ </xsl:variable>
5244
+ <xsl:variable name="asciimath_text_">
5245
+ <xsl:choose>
5246
+ <xsl:when test="normalize-space($asciimath_text_following) != ''">
5247
+ <xsl:value-of select="$asciimath_text_following"/>
5248
+ </xsl:when>
5249
+ <xsl:otherwise>
5250
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
5251
+ </xsl:otherwise>
5252
+ </xsl:choose>
5253
+ </xsl:variable>
5254
+ <xsl:variable name="asciimath_text_2" select="java:org.metanorma.fop.Util.unescape($asciimath_text_)"/>
5255
+ <xsl:variable name="asciimath_text" select="java:trim(java:java.lang.String.new($asciimath_text_2))"/>
5256
+ <xsl:value-of select="$asciimath_text"/>
5257
+ </xsl:template>
5258
+
5193
5259
  <xsl:template name="mathml_instream_object">
5194
- <xsl:param name="comment_text"/>
5260
+ <xsl:param name="asciimath_text"/>
5195
5261
  <xsl:param name="mathml_content"/>
5196
5262
 
5197
- <xsl:variable name="comment_text_">
5263
+ <xsl:variable name="asciimath_text_">
5198
5264
  <xsl:choose>
5199
- <xsl:when test="normalize-space($comment_text) != ''"><xsl:value-of select="$comment_text"/></xsl:when>
5200
- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise>
5265
+ <xsl:when test="normalize-space($asciimath_text) != ''"><xsl:value-of select="$asciimath_text"/></xsl:when>
5266
+ <!-- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise> -->
5267
+ <xsl:otherwise><xsl:call-template name="getMathml_asciimath_text"/></xsl:otherwise>
5201
5268
  </xsl:choose>
5202
5269
  </xsl:variable>
5203
5270
 
@@ -5214,10 +5281,10 @@
5214
5281
  </xsl:attribute>
5215
5282
 
5216
5283
  <!-- <xsl:if test="$add_math_as_text = 'true'"> -->
5217
- <xsl:if test="normalize-space($comment_text_) != ''">
5284
+ <xsl:if test="normalize-space($asciimath_text_) != ''">
5218
5285
  <!-- put Mathin Alternate Text -->
5219
5286
  <xsl:attribute name="fox:alt-text">
5220
- <xsl:value-of select="$comment_text_"/>
5287
+ <xsl:value-of select="$asciimath_text_"/>
5221
5288
  </xsl:attribute>
5222
5289
  </xsl:if>
5223
5290
  <!-- </xsl:if> -->
@@ -5290,6 +5357,29 @@
5290
5357
  <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
5291
5358
  </xsl:template>
5292
5359
 
5360
+ <!-- Examples:
5361
+ <stem type="AsciiMath">x = 1</stem>
5362
+ <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
5363
+ <stem type="AsciiMath"><asciimath>x = 1</asciimath><latexmath>x = 1</latexmath></stem>
5364
+ -->
5365
+ <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
5366
+ <fo:inline xsl:use-attribute-sets="mathml-style">
5367
+
5368
+ <xsl:choose>
5369
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
5370
+ <xsl:otherwise>
5371
+ <xsl:apply-templates>
5372
+ <xsl:with-param name="process">true</xsl:with-param>
5373
+ </xsl:apply-templates>
5374
+ </xsl:otherwise>
5375
+ </xsl:choose>
5376
+
5377
+ </fo:inline>
5378
+ </xsl:template>
5379
+ <!-- ======================================= -->
5380
+ <!-- END: math -->
5381
+ <!-- ======================================= -->
5382
+
5293
5383
  <xsl:template match="*[local-name()='localityStack']"/>
5294
5384
 
5295
5385
  <xsl:template match="*[local-name()='link']" name="link">
@@ -6627,9 +6717,9 @@
6627
6717
  <xsl:apply-templates mode="contents_item"/>
6628
6718
  </xsl:template>
6629
6719
 
6630
- <!-- ====== -->
6631
- <!-- sourcecode -->
6632
- <!-- ====== -->
6720
+ <!-- =============== -->
6721
+ <!-- sourcecode -->
6722
+ <!-- =============== -->
6633
6723
  <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
6634
6724
 
6635
6725
  <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
@@ -6931,8 +7021,22 @@
6931
7021
  </fo:block>
6932
7022
  </xsl:if>
6933
7023
  </xsl:template>
6934
- <!-- ====== -->
6935
- <!-- ====== -->
7024
+ <!-- =============== -->
7025
+ <!-- END sourcecode -->
7026
+ <!-- =============== -->
7027
+
7028
+ <!-- =============== -->
7029
+ <!-- pre -->
7030
+ <!-- =============== -->
7031
+ <xsl:template match="*[local-name()='pre']" name="pre">
7032
+ <fo:block xsl:use-attribute-sets="pre-style">
7033
+ <xsl:copy-of select="@id"/>
7034
+ <xsl:apply-templates/>
7035
+ </fo:block>
7036
+ </xsl:template>
7037
+ <!-- =============== -->
7038
+ <!-- pre -->
7039
+ <!-- =============== -->
6936
7040
 
6937
7041
  <!-- ========== -->
6938
7042
  <!-- permission -->
@@ -9496,13 +9600,14 @@
9496
9600
  </xsl:template>
9497
9601
 
9498
9602
  <xsl:template name="setId">
9603
+ <xsl:param name="prefix"/>
9499
9604
  <xsl:attribute name="id">
9500
9605
  <xsl:choose>
9501
9606
  <xsl:when test="@id">
9502
- <xsl:value-of select="@id"/>
9607
+ <xsl:value-of select="concat($prefix, @id)"/>
9503
9608
  </xsl:when>
9504
9609
  <xsl:otherwise>
9505
- <xsl:value-of select="generate-id()"/>
9610
+ <xsl:value-of select="concat($prefix, generate-id())"/>
9506
9611
  </xsl:otherwise>
9507
9612
  </xsl:choose>
9508
9613
  </xsl:attribute>
@@ -13,10 +13,11 @@ module IsoDoc
13
13
 
14
14
  def pdf_stylesheet(docxml)
15
15
  doctype = docxml&.at(ns("//bibdata/ext/doctype"))&.text
16
- doctype = "other" unless %w(abstract-specification-topic best-practice
17
- change-request-supporting-document community-practice community-standard
18
- discussion-paper engineering-report policy reference-model release-notes
19
- standard user-guide test-suite white-paper).include? doctype
16
+ %w(abstract-specification-topic best-practice draft-standard
17
+ change-request-supporting-document community-practice
18
+ community-standard discussion-paper engineering-report policy
19
+ reference-model release-notes standard user-guide test-suite
20
+ white-paper).include? doctype or doctype = "other"
20
21
  "ogc.#{doctype}.xsl"
21
22
  end
22
23
  end
@@ -12,7 +12,7 @@ module IsoDoc
12
12
  end
13
13
 
14
14
  def insert_preface_sections(doc)
15
- preface_insert(doc.at(ns("//preface/clause"\
15
+ preface_insert(doc.at(ns("//preface/clause" \
16
16
  "[@type = 'executivesummary']")),
17
17
  doc.at(ns("//preface/abstract")), doc)
18
18
  preface_insert(doc.at(ns("//preface//submitters")),
@@ -109,7 +109,7 @@ module IsoDoc
109
109
 
110
110
  def clause(docxml)
111
111
  super
112
- docxml.xpath(ns("//foreword | //preface/abstract | "\
112
+ docxml.xpath(ns("//foreword | //preface/abstract | " \
113
113
  "//submitters | //introduction | //acknowledgements"))
114
114
  .each do |f|
115
115
  clause1(f)
@@ -146,7 +146,7 @@ module IsoDoc
146
146
 
147
147
  def rename_stage(stage, doctype, _bib)
148
148
  stage&.text == "approved" &&
149
- !%w(standard abstract-specification-topic
149
+ !%w(standard abstract-specification-topic draft-standard
150
150
  community-standard).include?(doctype&.text) and
151
151
  stage.children = "published"
152
152
  end
@@ -170,7 +170,7 @@ module IsoDoc
170
170
  while elem&.next_element&.name == "termsource"
171
171
  elem << "; #{elem.next_element.remove.children.to_xml}"
172
172
  end
173
- elem.children = l10n("[<strong>#{@i18n.source}:</strong> "\
173
+ elem.children = l10n("[<strong>#{@i18n.source}:</strong> " \
174
174
  "#{elem.children.to_xml.strip}]")
175
175
  end
176
176
 
@@ -199,7 +199,7 @@ module IsoDoc
199
199
  i = display_order_at(docxml, "//clause[@type = 'scope']", i)
200
200
  i = display_order_at(docxml, "//clause[@type = 'conformance']", i)
201
201
  i = display_order_at(docxml, @xrefs.klass.norm_ref_xpath, i)
202
- i = display_order_at(docxml, "//sections/terms | "\
202
+ i = display_order_at(docxml, "//sections/terms | " \
203
203
  "//sections/clause[descendant::terms]", i)
204
204
  i = display_order_at(docxml, "//sections/definitions", i)
205
205
  i = display_order_xpath(docxml, @xrefs.klass.middle_clause(docxml), i)
@@ -188,6 +188,11 @@
188
188
  <value>adapter</value>
189
189
  <value>translator</value>
190
190
  <value>distributor</value>
191
+ <value>realizer</value>
192
+ <value>owner</value>
193
+ <value>authorizer</value>
194
+ <value>enabler</value>
195
+ <value>subject</value>
191
196
  </choice>
192
197
  </attribute>
193
198
  <zeroOrMore>
@@ -30,12 +30,12 @@ module Metanorma
30
30
  def insert_security(xml, sect)
31
31
  description = "document"
32
32
  description = "standard" if %w(standard community-standard)
33
- .include?(sect&.at("//bibdata/ext/doctype")&.text)
33
+ .include?(sect.at("//bibdata/ext/doctype")&.text)
34
34
  preface = sect.at("//preface") ||
35
35
  sect.add_previous_sibling("<preface/>").first
36
- sect = xml&.at("//clause[@type = 'security']")&.remove ||
37
- "<clause type='security' #{add_id}>"\
38
- "<title>Security considerations</title>"\
36
+ sect = xml.at("//clause[@type = 'security']")&.remove ||
37
+ "<clause type='security' #{add_id}>" \
38
+ "<title>Security considerations</title>" \
39
39
  "<p>#{@i18n.security_empty.sub(/%/, description)}</p></clause>"
40
40
  preface.add_child sect
41
41
  end
@@ -68,19 +68,19 @@ module Metanorma
68
68
  replace_title(xml, "//definitions[@type = 'abbreviated_terms']",
69
69
  @i18n&.abbrev)
70
70
  replace_title(xml, "//definitions[not(@type)]", @i18n&.symbolsabbrev)
71
- replace_title(xml, "//sections//terms#{SYMnoABBR} | "\
71
+ replace_title(xml, "//sections//terms#{SYMnoABBR} | " \
72
72
  "//sections//clause[.//terms]#{SYMnoABBR}",
73
73
  @i18n&.termsdefsymbols, true)
74
- replace_title(xml, "//sections//terms#{ABBRnoSYM} | "\
74
+ replace_title(xml, "//sections//terms#{ABBRnoSYM} | " \
75
75
  "//sections//clause[.//terms]#{ABBRnoSYM}",
76
76
  @i18n&.termsdefabbrev, true)
77
- replace_title(xml, "//sections//terms#{SYMABBR} | "\
77
+ replace_title(xml, "//sections//terms#{SYMABBR} | " \
78
78
  "//sections//clause[.//terms]#{SYMABBR}",
79
79
  @i18n&.termsdefsymbolsabbrev, true)
80
- replace_title(xml, "//sections//terms#{NO_SYMABBR} | "\
80
+ replace_title(xml, "//sections//terms#{NO_SYMABBR} | " \
81
81
  "//sections//clause[.//terms]#{NO_SYMABBR}",
82
82
  @i18n&.termsdefsymbolsabbrev, true)
83
- replace_title(xml, "//sections//terms[not(.//definitions)] | "\
83
+ replace_title(xml, "//sections//terms[not(.//definitions)] | " \
84
84
  "//sections//clause[.//terms][not(.//definitions)]",
85
85
  @i18n&.termsdef, true)
86
86
  end
@@ -101,7 +101,7 @@ module Metanorma
101
101
  end
102
102
 
103
103
  def normref_cleanup(xmldoc)
104
- r1 = xmldoc.at("//references[title[translate(text(), 'R', 'r') = "\
104
+ r1 = xmldoc.at("//references[title[translate(text(), 'R', 'r') = " \
105
105
  "'Normative references']]")
106
106
  r2 = xmldoc.at("//references[title[text() = 'References']]")
107
107
  if r1 && r2
@@ -118,7 +118,7 @@ module Metanorma
118
118
  r["obligation"] = "normative" unless r["obligation"]
119
119
  end
120
120
  xml.xpath(::Metanorma::Standoc::Utils::SUBCLAUSE_XPATH).each do |r|
121
- o = r&.at("./ancestor::*/@obligation")&.text and r["obligation"] = o
121
+ o = r.at("./ancestor::*/@obligation")&.text and r["obligation"] = o
122
122
  end
123
123
  end
124
124
 
@@ -145,12 +145,12 @@ module Metanorma
145
145
 
146
146
  PUBLISHER = "./contributor[role/@type = 'publisher']/organization".freeze
147
147
 
148
- OTHERIDS = "@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or "\
148
+ OTHERIDS = "@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or " \
149
149
  "@type = 'ISBN'".freeze
150
150
 
151
151
  def pub_class(bib)
152
152
  return 1 if bib.at("#{PUBLISHER}[abbreviation = 'OGC']")
153
- return 1 if bib.at("#{PUBLISHER}[name = 'Open Geospatial "\
153
+ return 1 if bib.at("#{PUBLISHER}[name = 'Open Geospatial " \
154
154
  "Consortium']")
155
155
  return 2 if bib.at("./docidentifier[@type][not(#{OTHERIDS})]")
156
156
 
@@ -173,7 +173,7 @@ module Metanorma
173
173
  num = if ids[:num].nil? then ids[:abbrid]
174
174
  else sprintf("%09d", ids[:num].to_i)
175
175
  end
176
- "#{pubclass} :: #{ids[:type]} :: #{sortkey3} :: #{num} :: "\
176
+ "#{pubclass} :: #{ids[:type]} :: #{sortkey3} :: #{num} :: " \
177
177
  "#{sprintf('%09d', ids[:partid])} :: #{ids[:id]} :: #{title}"
178
178
  end
179
179
 
@@ -42,7 +42,7 @@ module Metanorma
42
42
  change-request-supporting-document community-practice
43
43
  community-standard discussion-paper engineering-report
44
44
  reference-model release-notes standard user-guide white-paper
45
- technical-paper test-suite}.include? d
45
+ technical-paper test-suite draft-standard}.include? d
46
46
  @warned_doctype or
47
47
  @log.add("Document Attributes", nil,
48
48
  "'#{d}' is not a legal document type: reverting to 'standard'")
@@ -83,7 +83,7 @@ module Metanorma
83
83
  end
84
84
 
85
85
  def clause_parse(attrs, xml, node)
86
- case node&.attr("heading")&.downcase || node.title.downcase
86
+ case node.attr("heading")&.downcase || node.title.downcase
87
87
  when "submitters" then return submitters_parse(attrs, xml, node)
88
88
  when "conformance" then attrs = attrs.merge(type: "conformance")
89
89
  when "security considerations"
@@ -85,16 +85,20 @@ module Metanorma
85
85
  return unless node.attr("committee")
86
86
 
87
87
  xml.editorialgroup do |a|
88
- a.committee(node.attr("committee") || "technical")
89
- node.attr("subcommittee") and
90
- a.subcommittee(node.attr("subcommittee"),
88
+ metadata_committee1(node, a)
89
+ end
90
+ end
91
+
92
+ def metadata_committee1(node, xml)
93
+ xml.committee(node.attr("committee") || "technical")
94
+ node.attr("subcommittee") and
95
+ xml.subcommittee(node.attr("subcommittee"),
91
96
  **attr_code(type: node.attr("subcommittee-type"),
92
97
  number: node.attr("subcommittee-number")))
93
- (node.attr("workgroup") || node.attr("workinggroup")) and
94
- a.workgroup(node.attr("workgroup") || node.attr("workinggroup"),
98
+ (node.attr("workgroup") || node.attr("workinggroup")) and
99
+ xml.workgroup(node.attr("workgroup") || node.attr("workinggroup"),
95
100
  **attr_code(type: node.attr("workgroup-type"),
96
101
  number: node.attr("workgroup-number")))
97
- end
98
102
  end
99
103
 
100
104
  def externalid(node)
@@ -170,7 +174,7 @@ module Metanorma
170
174
  conceptual-model-and-implementation encoding extension
171
175
  implementation profile profile-with-extension}.include? s
172
176
  @log.add("Document Attributes", nil,
173
- "'#{s}' is not a permitted subtype of Standard: "\
177
+ "'#{s}' is not a permitted subtype of Standard: " \
174
178
  "reverting to 'implementation'")
175
179
  s = "implementation"
176
180
  end
@@ -178,7 +182,7 @@ module Metanorma
178
182
  unless %w{general encoding extension profile
179
183
  profile-with-extension}.include? s
180
184
  @log.add("Document Attributes", nil,
181
- "'#{s}' is not a permitted subtype of Standard: "\
185
+ "'#{s}' is not a permitted subtype of Standard: " \
182
186
  "reverting to 'implementation'")
183
187
  s = "general"
184
188
  end
@@ -177,11 +177,7 @@
177
177
  </optional>
178
178
  <optional>
179
179
  <attribute name="style">
180
- <choice>
181
- <value>basic</value>
182
- <value>full</value>
183
- <value>short</value>
184
- </choice>
180
+ <ref name="XrefStyleType"/>
185
181
  </attribute>
186
182
  </optional>
187
183
  <ref name="XrefBody"/>
@@ -1031,6 +1027,7 @@
1031
1027
  <ref name="stem"/>
1032
1028
  <ref name="index"/>
1033
1029
  <ref name="eref"/>
1030
+ <ref name="erefstack"/>
1034
1031
  <ref name="xref"/>
1035
1032
  <ref name="hyperlink"/>
1036
1033
  </choice>
@@ -1045,6 +1042,7 @@
1045
1042
  <ref name="stem"/>
1046
1043
  <ref name="index"/>
1047
1044
  <ref name="eref"/>
1045
+ <ref name="erefstack"/>
1048
1046
  <ref name="xref"/>
1049
1047
  <ref name="hyperlink"/>
1050
1048
  </choice>
@@ -1058,6 +1056,7 @@
1058
1056
  <ref name="PureTextElement"/>
1059
1057
  <ref name="index"/>
1060
1058
  <ref name="eref"/>
1059
+ <ref name="erefstack"/>
1061
1060
  <ref name="xref"/>
1062
1061
  <ref name="hyperlink"/>
1063
1062
  </choice>
@@ -1195,6 +1194,7 @@
1195
1194
  <ref name="add"/>
1196
1195
  <ref name="del"/>
1197
1196
  <ref name="span"/>
1197
+ <ref name="erefstack"/>
1198
1198
  </choice>
1199
1199
  </define>
1200
1200
  <define name="add">
@@ -1202,6 +1202,7 @@
1202
1202
  <choice>
1203
1203
  <ref name="PureTextElement"/>
1204
1204
  <ref name="eref"/>
1205
+ <ref name="erefstack"/>
1205
1206
  <ref name="stem"/>
1206
1207
  <ref name="keyword"/>
1207
1208
  <ref name="xref"/>
@@ -1214,6 +1215,7 @@
1214
1215
  <choice>
1215
1216
  <ref name="PureTextElement"/>
1216
1217
  <ref name="eref"/>
1218
+ <ref name="erefstack"/>
1217
1219
  <ref name="stem"/>
1218
1220
  <ref name="keyword"/>
1219
1221
  <ref name="xref"/>
@@ -1278,6 +1280,7 @@
1278
1280
  </optional>
1279
1281
  <choice>
1280
1282
  <ref name="eref"/>
1283
+ <ref name="erefstack"/>
1281
1284
  <ref name="xref"/>
1282
1285
  <ref name="termref"/>
1283
1286
  </choice>
@@ -1970,6 +1973,7 @@
1970
1973
  </element>
1971
1974
  <choice>
1972
1975
  <ref name="eref"/>
1976
+ <ref name="erefstack"/>
1973
1977
  <ref name="xref"/>
1974
1978
  <ref name="termref"/>
1975
1979
  </choice>
@@ -2525,6 +2529,7 @@
2525
2529
  <ref name="xref"/>
2526
2530
  <ref name="hyperlink"/>
2527
2531
  <ref name="eref"/>
2532
+ <ref name="erefstack"/>
2528
2533
  </choice>
2529
2534
  <oneOrMore>
2530
2535
  <element name="coords">
@@ -2572,6 +2577,7 @@
2572
2577
  <ref name="xref"/>
2573
2578
  <ref name="hyperlink"/>
2574
2579
  <ref name="eref"/>
2580
+ <ref name="erefstack"/>
2575
2581
  </choice>
2576
2582
  </element>
2577
2583
  </zeroOrMore>
@@ -2620,6 +2626,15 @@
2620
2626
  <ref name="PureTextElement"/>
2621
2627
  </oneOrMore>
2622
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>
2623
2638
  <define name="XrefTarget">
2624
2639
  <element name="location">
2625
2640
  <attribute name="target">
@@ -2628,16 +2643,35 @@
2628
2643
  </data>
2629
2644
  </attribute>
2630
2645
  <attribute name="connective">
2631
- <choice>
2632
- <value>and</value>
2633
- <value>or</value>
2634
- <value>from</value>
2635
- <value>to</value>
2636
- <value/>
2637
- </choice>
2646
+ <ref name="XrefConnectiveType"/>
2638
2647
  </attribute>
2639
2648
  </element>
2640
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>
2641
2675
  <start>
2642
2676
  <ref name="standard-document"/>
2643
2677
  </start>
@@ -18,6 +18,7 @@
18
18
  <value>user-guide</value>
19
19
  <value>white-paper</value>
20
20
  <value>test-suite</value>
21
+ <value>draft-standard</value>
21
22
  </choice>
22
23
  </define>
23
24
  <define name="DocumentSubtype">