metanorma-ogc 2.7.3 → 2.7.4

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.
@@ -1496,6 +1496,7 @@
1496
1496
  </xsl:template> <!-- refine_table-style -->
1497
1497
 
1498
1498
  <xsl:attribute-set name="table-name-style">
1499
+ <xsl:attribute name="role">Caption</xsl:attribute>
1499
1500
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1500
1501
 
1501
1502
  <xsl:attribute name="font-size">11pt</xsl:attribute>
@@ -1511,6 +1512,9 @@
1511
1512
 
1512
1513
  <xsl:template name="refine_table-name-style">
1513
1514
  <xsl:param name="continued"/>
1515
+ <xsl:if test="$continued = 'true'">
1516
+ <xsl:attribute name="role">SKIP</xsl:attribute>
1517
+ </xsl:if>
1514
1518
 
1515
1519
  </xsl:template> <!-- refine_table-name-style -->
1516
1520
 
@@ -3344,7 +3348,7 @@
3344
3348
  </xsl:if>
3345
3349
 
3346
3350
  </fo:block-container>
3347
- </xsl:variable>
3351
+ </xsl:variable> <!-- END: variable name="table" -->
3348
3352
 
3349
3353
  <xsl:variable name="isAdded" select="@added"/>
3350
3354
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -3398,11 +3402,12 @@
3398
3402
 
3399
3403
  </xsl:template>
3400
3404
 
3405
+ <!-- table/name-->
3401
3406
  <xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
3402
3407
  <xsl:param name="continued"/>
3403
3408
  <xsl:if test="normalize-space() != ''">
3404
3409
 
3405
- <fo:block xsl:use-attribute-sets="table-name-style" role="SKIP">
3410
+ <fo:block xsl:use-attribute-sets="table-name-style">
3406
3411
 
3407
3412
  <xsl:call-template name="refine_table-name-style">
3408
3413
  <xsl:with-param name="continued" select="$continued"/>
@@ -3879,7 +3884,7 @@
3879
3884
 
3880
3885
  <xsl:variable name="tableWithNotesAndFootnotes">
3881
3886
 
3882
- <fo:table keep-with-previous="always">
3887
+ <fo:table keep-with-previous="always" role="SKIP">
3883
3888
  <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
3884
3889
  <xsl:variable name="name" select="local-name()"/>
3885
3890
  <xsl:choose>
@@ -3910,9 +3915,9 @@
3910
3915
  </xsl:otherwise>
3911
3916
  </xsl:choose>
3912
3917
 
3913
- <fo:table-body>
3914
- <fo:table-row>
3915
- <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
3918
+ <fo:table-body role="SKIP">
3919
+ <fo:table-row role="SKIP">
3920
+ <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
3916
3921
 
3917
3922
  <xsl:call-template name="refine_table-footer-cell-style"/>
3918
3923
 
@@ -4309,6 +4314,7 @@
4309
4314
  <!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
4310
4315
  <!-- fn in text -->
4311
4316
  <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
4317
+ <xsl:param name="footnote_body_from_table">false</xsl:param>
4312
4318
 
4313
4319
  <!-- list of unique footnotes -->
4314
4320
  <xsl:variable name="p_fn_">
@@ -4374,7 +4380,7 @@
4374
4380
  <xsl:copy-of select="$footnote_inline"/>
4375
4381
  </xsl:when>
4376
4382
  <!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
4377
- <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
4383
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
4378
4384
 
4379
4385
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
4380
4386
  <xsl:copy-of select="$footnote_inline"/>
@@ -4783,39 +4789,51 @@
4783
4789
  <!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
4784
4790
  <!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
4785
4791
  <xsl:template match="*[local-name()='fn']">
4786
- <fo:inline xsl:use-attribute-sets="fn-reference-style">
4792
+ <xsl:variable name="target" select="@target"/>
4793
+ <xsl:choose>
4794
+ <!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
4795
+ <xsl:when test="not(ancestor::*[local-name() = 'table'][1]/*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body'][@id = $target]) and $footnotes/*[local-name() = 'fmt-fn-body'][@id = $target]">
4796
+ <xsl:call-template name="fn">
4797
+ <xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
4798
+ </xsl:call-template>
4799
+ </xsl:when>
4800
+ <xsl:otherwise>
4787
4801
 
4788
- <xsl:call-template name="refine_fn-reference-style"/>
4802
+ <fo:inline xsl:use-attribute-sets="fn-reference-style">
4789
4803
 
