metanorma-ogc 2.9.9 → 2.9.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -156,7 +156,7 @@
156
156
  </fo:bookmark>
157
157
  </xsl:if>
158
158
 
159
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title)">
159
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title)">
160
160
  <xsl:variable name="list_of_examples_">
161
161
  <xsl:for-each select="//mn:example[@id and mn:fmt-name and not(@unnumbered = 'true')]">
162
162
  <example id="{@id}"><xsl:apply-templates select="mn:fmt-name" mode="bookmarks"/></example>
@@ -970,45 +970,59 @@
970
970
 
971
971
  <xsl:variable name="ace_tag">ace-tag_</xsl:variable>
972
972
 
973
- <xsl:variable name="title-list-tables">
974
- <xsl:variable name="toc_table_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title"/>
975
- <xsl:value-of select="$toc_table_title"/>
976
- <xsl:if test="normalize-space($toc_table_title) = ''">
977
- <xsl:call-template name="getLocalizedString">
978
- <xsl:with-param name="key">toc_tables</xsl:with-param>
979
- </xsl:call-template>
980
- </xsl:if>
981
- </xsl:variable>
973
+ <xsl:variable name="toc_title_lists_">
974
+ <xsl:for-each select="//mn:metanorma">
975
+ <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
976
+ <xsl:variable name="docid"><xsl:call-template name="getDocumentId"/></xsl:variable>
977
+ <xsl:variable name="current_document">
978
+ <xsl:copy-of select="."/>
979
+ </xsl:variable>
980
+ <xsl:for-each select="xalan:nodeset($current_document)">
981
+ <mnx:doc id="{$docid}" num="{$num}">
982
+ <mnx:title-list-tables>
983
+ <xsl:variable name="toc_table_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title"/>
984
+ <xsl:value-of select="$toc_table_title"/>
985
+ <xsl:if test="normalize-space($toc_table_title) = ''">
986
+ <xsl:call-template name="getLocalizedString">
987
+ <xsl:with-param name="key">toc_tables</xsl:with-param>
988
+ </xsl:call-template>
989
+ </xsl:if>
990
+ </mnx:title-list-tables>
982
991
 
983
- <xsl:variable name="title-list-figures">
984
- <xsl:variable name="toc_figure_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title"/>
985
- <xsl:value-of select="$toc_figure_title"/>
986
- <xsl:if test="normalize-space($toc_figure_title) = ''">
987
- <xsl:call-template name="getLocalizedString">
988
- <xsl:with-param name="key">toc_figures</xsl:with-param>
989
- </xsl:call-template>
990
- </xsl:if>
991
- </xsl:variable>
992
+ <mnx:title-list-figures>
993
+ <xsl:variable name="toc_figure_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title"/>
994
+ <xsl:value-of select="$toc_figure_title"/>
995
+ <xsl:if test="normalize-space($toc_figure_title) = ''">
996
+ <xsl:call-template name="getLocalizedString">
997
+ <xsl:with-param name="key">toc_figures</xsl:with-param>
998
+ </xsl:call-template>
999
+ </xsl:if>
1000
+ </mnx:title-list-figures>
992
1001
 
993
- <xsl:variable name="title-list-examples">
994
- <xsl:variable name="toc_example_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title"/>
995
- <xsl:value-of select="$toc_example_title"/>
996
- <xsl:if test="normalize-space($toc_example_title) = ''">
997
- <xsl:call-template name="getLocalizedString">
998
- <xsl:with-param name="key">toc_examples</xsl:with-param>
999
- </xsl:call-template>
1000
- </xsl:if>
1001
- </xsl:variable>
1002
+ <mnx:title-list-examples>
1003
+ <xsl:variable name="toc_example_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title"/>
1004
+ <xsl:value-of select="$toc_example_title"/>
1005
+ <xsl:if test="normalize-space($toc_example_title) = ''">
1006
+ <xsl:call-template name="getLocalizedString">
1007
+ <xsl:with-param name="key">toc_examples</xsl:with-param>
1008
+ </xsl:call-template>
1009
+ </xsl:if>
1010
+ </mnx:title-list-examples>
1002
1011
 