4790
- <!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4791
- <fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
4792
- <!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
4793
- <!-- <xsl:attribute name="internal-destination">
4794
- <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
4795
- </xsl:attribute>
4796
- </xsl:if>
4797
- <xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
4798
- <xsl:attribute name="internal-destination">
4799
- <xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
4800
- <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
4801
- </xsl:attribute>
4802
- </xsl:if> -->
4803
- <!-- <xsl:if test="$namespace = 'plateau'">
4804
- <xsl:text>※</xsl:text>
4805
- </xsl:if> -->
4806
- <!-- <xsl:value-of select="@reference"/> -->
4807
-
4808
- <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
4804
+ <xsl:call-template name="refine_fn-reference-style"/>
4809
4805
 
4810
- <!-- <xsl:if test="$namespace = 'bsi'">
4811
- <xsl:text>)</xsl:text>
4812
- </xsl:if> -->
4813
- <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
4814
- <!-- <xsl:if test="$namespace = 'jis'">
4815
- <fo:inline font-weight="normal">)</fo:inline>
4816
- </xsl:if> -->
4817
- </fo:basic-link>
4818
- </fo:inline>
4806
+ <!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4807
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
4808
+ <!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
4809
+ <!-- <xsl:attribute name="internal-destination">
4810
+ <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
4811
+ </xsl:attribute>
4812
+ </xsl:if>
4813
+ <xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
4814
+ <xsl:attribute name="internal-destination">
4815
+ <xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
4816
+ <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
4817
+ </xsl:attribute>
4818
+ </xsl:if> -->
4819
+ <!-- <xsl:if test="$namespace = 'plateau'">
4820
+ <xsl:text>※</xsl:text>
4821
+ </xsl:if> -->
4822
+ <!-- <xsl:value-of select="@reference"/> -->
4823
+
4824
+ <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
4825
+
4826
+ <!-- <xsl:if test="$namespace = 'bsi'">
4827
+ <xsl:text>)</xsl:text>
4828
+ </xsl:if> -->
4829
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
4830
+ <!-- <xsl:if test="$namespace = 'jis'">
4831
+ <fo:inline font-weight="normal">)</fo:inline>
4832
+ </xsl:if> -->
4833
+ </fo:basic-link>
4834
+ </fo:inline>
4835
+ </xsl:otherwise>
4836
+ </xsl:choose>
4819
4837
  </xsl:template> <!-- fn -->
4820
4838
 
4821
4839
  <!-- fn/text() -->
@@ -8814,6 +8832,13 @@
8814
8832
  <xsl:apply-templates select="."/>
8815
8833
  </xsl:template>
8816
8834
 
8835
+ <!-- prevent missing stem for table and figures in ToC -->
8836
+ <xsl:template match="*[local-name() = 'name' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
8837
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-stem'])">
8838
+ <xsl:apply-templates select="."/>
8839
+ </xsl:if>
8840
+ </xsl:template>
8841
+
8817
8842
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/>
8818
8843
 
8819
8844
  <xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/>
@@ -9012,6 +9037,26 @@
9012
9037
  </xsl:template> <!-- insertTableBookmarks -->
9013
9038
  <!-- End Bookmarks -->
9014
9039
 
9040
+ <!-- ============================ -->
9041
+ <!-- mode="bookmark_clean" -->
9042
+ <!-- ============================ -->
9043
+ <xsl:template match="node()" mode="bookmark_clean">
9044
+ <xsl:apply-templates select="node()" mode="bookmark_clean"/>
9045
+ </xsl:template>
9046
+
9047
+ <xsl:template match="text()" mode="bookmark_clean">
9048
+ <xsl:value-of select="."/>
9049
+ </xsl:template>
9050
+
9051
+ <xsl:template match="*[local-name() = 'math']" mode="bookmark_clean">
9052
+ <xsl:value-of select="normalize-space(.)"/>
9053
+ </xsl:template>
9054
+
9055
+ <xsl:template match="*[local-name() = 'asciimath']" mode="bookmark_clean"/>
9056
+ <!-- ============================ -->
9057
+ <!-- END: mode="bookmark_clean" -->
9058
+ <!-- ============================ -->
9059
+
9015
9060
  <xsl:template name="getLangVersion">
9016
9061
  <xsl:param name="lang"/>
9017
9062
  <xsl:param name="doctype" select="''"/>
@@ -11054,9 +11099,15 @@
11054
11099
  <xsl:when test="local-name(..) = 'ul'">
11055
11100
  <xsl:choose>
11056
11101
  <xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
11102
+ <!-- https://github.com/metanorma/isodoc/issues/675 -->
11103
+ <xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
11057
11104
  <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
11058
11105
  </xsl:choose>
11059
11106
  </xsl:when>
11107
+ <!-- https://github.com/metanorma/isodoc/issues/675 -->
11108
+ <xsl:when test="local-name(..) = 'ol' and @label and @full = 'true'"> <!-- @full added in the template li/fmt-name -->
11109
+ <xsl:value-of select="@label"/>
11110
+ </xsl:when>
11060
11111
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
11061
11112
 
11062
11113
  <xsl:variable name="type" select="../@type"/>
@@ -11181,7 +11232,7 @@
11181
11232
 
11182
11233
  </xsl:otherwise>
11183
11234
  </xsl:choose>
11184
- </xsl:template>
11235
+ </xsl:template> <!-- getListItemFormat -->
11185
11236
 
11186
11237
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
11187
11238
  <xsl:param name="indent">0</xsl:param>
@@ -11313,6 +11364,11 @@
11313
11364
 
11314
11365
  <xsl:call-template name="refine_list-item-label-style"/>
11315
11366
 
11367
+ <xsl:if test="local-name(..) = 'ul'">
11368
+ <xsl:variable name="li_label" select="@label"/>
11369
+ <xsl:copy-of select="$ul_labels//label[. = $li_label]/@*[not(local-name() = 'level')]"/>
11370
+ </xsl:if>
11371
+
11316
11372
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
11317
11373
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
11318
11374
  <xsl:call-template name="append_add-style"/>
@@ -12716,6 +12772,16 @@
12716
12772
  </xsl:choose>
12717
12773
  </xsl:template>
12718
12774
 
12775
+ <!-- li/fmt-name -->
12776
+ <xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_step1">
12777
+ <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
12778
+ <xsl:attribute name="full">true</xsl:attribute>
12779
+ </xsl:template>
12780
+ <xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_pres">
12781
+ <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
12782
+ <xsl:attribute name="full">true</xsl:attribute>
12783
+ </xsl:template>
12784
+
12719
12785
  <xsl:template match="*[local-name() = 'fmt-preferred']"/>
12720
12786
  <xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
12721
12787
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -13530,6 +13596,64 @@
13530
13596
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
13531
13597
  </xsl:template>
13532
13598
 
13599
+ <!-- ===================================== -->
13600
+ <!-- ===================================== -->
13601
+ <!-- Ruby text (CJK languages) rendering -->
13602
+ <!-- ===================================== -->
13603
+ <!-- ===================================== -->
13604
+ <xsl:template match="*[local-name() = 'ruby']">
13605
+ <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
13606
+ <xsl:if test="not(ancestor::*[local-name() = 'ruby'])">
13607
+ <xsl:attribute name="alignment-baseline">central</xsl:attribute>
13608
+ </xsl:if>
13609
+ <xsl:variable name="rt_text" select="*[local-name() = 'rt']"/>
13610
+ <xsl:variable name="rb_text" select=".//*[local-name() = 'rb'][not(*[local-name() = 'ruby'])]"/>
13611
+ <!-- Example: width="2em" -->
13612
+ <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
13613
+ <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
13614
+ <xsl:variable name="text_width">
13615
+ <xsl:choose>
13616
+ <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
13617
+ <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
13618
+ </xsl:choose>
13619
+ </xsl:variable>
13620
+ <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
13621
+
13622
+ <xsl:choose>
13623
+ <xsl:when test="ancestor::*[local-name() = 'ruby']">
13624
+ <xsl:apply-templates select="*[local-name() = 'rb']"/>
13625
+ <xsl:apply-templates select="*[local-name() = 'rt']"/>
13626
+ </xsl:when>
13627
+ <xsl:otherwise>
13628
+ <xsl:apply-templates select="*[local-name() = 'rt']"/>
13629
+ <xsl:apply-templates select="*[local-name() = 'rb']"/>
13630
+ </xsl:otherwise>
13631
+ </xsl:choose>
13632
+
13633
+ <xsl:apply-templates select="node()[not(local-name() = 'rt') and not(local-name() = 'rb')]"/>
13634
+ </fo:inline-container>
13635
+ </xsl:template>
13636
+
13637
+ <xsl:template match="*[local-name() = 'rb']">
13638
+ <fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
13639
+ </xsl:template>
13640
+
13641
+ <xsl:template match="*[local-name() = 'rt']">
13642
+ <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
13643
+ <xsl:if test="ancestor::*[local-name() = 'ruby'][last()]//*[local-name() = 'ruby'] or ancestor::*[local-name() = 'rb']">
13644
+ <xsl:attribute name="space-before">0em</xsl:attribute>
13645
+ </xsl:if>
13646
+ <xsl:apply-templates/>
13647
+ </fo:block>
13648
+
13649
+ </xsl:template>
13650
+
13651
+ <!-- ===================================== -->
13652
+ <!-- ===================================== -->
13653
+ <!-- END: Ruby text (CJK languages) rendering -->
13654
+ <!-- ===================================== -->
13655
+ <!-- ===================================== -->
13656
+
13533
13657
  <xsl:template name="printEdition">