1003
- <xsl:variable name="title-list-recommendations">
1004
- <xsl:variable name="toc_requirement_title" select="//mn:metanorma/mn:metanorma-extension/mn:toc[@type='requirement']/mn:title"/>
1005
- <xsl:value-of select="$toc_requirement_title"/>
1006
- <xsl:if test="normalize-space($toc_requirement_title) = ''">
1007
- <xsl:call-template name="getLocalizedString">
1008
- <xsl:with-param name="key">toc_recommendations</xsl:with-param>
1009
- </xsl:call-template>
1010
- </xsl:if>
1012
+ <mnx:title-list-recommendations>
1013
+ <xsl:variable name="toc_requirement_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='requirement']/mn:title"/>
1014
+ <xsl:value-of select="$toc_requirement_title"/>
1015
+ <xsl:if test="normalize-space($toc_requirement_title) = ''">
1016
+ <xsl:call-template name="getLocalizedString">
1017
+ <xsl:with-param name="key">toc_recommendations</xsl:with-param>
1018
+ </xsl:call-template>
1019
+ </xsl:if>
1020
+ </mnx:title-list-recommendations>
1021
+ </mnx:doc>
1022
+ </xsl:for-each>
1023
+ </xsl:for-each>
1011
1024
  </xsl:variable>
1025
+ <xsl:variable name="toc_title_lists" select="xalan:nodeset($toc_title_lists_)"/>
1012
1026
 
1013
1027
  <xsl:variable name="bibdata">
1014
1028
  <xsl:copy-of select="//mn:metanorma/mn:bibdata"/>
@@ -1798,7 +1812,7 @@
1798
1812
  <xsl:apply-templates mode="update_xml_step1"/>
1799
1813
  </xsl:template>
1800
1814
 
1801
- <xsl:template match="mn:semx" mode="update_xml_step1">
1815
+ <xsl:template match="mn:semx[not(@element = 'name')]" mode="update_xml_step1">
1802
1816
  <xsl:apply-templates mode="update_xml_step1"/>
1803
1817
  </xsl:template>
1804
1818
 
@@ -2081,7 +2095,7 @@
2081
2095
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
2082
2096
  <xsl:variable name="regex_dots_units">((\b((<xsl:value-of select="$non_white_space"/>{1,3}\.<xsl:value-of select="$non_white_space"/>+)|(<xsl:value-of select="$non_white_space"/>+\.<xsl:value-of select="$non_white_space"/>{1,3}))\b)|(\.<xsl:value-of select="$non_white_space"/>{1,3})\b)</xsl:variable>
2083
2097
 
2084
- <xsl:template match="text()[not(ancestor::mn:bibdata or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or (ancestor::mn:tt and ancestor::mn:table and string-length() &gt; 20) or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or ancestor::mn:fmt-name or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
2098
+ <xsl:template match="text()[not( (ancestor::mn:bibdata and not(ancestor::mn:title)) or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or (ancestor::mn:tt and ancestor::mn:table and string-length() &gt; 20) or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or (ancestor::mn:fmt-name and not(ancestor::mn:semx[@element = 'name'])) or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
2085
2099
 
2086
2100
  <xsl:variable name="parent" select="local-name(..)"/>
2087
2101
 
@@ -2126,7 +2140,7 @@
2126
2140
  <xsl:variable name="text">
2127
2141
  <xsl:element name="text" namespace="{$namespace_full}">
2128
2142
  <xsl:choose>
2129
- <xsl:when test="ancestor::mn:table"><xsl:value-of select="."/></xsl:when> <!-- no need enclose standard's number into tag 'keep-together_within-line' in table cells -->
2143
+ <xsl:when test="ancestor::mn:table and not(ancestor::mn:fmt-name)"><xsl:value-of select="."/></xsl:when> <!-- no need enclose standard's number into tag 'keep-together_within-line' in table cells -->
2130
2144
  <xsl:otherwise>
2131
2145
  <xsl:variable name="text_" select="java:replaceAll(java:java.lang.String.new(.), $regex_standard_reference, concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/>
2132
2146
  <!-- <xsl:value-of select="$text__"/> -->
@@ -2204,6 +2218,10 @@
2204
2218
  <xsl:copy-of select="."/>
2205
2219
  </xsl:template>
2206
2220
 
2221
+ <xsl:template match="mn:semx" mode="update_xml_enclose_keep-together_within-line">
2222
+ <xsl:apply-templates mode="update_xml_enclose_keep-together_within-line"/>
2223
+ </xsl:template>
2224
+
2207
2225
  <xsl:template name="replace_text_tags">
2208
2226
  <xsl:param name="tag_open"/>
2209
2227
  <xsl:param name="tag_close"/>
@@ -9585,6 +9603,7 @@
9585
9603
  <xsl:variable name="svg_content">
9586
9604
  <xsl:apply-templates select="." mode="svg_update"/>
9587
9605
  </xsl:variable>
9606
+ <!-- <svg_content><xsl:copy-of select="$svg_content"/></svg_content> -->
9588
9607
 
9589
9608
  <xsl:variable name="alt-text">
9590
9609
  <xsl:choose>
@@ -9799,7 +9818,7 @@
9799
9818
  </xsl:copy>
9800
9819
  </xsl:template>
9801
9820
 
9802
- <xsl:template match="mn:image/@href" mode="svg_update">
9821
+ <xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
9803
9822
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
9804
9823
  <xsl:value-of select="."/>
9805
9824
  </xsl:attribute>
@@ -12402,13 +12421,13 @@
12402
12421
 
12403
12422
  <xsl:template name="processTablesFigures_Contents">
12404
12423
  <xsl:param name="always"/>
12405
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
12424
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
12406
12425
  <xsl:call-template name="processTables_Contents"/>
12407
12426
  </xsl:if>
12408
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
12427
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
12409
12428
  <xsl:call-template name="processFigures_Contents"/>
12410
12429
  </xsl:if>
12411
- <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title)">
12430
+ <xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title)">
12412
12431
  <xsl:call-template name="processExamples_Contents"/>
12413
12432
  </xsl:if>
12414
12433
  </xsl:template>
@@ -12459,22 +12478,22 @@
12459
12478
 
12460
12479
  <xsl:template name="processExamples_Contents">
12461
12480
  <mnx:examples>
12462
- <xsl:for-each select="//mn:example[@id and mn:fmt-name and not(@unnumbered = 'true') and normalize-space(@id) != '']">
12463
- <xsl:choose>
12464
- <xsl:when test="mn:fmt-name">
12465
- <xsl:variable name="fmt_name">
12466
- <xsl:apply-templates select="mn:fmt-name" mode="update_xml_step1"/>
12467
- </xsl:variable>
12468
- <mnx:example id="{@id}" alt-text="{normalize-space($fmt_name)}">
12469
- <xsl:copy-of select="$fmt_name"/>
12470
- </mnx:example>
12471
- </xsl:when>
12472
- <xsl:otherwise>
12473
- <mnx:example id="{@id}" alt-text="{mn:name}">
12474
- <xsl:copy-of select="mn:name"/>
12475
- </mnx:example>
12476
- </xsl:otherwise>
12477
- </xsl:choose>
12481
+ <xsl:for-each select="//mn:example[@id and mn:fmt-name and normalize-space(@id) != '']">
12482
+ <!-- https://github.com/metanorma/metanorma-pdfa/issues/32#issuecomment-4929133938:
12483
+ //example/fmt-xref-label[@container] + //example/fmt-name/span[@class = 'fmt-caption-delim'] + //example/name,
12484
+ with the last two elements dropped if //example/name does not exist. -->
12485
+ <xsl:variable name="example_name">
12486
+ <xsl:apply-templates select="mn:name/node()" mode="update_xml_step1"/>
12487
+ </xsl:variable>
12488
+ <mnx:example id="{@id}" alt-text="{normalize-space($example_name)}">
12489
+ <xsl:element name="fmt-name" namespace="{$namespace_full}">
12490
+ <xsl:value-of select="mn:fmt-xref-label[@container]"/>
12491
+ <xsl:if test="normalize-space($example_name) != ''">
12492
+ <xsl:value-of select="mn:fmt-name/mn:span[@class = 'fmt-caption-delim']"/>
12493
+ <xsl:copy-of select="$example_name"/>
12494
+ </xsl:if>
12495
+ </xsl:element>
12496
+ </mnx:example>
12478
12497
  </xsl:for-each>