13534
13658
  <xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
13535
13659
 
@@ -51,9 +51,7 @@ module IsoDoc
51
51
  <title>#{@i18n.dochistory}</title>
52
52
  <table><thead>
53
53
  <tr><th>Date</th><th>Release</th><th>Author</th><th>Paragraph Modified</th><th>Description</th></tr>
54
- </thead><tbody>
55
- #{ret}
56
- </tbody></table></annex>
54
+ </thead><tbody>#{ret}</tbody></table></annex>
57
55
  XML
58
56
  end
59
57
 
@@ -175,15 +173,13 @@ module IsoDoc
175
173
  end
176
174
  end
177
175
 
178
- #def designation_boldface(desgn); end
176
+ # def designation_boldface(desgn); end
179
177
 
180
178
  def source_label(elem)
181
179
  labelled_ancestor(elem) and return
182
- #lbl = "<span class='fmt-element-name'>#{lower2cap @i18n.sourcecode}</span>"
183
180
  n = @xrefs.get[elem["id"]]
184
- #(n.nil? || n[:label].nil? || n[:label].empty?) or
185
- #lbl = l10n("#{lbl} #{autonum(elem['id'], n[:label])}")
186
- lbl = labelled_autonum(lower2cap(@i18n.sourcecode), elem["id"], n&.dig(:label))
181
+ lbl = labelled_autonum(lower2cap(@i18n.sourcecode), elem["id"],
182
+ n&.dig(:label))
187
183
  prefix_name(elem, { caption: block_delim }, lbl, "name")
188
184
  end
189
185
 
@@ -218,6 +214,20 @@ module IsoDoc
218
214
  true
219
215
  end
220
216
 
217
+ def ul_label_list(_elem)
218
+ if @doctype == "white-paper" then %w(&#x2014;)
219
+ else %w(&#x2022;)
220
+ end
221
+ end
222
+
223
+ def ol_label_template(_elem)
224
+ super
225
+ .merge({
226
+ alphabet_upper: %{%<span class="fmt-label-delim">)</span>},
227
+ arabic: %{%<span class="fmt-label-delim">.</span>},
228
+ })
229
+ end
230
+
221
231
  include Init
222
232
  end
223
233
  end
@@ -1701,16 +1701,22 @@ which can be bookmarks as well as block or section references</a:documentation>
1701
1701
  <a:documentation>Inline reference to a paragraph or paragraphs, appearing as a footnote.
1702
1702
  The target of a footnote is the location it is embedded in within the text</a:documentation>
1703
1703
  <element name="fn">
1704
- <attribute name="reference">
1705
- <a:documentation>The number of the footnote, used to identify it visually</a:documentation>
1706
- </attribute>
1707
- <oneOrMore>
1708
- <ref name="paragraph">
1709
- <a:documentation>The content of the footnote</a:documentation>
1710
- </ref>
1711
- </oneOrMore>
1704
+ <ref name="FnAttributes"/>
1705
+ <ref name="FnBody"/>
1712
1706
  </element>
1713
1707
  </define>
1708
+ <define name="FnBody">
1709
+ <oneOrMore>
1710
+ <ref name="paragraph">
1711
+ <a:documentation>The content of the footnote</a:documentation>
1712
+ </ref>
1713
+ </oneOrMore>
1714
+ </define>
1715
+ <define name="FnAttributes">
1716
+ <attribute name="reference">
1717
+ <a:documentation>The number of the footnote, used to identify it visually</a:documentation>
1718
+ </attribute>
1719
+ </define>
1714
1720
  <define name="callout">
1715
1721
  <a:documentation>Inline reference to a paragraph or paragraphs, appearing as annotation of source code</a:documentation>
1716
1722
  <element name="callout">
@@ -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">