12479
12498
  </mnx:examples>
12480
12499
  </xsl:template>
@@ -12747,15 +12766,18 @@
12747
12766
 
12748
12767
  <xsl:call-template name="insertFigureBookmarks">
12749
12768
  <xsl:with-param name="contents" select="mnx:contents"/>
12769
+ <xsl:with-param name="num" select="@num"/>
12750
12770
  </xsl:call-template>
12751
12771
 
12752
12772
  <xsl:call-template name="insertTableBookmarks">
12753
12773
  <xsl:with-param name="contents" select="mnx:contents"/>
12774
+ <xsl:with-param name="num" select="@num"/>
12754
12775
  <xsl:with-param name="lang" select="@lang"/>
12755
12776
  </xsl:call-template>
12756
12777
 
12757
12778
  <xsl:call-template name="insertExampleBookmarks">
12758
12779
  <xsl:with-param name="contents" select="mnx:contents"/>
12780
+ <xsl:with-param name="num" select="@num"/>
12759
12781
  <xsl:with-param name="lang" select="@lang"/>
12760
12782
  </xsl:call-template>
12761
12783
 
@@ -12770,15 +12792,18 @@
12770
12792
 
12771
12793
  <xsl:call-template name="insertFigureBookmarks">
12772
12794
  <xsl:with-param name="contents" select="mnx:contents"/>
12795
+ <xsl:with-param name="num" select="@num"/>
12773
12796
  </xsl:call-template>
12774
12797
 
12775
12798
  <xsl:call-template name="insertTableBookmarks">
12776
12799
  <xsl:with-param name="contents" select="mnx:contents"/>
12800
+ <xsl:with-param name="num" select="@num"/>
12777
12801
  <xsl:with-param name="lang" select="@lang"/>
12778
12802
  </xsl:call-template>
12779
12803
 
12780
12804
  <xsl:call-template name="insertExampleBookmarks">
12781
12805
  <xsl:with-param name="contents" select="mnx:contents"/>
12806
+ <xsl:with-param name="num" select="@num"/>
12782
12807
  <xsl:with-param name="lang" select="@lang"/>
12783
12808
  </xsl:call-template>
12784
12809
 
@@ -12791,15 +12816,18 @@
12791
12816
 
12792
12817
  <xsl:call-template name="insertFigureBookmarks">
12793
12818
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
12819
+ <xsl:with-param name="num" select="@num"/>
12794
12820
  </xsl:call-template>
12795
12821
 
12796
12822
  <xsl:call-template name="insertTableBookmarks">
12797
12823
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
12824
+ <xsl:with-param name="num" select="@num"/>
12798
12825
  <xsl:with-param name="lang" select="@lang"/>
12799
12826
  </xsl:call-template>
12800
12827
 
12801
12828
  <xsl:call-template name="insertExampleBookmarks">
12802
12829
  <xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
12830
+ <xsl:with-param name="num" select="@num"/>
12803
12831
  <xsl:with-param name="lang" select="@lang"/>
12804
12832
  </xsl:call-template>
12805
12833
 
@@ -12815,6 +12843,7 @@
12815
12843
 
12816
12844
  <xsl:template name="insertFigureBookmarks">
12817
12845
  <xsl:param name="contents"/>
12846
+ <xsl:param name="num"/>
12818
12847
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
12819
12848
  <xsl:if test="$contents_nodes/mnx:figure">
12820
12849
  <fo:bookmark internal-destination="{$contents_nodes/mnx:figure[1]/@id}" starting-state="hide">
@@ -12832,6 +12861,7 @@
12832
12861
 
12833
12862
  <xsl:template name="insertTableBookmarks">
12834
12863
  <xsl:param name="contents"/>
12864
+ <xsl:param name="num"/>
12835
12865
  <xsl:param name="lang"/>
12836
12866
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
12837
12867
  <xsl:if test="$contents_nodes/mnx:table">
@@ -12853,8 +12883,9 @@
12853
12883
  </xsl:if><!-- see template addBookmarks -->
12854
12884
  </xsl:template> <!-- insertTableBookmarks -->
12855
12885
 
12856
- <xsl:template name="insertExampleBookmarks">
12886
+ <xsl:template name="insertExampleBookmarks">
12857
12887
  <xsl:param name="contents"/>
12888
+ <xsl:param name="num"/>
12858
12889
  <xsl:param name="lang"/>
12859
12890
  <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
12860
12891
  <xsl:if test="$contents_nodes/mnx:example">
@@ -13022,6 +13053,18 @@
13022
13053
  </xsl:copy>
13023
13054
  </xsl:template>
13024
13055
 
13056
+ <xsl:template match="mn:tt" mode="contents_item">
13057
+ <xsl:copy>
13058
+ <xsl:apply-templates mode="contents_item"/>
13059
+ </xsl:copy>
13060
+ </xsl:template>
13061
+
13062
+ <xsl:template match="*[local-name() = 'keep-together_within-line']" mode="contents_item">
13063
+ <xsl:copy>
13064
+ <xsl:apply-templates mode="contents_item"/>
13065
+ </xsl:copy>
13066
+ </xsl:template>
13067
+
13025
13068
  <xsl:template match="mn:stem" mode="contents_item"/>
13026
13069
  <xsl:template match="mn:fmt-stem" mode="contents_item">
13027
13070
  <xsl:copy-of select="."/>
@@ -1931,7 +1931,7 @@ or as the string "auto"</a:documentation>
1931
1931
  </element>
1932
1932
  </define>
1933
1933
  <define name="mathml">
1934
- <a:documentation>Encoding of MathML: the official W3C MathML 3.0 grammar (namespace
1934
+ <a:documentation>Encoding of MathML: the official W3C MathML 4 grammar (namespace
1935
1935
  http://www.w3.org/1998/Math/MathML), via the metanorma wrapper in
1936
1936
  grammars/mathml/. See grammars/mathml/README.adoc and basicdoc-models#35.</a:documentation>
1937
1937
  <externalRef href="metanorma-mathml.rng"/>
@@ -146,14 +146,15 @@ module Metanorma
146
146
 
147
147
  PUBLISHER = "./contributor[role/@type = 'publisher']/organization".freeze
148
148
 
149
- def pub_class(bib)
150
- return 1 if bib.at("#{PUBLISHER}[abbreviation = 'OGC']")
151
- return 1 if bib.at("#{PUBLISHER}[name = 'Open Geospatial " \
152
- "Consortium']")
153
- return 2 if bib.at("./docidentifier[@type][not(#{@conv.skip_docid} or " \
154
- "@type = 'metanorma')]")
149
+ # OGC first, then other standards, then everything else. Overridable
150
+ # per-document / per-taste via :sort-biblio-<abbrev>: through the shared
151
+ # Standoc::Ref helpers.
152
+ DEFAULT_PUBLISHER_SORT = [
153
+ { abbrev: "OGC", name: "Open Geospatial Consortium", rank: 1 },
154
+ ].freeze
155
155
 
156
- 3
156
+ def pub_class(bib)
157
+ publisher_sort_rank(bib, DEFAULT_PUBLISHER_SORT)
157
158
  end
158
159
 
159
160
  # sort by: doc class (OGC, other standard (not DOI &c), other
@@ -1,22 +1,21 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <!--
4
- This is the Mathematical Markup Language (MathML) 3.0, an XML
5
- application for describing mathematical notation and capturing
6
- both its structure and content.
7
-
8
- Copyright 1998-2014 W3C (MIT, ERCIM, Keio, Beihang)
9
-
10
- Use and distribution of this code are permitted under the terms
11
- W3C Software Notice and License
12
- http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
13
- -->
14
- <include href="mathml3-strict-content.rng">
2
+ <!--
3
+ MathML 4 (Content)
4
+ ##################
5
+ -->
6
+ <!--
7
+ Copyright 1998-2026 W3C (MIT, ERCIM, Keio, Beihang)
8
+
9
+ Use and distribution of this code are permitted under the terms
10
+ W3C Software Notice and License
11
+ http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
12
+ -->
13
+ <grammar ns="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
14
+ <include href="mathml4-strict-content.rng">
15
15
  <define name="cn.content">
16
16
  <zeroOrMore>
17
17
  <choice>
18
18
  <text/>
19
- <ref name="mglyph"/>
20
19
  <ref name="sep"/>
21
20
  <ref name="PresentationExpression"/>
22
21
  </choice>
@@ -46,7 +45,6 @@
46
45
  <zeroOrMore>
47
46
  <choice>
48
47
  <text/>
49
- <ref name="mglyph"/>
50
48
  <ref name="PresentationExpression"/>
51
49
  </choice>
52
50
  </zeroOrMore>
@@ -65,11 +63,22 @@
65
63
  <zeroOrMore>
66
64
  <choice>
67
65
  <text/>
68
- <ref name="mglyph"/>
69
66
  <ref name="PresentationExpression"/>
70
67
  </choice>
71
68
  </zeroOrMore>
72
69
  </define>
70
+ <define name="annotation-xml.attributes" combine="choice">
71
+ <ref name="CommonAtt"/>
72
+ <optional>
73
+ <ref name="cd"/>
74
+ </optional>
75
+ <optional>
76
+ <ref name="name"/>
77
+ </optional>
78
+ <optional>
79
+ <ref name="encoding"/>
80
+ </optional>
81
+ </define>
73
82
  <define name="bvar">
74
83
  <element name="bvar">
75
84
  <ref name="CommonAtt"/>
@@ -113,6 +122,63 @@
113
122
  <ref name="apply.content"/>
114
123
  </define>
115
124
  </include>
125
+ <define name="NonMathMLAtt" combine="choice">
126
+ <attribute>
127
+ <anyName>
128
+ <except>
129
+ <nsName ns=""/>
130
+ <nsName/>
131
+ </except>
132
+ </anyName>
133
+ <data type="string"/>
134
+ </attribute>
135
+ </define>
136
+ <!--
137
+ METANORMA MODIFICATION (basicdoc-models#39): upstream re-adds
138
+ `attribute alttext` to math.attributes here, but mathml4-core.rnc already
139
+ defines it on math; RELAX NG's duplicate-attribute restriction rejects the
140
+ composed grammar (jing: 'duplicate attribute "alttext"').
141
+ Upstream text was:
142
+ math.attributes &=
143
+ attribute alttext {text}?
144
+ -->
145
+ <!--
146
+ METANORMA MODIFICATION (basicdoc-models#39): upstream re-adds the
147
+ `data-other` placeholder to MathMLDataAttributes here; dropped for the
148
+ same reason as the core placeholder (see mathml4-core.rnc modification).
149
+ Upstream text was:
150
+ MathMLDataAttributes &=
151
+ attribute data-other {text}?
152
+ -->
153
+ <define name="CommonAtt" combine="interleave">
154
+ <zeroOrMore>
155
+ <ref name="NonMathMLAtt"/>
156
+ </zeroOrMore>
157
+ <ref name="MathMLDataAttributes"/>
158
+ <optional>
159
+ <attribute name="class">
160
+ <data type="NCName"/>
161
+ </attribute>
162
+ </optional>
163
+ <optional>
164
+ <attribute name="style">
165
+ <data type="string"/>
166
+ </attribute>
167
+ </optional>
168
+ <optional>
169
+ <attribute name="href">
170
+ <data type="anyURI"/>
171
+ </attribute>
172
+ </optional>
173
+ <optional>
174
+ <attribute name="intent"/>
175
+ </optional>
176
+ <optional>
177
+ <attribute name="arg">
178
+ <data type="NCName"/>
179
+ </attribute>
180
+ </optional>
181
+ </define>
116
182
  <define name="base">
117
183
  <attribute name="base"/>
118
184
  </define>
@@ -124,6 +190,18 @@
124
190
  <define name="PresentationExpression" combine="choice">
125
191
  <notAllowed/>
126
192
  </define>
193
+ <define name="DefEncAtt">
194
+ <optional>
195
+ <attribute name="encoding">
196
+ <data type="string"/>
197
+ </attribute>
198
+ </optional>
199
+ <optional>
200
+ <attribute name="definitionURL">
201
+ <data type="anyURI"/>
202
+ </attribute>
203
+ </optional>
204
+ </define>
127
205
  <define name="DomainQ">
128
206
  <zeroOrMore>
129
207
  <choice>
@@ -228,60 +306,6 @@
228
306
  <ref name="ContExp"/>
229
307
  </element>
230
308
  </define>
231
- <define name="DeprecatedContExp">
232
- <choice>
233
- <ref name="reln"/>
234
- <ref name="fn"/>
235
- <ref name="declare"/>
236
- </choice>
237
- </define>
238
- <define name="ContExp" combine="choice">
239
- <ref name="DeprecatedContExp"/>
240
- </define>
241
- <define name="reln">
242
- <element name="reln">
243
- <zeroOrMore>
244
- <ref name="ContExp"/>
245
- </zeroOrMore>
246
- </element>
247
- </define>
248
- <define name="fn">
249
- <element name="fn">
250
- <ref name="ContExp"/>
251
- </element>
252
- </define>
253
- <define name="declare">
254
- <element name="declare">
255
- <optional>
256
- <attribute name="type">
257
- <data type="string"/>
258
- </attribute>
259
- </optional>
260
- <optional>
261
- <attribute name="scope">
262
- <data type="string"/>
263
- </attribute>
264
- </optional>
265
- <optional>
266
- <attribute name="nargs">
267
- <data type="nonNegativeInteger"/>
268
- </attribute>
269
- </optional>
270
- <optional>
271
- <attribute name="occurrence">
272
- <choice>
273
- <value>prefix</value>
274
- <value>infix</value>
275
- <value>function-model</value>
276
- </choice>
277
- </attribute>
278
- </optional>
279
- <ref name="DefEncAtt"/>
280
- <oneOrMore>
281
- <ref name="ContExp"/>
282
- </oneOrMore>
283
- </element>
284
- </define>
285
309
  <define name="interval.class">
286
310
  <ref name="interval"/>
287
311
  </define>
@@ -1253,10 +1277,10 @@
1253
1277
  <define name="nary-stats.class">
1254
1278
  <choice>
1255
1279
  <ref name="mean"/>
1256
- <ref name="sdev"/>
1257
- <ref name="variance"/>
1258
1280
  <ref name="median"/>
1259
1281
  <ref name="mode"/>
1282
+ <ref name="sdev"/>
1283
+ <ref name="variance"/>
1260
1284
  </choice>
1261
1285
  </define>
1262
1286
  <define name="ContExp" combine="choice">
@@ -1269,29 +1293,29 @@
1269
1293
  <empty/>
1270
1294
  </element>
1271
1295
  </define>
1272
- <define name="sdev">
1273
- <element name="sdev">
1296
+ <define name="median">
1297
+ <element name="median">
1274
1298
  <ref name="CommonAtt"/>
1275
1299
  <ref name="DefEncAtt"/>
1276
1300
  <empty/>
1277
1301
  </element>
1278
1302
  </define>
1279
- <define name="variance">
1280
- <element name="variance">
1303
+ <define name="mode">
1304
+ <element name="mode">
1281
1305
  <ref name="CommonAtt"/>
1282
1306
  <ref name="DefEncAtt"/>
1283
1307
  <empty/>
1284
1308
  </element>
1285
1309
  </define>
1286
- <define name="median">
1287
- <element name="median">
1310
+ <define name="sdev">
1311
+ <element name="sdev">
1288
1312
  <ref name="CommonAtt"/>
1289
1313
  <ref name="DefEncAtt"/>
1290
1314
  <empty/>
1291
1315
  </element>
1292
1316
  </define>
1293
- <define name="mode">
1294
- <element name="mode">
1317
+ <define name="variance">
1318
+ <element name="variance">
1295
1319
  <ref name="CommonAtt"/>
1296
1320
  <ref name="DefEncAtt"/>
1297
1321
  <empty/>