metanorma-iho 1.3.8 → 1.3.9
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 +4 -4
- data/.rubocop.yml +13 -1
- data/lib/isodoc/iho/iho.specification.xsl +47 -16
- data/lib/isodoc/iho/iho.standard.xsl +47 -16
- data/lib/metanorma/iho/basicdoc.rng +31 -6
- data/lib/metanorma/iho/isodoc.rng +22 -3
- data/lib/metanorma/iho/mathml3-common.rng +257 -0
- data/lib/metanorma/iho/mathml3-content.rng +1544 -0
- data/lib/metanorma/iho/mathml3-presentation.rng +2324 -0
- data/lib/metanorma/iho/mathml3-strict-content.rng +205 -0
- data/lib/metanorma/iho/mathml3.rng +23 -0
- data/lib/metanorma/iho/metanorma-mathml.rng +45 -0
- data/lib/metanorma/iho/reqt.rng +10 -2
- data/lib/metanorma/iho/version.rb +1 -1
- data/metanorma-iho.gemspec +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 699ecaf6af88f3e45620bdd4ccf9f6595eb83fde99eb19250c6110dd25728efd
|
|
4
|
+
data.tar.gz: a1f93357ee69e9f7715fb0d62dffa5fe5dcd69b2a29bf4e86bb07ec5f654029a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 561888ca71758aa49b61d78e30d0ad8fc0465fa7ed8fd5d0ec4f5f6015bdbd1e4181f0e046890ffe623545dd9d3b700ee6de89384f43da66d87255579f59beaa
|
|
7
|
+
data.tar.gz: '039998c1132f430863caf171c2549883cfcf95eec4def1fd86139d79d0d67976df0f4d5125fb435053b2aed2911823cf4b1a2ecd3512318e4c50a8f448cff896'
|
data/.rubocop.yml
CHANGED
|
@@ -3,8 +3,20 @@
|
|
|
3
3
|
inherit_from:
|
|
4
4
|
- https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
|
|
5
5
|
|
|
6
|
+
# Rubocop plugins enabled centrally so every metanorma-org gem picks them up
|
|
7
|
+
# on cimas sync — best practice belongs at the shared-template layer, not
|
|
8
|
+
# per-repo. Per ronaldtse feedback on metanorma/ci#332.
|
|
9
|
+
plugins:
|
|
10
|
+
- rubocop-rspec
|
|
11
|
+
- rubocop-performance
|
|
12
|
+
- rubocop-rake
|
|
13
|
+
|
|
6
14
|
# local repo-specific modifications
|
|
7
15
|
# ...
|
|
8
16
|
|
|
9
17
|
AllCops:
|
|
10
|
-
|
|
18
|
+
# 3.3 matches the org-wide minimum being pushed via #274 (Raise minimum
|
|
19
|
+
# Ruby version to 3.3 due to EOL of 3.2 on 2026-03-31). Was 3.4 before
|
|
20
|
+
# this commit — 3.4 was above the org's stated minimum and would have
|
|
21
|
+
# applied Rubocop rules that fail-close on gems still targeting 3.3.
|
|
22
|
+
TargetRubyVersion: 3.3
|
|
@@ -6813,6 +6813,12 @@
|
|
|
6813
6813
|
<style name="{$key}-left"><xsl:value-of select="$value"/></style>
|
|
6814
6814
|
<style name="{$key}-bottom"><xsl:value-of select="$value"/></style>
|
|
6815
6815
|
</xsl:if>
|
|
6816
|
+
<xsl:if test="$key = 'page-break-inside' and $value = 'avoid'">
|
|
6817
|
+
<style name="keep-together.within-page">always</style>
|
|
6818
|
+
</xsl:if>
|
|
6819
|
+
<xsl:if test="$key = 'page-break-after' and $value = 'always'">
|
|
6820
|
+
<style name="break-after">page</style>
|
|
6821
|
+
</xsl:if>
|
|
6816
6822
|
</xsl:for-each>
|
|
6817
6823
|
</xsl:variable>
|
|
6818
6824
|
<xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
|
|
@@ -6856,6 +6862,11 @@
|
|
|
6856
6862
|
|
|
6857
6863
|
<fo:block role="SKIP">
|
|
6858
6864
|
|
|
6865
|
+
<xsl:variable name="styles">
|
|
6866
|
+
<styles><xsl:call-template name="setTableStyles"/></styles>
|
|
6867
|
+
</xsl:variable>
|
|
6868
|
+
<xsl:copy-of select="xalan:nodeset($styles)/styles/@break-after"/>
|
|
6869
|
+
|
|
6859
6870
|
<xsl:if test="$isGenerateTableIF = 'true'">
|
|
6860
6871
|
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
|
|
6861
6872
|
</xsl:if>
|
|
@@ -9012,12 +9023,28 @@
|
|
|
9012
9023
|
<!-- ====== -->
|
|
9013
9024
|
<!-- ====== -->
|
|
9014
9025
|
|
|
9015
|
-
<xsl:attribute-set name="quote-style">
|
|
9026
|
+
<xsl:attribute-set name="quote-container-style">
|
|
9016
9027
|
<xsl:attribute name="margin-left">12mm</xsl:attribute>
|
|
9017
9028
|
<xsl:attribute name="margin-right">12mm</xsl:attribute>
|
|
9018
|
-
<xsl:attribute name="
|
|
9029
|
+
<xsl:attribute name="role">SKIP</xsl:attribute>
|
|
9030
|
+
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
|
9019
9031
|
<xsl:attribute name="margin-left">4.5mm</xsl:attribute>
|
|
9020
9032
|
<xsl:attribute name="margin-right">9mm</xsl:attribute>
|
|
9033
|
+
</xsl:attribute-set>
|
|
9034
|
+
|
|
9035
|
+
<xsl:template name="refine_quote-container-style">
|
|
9036
|
+
<xsl:if test="parent::mn:note">
|
|
9037
|
+
<xsl:if test="not(ancestor::mn:table)">
|
|
9038
|
+
<xsl:attribute name="margin-left">5mm</xsl:attribute>
|
|
9039
|
+
</xsl:if>
|
|
9040
|
+
</xsl:if>
|
|
9041
|
+
</xsl:template>
|
|
9042
|
+
|
|
9043
|
+
<xsl:attribute-set name="quote-style">
|
|
9044
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
|
9045
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
|
9046
|
+
<xsl:attribute name="font-family">Calibri</xsl:attribute>
|
|
9047
|
+
|
|
9021
9048
|
</xsl:attribute-set> <!-- quote-style -->
|
|
9022
9049
|
|
|
9023
9050
|
<xsl:template name="refine_quote-style">
|
|
@@ -9025,6 +9052,7 @@
|
|
|
9025
9052
|
|
|
9026
9053
|
<xsl:attribute-set name="quote-source-style">
|
|
9027
9054
|
<xsl:attribute name="text-align">right</xsl:attribute>
|
|
9055
|
+
<xsl:attribute name="margin-right">-12mm</xsl:attribute>
|
|
9028
9056
|
</xsl:attribute-set> <!-- quote-source-style -->
|
|
9029
9057
|
|
|
9030
9058
|
<xsl:template name="refine_quote-source-style">
|
|
@@ -9047,12 +9075,9 @@
|
|
|
9047
9075
|
|
|
9048
9076
|
<xsl:call-template name="setBlockSpanAll"/>
|
|
9049
9077
|
|
|
9050
|
-
<xsl:
|
|
9051
|
-
<xsl:
|
|
9052
|
-
|
|
9053
|
-
</xsl:if>
|
|
9054
|
-
</xsl:if>
|
|
9055
|
-
<fo:block-container margin-left="0mm" role="SKIP">
|
|
9078
|
+
<fo:block-container xsl:use-attribute-sets="quote-container-style">
|
|
9079
|
+
<xsl:call-template name="refine_quote-container-style"/>
|
|
9080
|
+
|
|
9056
9081
|
<fo:block-container xsl:use-attribute-sets="quote-style" role="SKIP">
|
|
9057
9082
|
|
|
9058
9083
|
<xsl:call-template name="refine_quote-style"/>
|
|
@@ -9064,14 +9089,16 @@
|
|
|
9064
9089
|
</fo:block-container>
|
|
9065
9090
|
</fo:block-container>
|
|
9066
9091
|
<xsl:if test="mn:author or mn:fmt-source or mn:attribution">
|
|
9067
|
-
<fo:block
|
|
9068
|
-
<xsl:
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9092
|
+
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
|
9093
|
+
<fo:block xsl:use-attribute-sets="quote-source-style">
|
|
9094
|
+
<xsl:call-template name="refine_quote-source-style"/>
|
|
9095
|
+
<!-- — ISO, ISO 7301:2011, Clause 1 -->
|
|
9096
|
+
<xsl:apply-templates select="mn:author"/>
|
|
9097
|
+
<xsl:apply-templates select="mn:fmt-source"/>
|
|
9098
|
+
<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
|
|
9099
|
+
<xsl:apply-templates select="mn:attribution/mn:p/node()"/>
|
|
9100
|
+
</fo:block>
|
|
9101
|
+
</fo:block-container>
|
|
9075
9102
|
</xsl:if>
|
|
9076
9103
|
|
|
9077
9104
|
</fo:block-container>
|
|
@@ -14262,6 +14289,10 @@
|
|
|
14262
14289
|
<fo:block break-after="page"/>
|
|
14263
14290
|
</xsl:template>
|
|
14264
14291
|
|
|
14292
|
+
<xsl:template match="mn:pagebreak[ancestor::mn:table]" priority="2">
|
|
14293
|
+
<fo:block break-after="page"/>
|
|
14294
|
+
</xsl:template>
|
|
14295
|
+
|
|
14265
14296
|
<xsl:variable name="font_main_root_style">
|
|
14266
14297
|
<root-style xsl:use-attribute-sets="root-style">
|
|
14267
14298
|
</root-style>
|
|
@@ -6813,6 +6813,12 @@
|
|
|
6813
6813
|
<style name="{$key}-left"><xsl:value-of select="$value"/></style>
|
|
6814
6814
|
<style name="{$key}-bottom"><xsl:value-of select="$value"/></style>
|
|
6815
6815
|
</xsl:if>
|
|
6816
|
+
<xsl:if test="$key = 'page-break-inside' and $value = 'avoid'">
|
|
6817
|
+
<style name="keep-together.within-page">always</style>
|
|
6818
|
+
</xsl:if>
|
|
6819
|
+
<xsl:if test="$key = 'page-break-after' and $value = 'always'">
|
|
6820
|
+
<style name="break-after">page</style>
|
|
6821
|
+
</xsl:if>
|
|
6816
6822
|
</xsl:for-each>
|
|
6817
6823
|
</xsl:variable>
|
|
6818
6824
|
<xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
|
|
@@ -6856,6 +6862,11 @@
|
|
|
6856
6862
|
|
|
6857
6863
|
<fo:block role="SKIP">
|
|
6858
6864
|
|
|
6865
|
+
<xsl:variable name="styles">
|
|
6866
|
+
<styles><xsl:call-template name="setTableStyles"/></styles>
|
|
6867
|
+
</xsl:variable>
|
|
6868
|
+
<xsl:copy-of select="xalan:nodeset($styles)/styles/@break-after"/>
|
|
6869
|
+
|
|
6859
6870
|
<xsl:if test="$isGenerateTableIF = 'true'">
|
|
6860
6871
|
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
|
|
6861
6872
|
</xsl:if>
|
|
@@ -9012,12 +9023,28 @@
|
|
|
9012
9023
|
<!-- ====== -->
|
|
9013
9024
|
<!-- ====== -->
|
|
9014
9025
|
|
|
9015
|
-
<xsl:attribute-set name="quote-style">
|
|
9026
|
+
<xsl:attribute-set name="quote-container-style">
|
|
9016
9027
|
<xsl:attribute name="margin-left">12mm</xsl:attribute>
|
|
9017
9028
|
<xsl:attribute name="margin-right">12mm</xsl:attribute>
|
|
9018
|
-
<xsl:attribute name="
|
|
9029
|
+
<xsl:attribute name="role">SKIP</xsl:attribute>
|
|
9030
|
+
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
|
9019
9031
|
<xsl:attribute name="margin-left">4.5mm</xsl:attribute>
|
|
9020
9032
|
<xsl:attribute name="margin-right">9mm</xsl:attribute>
|
|
9033
|
+
</xsl:attribute-set>
|
|
9034
|
+
|
|
9035
|
+
<xsl:template name="refine_quote-container-style">
|
|
9036
|
+
<xsl:if test="parent::mn:note">
|
|
9037
|
+
<xsl:if test="not(ancestor::mn:table)">
|
|
9038
|
+
<xsl:attribute name="margin-left">5mm</xsl:attribute>
|
|
9039
|
+
</xsl:if>
|
|
9040
|
+
</xsl:if>
|
|
9041
|
+
</xsl:template>
|
|
9042
|
+
|
|
9043
|
+
<xsl:attribute-set name="quote-style">
|
|
9044
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
|
9045
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
|
9046
|
+
<xsl:attribute name="font-family">Calibri</xsl:attribute>
|
|
9047
|
+
|
|
9021
9048
|
</xsl:attribute-set> <!-- quote-style -->
|
|
9022
9049
|
|
|
9023
9050
|
<xsl:template name="refine_quote-style">
|
|
@@ -9025,6 +9052,7 @@
|
|
|
9025
9052
|
|
|
9026
9053
|
<xsl:attribute-set name="quote-source-style">
|
|
9027
9054
|
<xsl:attribute name="text-align">right</xsl:attribute>
|
|
9055
|
+
<xsl:attribute name="margin-right">-12mm</xsl:attribute>
|
|
9028
9056
|
</xsl:attribute-set> <!-- quote-source-style -->
|
|
9029
9057
|
|
|
9030
9058
|
<xsl:template name="refine_quote-source-style">
|
|
@@ -9047,12 +9075,9 @@
|
|
|
9047
9075
|
|
|
9048
9076
|
<xsl:call-template name="setBlockSpanAll"/>
|
|
9049
9077
|
|
|
9050
|
-
<xsl:
|
|
9051
|
-
<xsl:
|
|
9052
|
-
|
|
9053
|
-
</xsl:if>
|
|
9054
|
-
</xsl:if>
|
|
9055
|
-
<fo:block-container margin-left="0mm" role="SKIP">
|
|
9078
|
+
<fo:block-container xsl:use-attribute-sets="quote-container-style">
|
|
9079
|
+
<xsl:call-template name="refine_quote-container-style"/>
|
|
9080
|
+
|
|
9056
9081
|
<fo:block-container xsl:use-attribute-sets="quote-style" role="SKIP">
|
|
9057
9082
|
|
|
9058
9083
|
<xsl:call-template name="refine_quote-style"/>
|
|
@@ -9064,14 +9089,16 @@
|
|
|
9064
9089
|
</fo:block-container>
|
|
9065
9090
|
</fo:block-container>
|
|
9066
9091
|
<xsl:if test="mn:author or mn:fmt-source or mn:attribution">
|
|
9067
|
-
<fo:block
|
|
9068
|
-
<xsl:
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9092
|
+
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
|
9093
|
+
<fo:block xsl:use-attribute-sets="quote-source-style">
|
|
9094
|
+
<xsl:call-template name="refine_quote-source-style"/>
|
|
9095
|
+
<!-- — ISO, ISO 7301:2011, Clause 1 -->
|
|
9096
|
+
<xsl:apply-templates select="mn:author"/>
|
|
9097
|
+
<xsl:apply-templates select="mn:fmt-source"/>
|
|
9098
|
+
<!-- added for https://github.com/metanorma/isodoc/issues/607 -->
|
|
9099
|
+
<xsl:apply-templates select="mn:attribution/mn:p/node()"/>
|
|
9100
|
+
</fo:block>
|
|
9101
|
+
</fo:block-container>
|
|
9075
9102
|
</xsl:if>
|
|
9076
9103
|
|
|
9077
9104
|
</fo:block-container>
|
|
@@ -14262,6 +14289,10 @@
|
|
|
14262
14289
|
<fo:block break-after="page"/>
|
|
14263
14290
|
</xsl:template>
|
|
14264
14291
|
|
|
14292
|
+
<xsl:template match="mn:pagebreak[ancestor::mn:table]" priority="2">
|
|
14293
|
+
<fo:block break-after="page"/>
|
|
14294
|
+
</xsl:template>
|
|
14295
|
+
|
|
14265
14296
|
<xsl:variable name="font_main_root_style">
|
|
14266
14297
|
<root-style xsl:use-attribute-sets="root-style">
|
|
14267
14298
|
</root-style>
|
|
@@ -1902,15 +1902,40 @@ or as the string "auto"</a:documentation>
|
|
|
1902
1902
|
<a:documentation>Mathematically formatted text</a:documentation>
|
|
1903
1903
|
<element name="stem">
|
|
1904
1904
|
<ref name="StemAttributes"/>
|
|
1905
|
-
<
|
|
1906
|
-
<
|
|
1905
|
+
<optional>
|
|
1906
|
+
<text>
|
|
1907
1907
|
<a:documentation>The content of the mathematically formatted text</a:documentation>
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1908
|
+
</text>
|
|
1909
|
+
</optional>
|
|
1910
|
+
<optional>
|
|
1911
|
+
<ref name="mathml"/>
|
|
1912
|
+
</optional>
|
|
1913
|
+
<optional>
|
|
1914
|
+
<ref name="asciimath"/>
|
|
1915
|
+
</optional>
|
|
1916
|
+
<optional>
|
|
1917
|
+
<ref name="latexmath"/>
|
|
1918
|
+
</optional>
|
|
1912
1919
|
</element>
|
|
1913
1920
|
</define>
|
|
1921
|
+
<define name="latexmath">
|
|
1922
|
+
<a:documentation>Encoding of LatexMath</a:documentation>
|
|
1923
|
+
<element name="latexmath">
|
|
1924
|
+
<text/>
|
|
1925
|
+
</element>
|
|
1926
|
+
</define>
|
|
1927
|
+
<define name="asciimath">
|
|
1928
|
+
<a:documentation>Encoding of AsciiMath</a:documentation>
|
|
1929
|
+
<element name="asciimath">
|
|
1930
|
+
<text/>
|
|
1931
|
+
</element>
|
|
1932
|
+
</define>
|
|
1933
|
+
<define name="mathml">
|
|
1934
|
+
<a:documentation>Encoding of MathML: the official W3C MathML 3.0 grammar (namespace
|
|
1935
|
+
http://www.w3.org/1998/Math/MathML), via the metanorma wrapper in
|
|
1936
|
+
grammars/mathml/. See grammars/mathml/README.adoc and basicdoc-models#35.</a:documentation>
|
|
1937
|
+
<externalRef href="metanorma-mathml.rng"/>
|
|
1938
|
+
</define>
|
|
1914
1939
|
<define name="StemAttributes">
|
|
1915
1940
|
<attribute name="type">
|
|
1916
1941
|
<a:documentation>The notation used to mathematically format the text</a:documentation>
|
|
@@ -852,7 +852,7 @@ titlecase, or lowercase</a:documentation>
|
|
|
852
852
|
<a:documentation>Width of the figure block in rendering</a:documentation>
|
|
853
853
|
</attribute>
|
|
854
854
|
</optional>
|
|
855
|
-
<ref name="
|
|
855
|
+
<ref name="BlockAttributesCore"/>
|
|
856
856
|
</define>
|
|
857
857
|
<define name="SourceAttributes" combine="interleave">
|
|
858
858
|
<ref name="BlockAttributes"/>
|
|
@@ -1283,7 +1283,11 @@ That concept may be defined as a term within the current document, or it may be
|
|
|
1283
1283
|
<a:documentation>Class of input form</a:documentation>
|
|
1284
1284
|
</attribute>
|
|
1285
1285
|
</optional>
|
|
1286
|
-
<ref name="
|
|
1286
|
+
<ref name="BlockAttributesCore">
|
|
1287
|
+
<a:documentation>form declares its own class above, so it uses BlockAttributesCore to
|
|
1288
|
+
avoid duplicating the custom-class slot in BlockAttributes. Treated like
|
|
1289
|
+
figure. See metanorma/metanorma-standoc#1197</a:documentation>
|
|
1290
|
+
</ref>
|
|
1287
1291
|
<zeroOrMore>
|
|
1288
1292
|
<!-- Input form contents -->
|
|
1289
1293
|
<choice>
|
|
@@ -2768,7 +2772,11 @@ links within an SVG file, so that the SVG file can hyperlink to anchors within t
|
|
|
2768
2772
|
</oneOrMore>
|
|
2769
2773
|
</element>
|
|
2770
2774
|
</define>
|
|
2771
|
-
<define name="
|
|
2775
|
+
<define name="BlockAttributesCore">
|
|
2776
|
+
<a:documentation>Block attributes excluding the custom CSS class. Blocks that already carry
|
|
2777
|
+
their own `class` attribute (e.g. figure, via basicdoc FigureAttributes)
|
|
2778
|
+
include this directly, to avoid a duplicate-attribute collision with the
|
|
2779
|
+
`class` added in BlockAttributes. See metanorma/metanorma-standoc#1197</a:documentation>
|
|
2772
2780
|
<optional>
|
|
2773
2781
|
<attribute name="keep-with-next">
|
|
2774
2782
|
<a:documentation>Keep this block on the same page as the following block in paged media</a:documentation>
|
|
@@ -2800,6 +2808,17 @@ to span across both columns</a:documentation>
|
|
|
2800
2808
|
</attribute>
|
|
2801
2809
|
</optional>
|
|
2802
2810
|
</define>
|
|
2811
|
+
<define name="BlockAttributes">
|
|
2812
|
+
<a:documentation>Universal block attributes, including a custom CSS class (space-separated,
|
|
2813
|
+
appended additively to the block's built-in HTML class, HTML output only).
|
|
2814
|
+
See metanorma/metanorma-standoc#1197</a:documentation>
|
|
2815
|
+
<ref name="BlockAttributesCore"/>
|
|
2816
|
+
<optional>
|
|
2817
|
+
<attribute name="class">
|
|
2818
|
+
<a:documentation>Custom CSS class(es) for the block in HTML output</a:documentation>
|
|
2819
|
+
</attribute>
|
|
2820
|
+
</optional>
|
|
2821
|
+
</define>
|
|
2803
2822
|
<define name="DisplayDirective">
|
|
2804
2823
|
<a:documentation>Directive on how to render a block in Presentation XML </a:documentation>
|
|
2805
2824
|
<optional>
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!--
|
|
3
|
+
This is the Mathematical Markup Language (MathML) 3.0, an XML
|
|
4
|
+
application for describing mathematical notation and capturing
|
|
5
|
+
both its structure and content.
|
|
6
|
+
|
|
7
|
+
Copyright 1998-2014 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
|
+
<start>
|
|
15
|
+
<ref name="math"/>
|
|
16
|
+
</start>
|
|
17
|
+
<define name="math">
|
|
18
|
+
<element name="math">
|
|
19
|
+
<ref name="math.attributes"/>
|
|
20
|
+
<zeroOrMore>
|
|
21
|
+
<ref name="MathExpression"/>
|
|
22
|
+
</zeroOrMore>
|
|
23
|
+
</element>
|
|
24
|
+
</define>
|
|
25
|
+
<define name="MathExpression">
|
|
26
|
+
<ref name="semantics"/>
|
|
27
|
+
</define>
|
|
28
|
+
<define name="NonMathMLAtt">
|
|
29
|
+
<attribute>
|
|
30
|
+
<anyName>
|
|
31
|
+
<except>
|
|
32
|
+
<nsName ns=""/>
|
|
33
|
+
<nsName/>
|
|
34
|
+
</except>
|
|
35
|
+
</anyName>
|
|
36
|
+
<data type="string"/>
|
|
37
|
+
</attribute>
|
|
38
|
+
</define>
|
|
39
|
+
<define name="CommonDeprecatedAtt">
|
|
40
|
+
<optional>
|
|
41
|
+
<attribute name="other"/>
|
|
42
|
+
</optional>
|
|
43
|
+
</define>
|
|
44
|
+
<define name="CommonAtt">
|
|
45
|
+
<optional>
|
|
46
|
+
<attribute name="id">
|
|
47
|
+
<data type="ID"/>
|
|
48
|
+
</attribute>
|
|
49
|
+
</optional>
|
|
50
|
+
<optional>
|
|
51
|
+
<attribute name="xref"/>
|
|
52
|
+
</optional>
|
|
53
|
+
<optional>
|
|
54
|
+
<attribute name="class">
|
|
55
|
+
<data type="NMTOKENS"/>
|
|
56
|
+
</attribute>
|
|
57
|
+
</optional>
|
|
58
|
+
<optional>
|
|
59
|
+
<attribute name="style">
|
|
60
|
+
<data type="string"/>
|
|
61
|
+
</attribute>
|
|
62
|
+
</optional>
|
|
63
|
+
<optional>
|
|
64
|
+
<attribute name="href">
|
|
65
|
+
<data type="anyURI"/>
|
|
66
|
+
</attribute>
|
|
67
|
+
</optional>
|
|
68
|
+
<ref name="CommonDeprecatedAtt"/>
|
|
69
|
+
<zeroOrMore>
|
|
70
|
+
<ref name="NonMathMLAtt"/>
|
|
71
|
+
</zeroOrMore>
|
|
72
|
+
</define>
|
|
73
|
+
<define name="math.attributes">
|
|
74
|
+
<ref name="CommonAtt"/>
|
|
75
|
+
<optional>
|
|
76
|
+
<attribute name="display">
|
|
77
|
+
<choice>
|
|
78
|
+
<value>block</value>
|
|
79
|
+
<value>inline</value>
|
|
80
|
+
</choice>
|
|
81
|
+
</attribute>
|
|
82
|
+
</optional>
|
|
83
|
+
<optional>
|
|
84
|
+
<attribute name="maxwidth">
|
|
85
|
+
<ref name="length"/>
|
|
86
|
+
</attribute>
|
|
87
|
+
</optional>
|
|
88
|
+
<optional>
|
|
89
|
+
<attribute name="overflow">
|
|
90
|
+
<choice>
|
|
91
|
+
<value>linebreak</value>
|
|
92
|
+
<value>scroll</value>
|
|
93
|
+
<value>elide</value>
|
|
94
|
+
<value>truncate</value>
|
|
95
|
+
<value>scale</value>
|
|
96
|
+
</choice>
|
|
97
|
+
</attribute>
|
|
98
|
+
</optional>
|
|
99
|
+
<optional>
|
|
100
|
+
<attribute name="altimg">
|
|
101
|
+
<data type="anyURI"/>
|
|
102
|
+
</attribute>
|
|
103
|
+
</optional>
|
|
104
|
+
<optional>
|
|
105
|
+
<attribute name="altimg-width">
|
|
106
|
+
<ref name="length"/>
|
|
107
|
+
</attribute>
|
|
108
|
+
</optional>
|
|
109
|
+
<optional>
|
|
110
|
+
<attribute name="altimg-height">
|
|
111
|
+
<ref name="length"/>
|
|
112
|
+
</attribute>
|
|
113
|
+
</optional>
|
|
114
|
+
<optional>
|
|
115
|
+
<attribute name="altimg-valign">
|
|
116
|
+
<choice>
|
|
117
|
+
<ref name="length"/>
|
|
118
|
+
<value>top</value>
|
|
119
|
+
<value>middle</value>
|
|
120
|
+
<value>bottom</value>
|
|
121
|
+
</choice>
|
|
122
|
+
</attribute>
|
|
123
|
+
</optional>
|
|
124
|
+
<optional>
|
|
125
|
+
<attribute name="alttext"/>
|
|
126
|
+
</optional>
|
|
127
|
+
<optional>
|
|
128
|
+
<attribute name="cdgroup">
|
|
129
|
+
<data type="anyURI"/>
|
|
130
|
+
</attribute>
|
|
131
|
+
</optional>
|
|
132
|
+
<ref name="math.deprecatedattributes"/>
|
|
133
|
+
</define>
|
|
134
|
+
<!--
|
|
135
|
+
the mathml3-presentation schema adds additional attributes
|
|
136
|
+
to the math element, all those valid on mstyle
|
|
137
|
+
-->
|
|
138
|
+
<define name="math.deprecatedattributes">
|
|
139
|
+
<optional>
|
|
140
|
+
<attribute name="mode">
|
|
141
|
+
<data type="string"/>
|
|
142
|
+
</attribute>
|
|
143
|
+
</optional>
|
|
144
|
+
<optional>
|
|
145
|
+
<attribute name="macros">
|
|
146
|
+
<data type="string"/>
|
|
147
|
+
</attribute>
|
|
148
|
+
</optional>
|
|
149
|
+
</define>
|
|
150
|
+
<define name="name">
|
|
151
|
+
<attribute name="name">
|
|
152
|
+
<data type="NCName"/>
|
|
153
|
+
</attribute>
|
|
154
|
+
</define>
|
|
155
|
+
<define name="cd">
|
|
156
|
+
<attribute name="cd">
|
|
157
|
+
<data type="NCName"/>
|
|
158
|
+
</attribute>
|
|
159
|
+
</define>
|
|
160
|
+
<define name="src">
|
|
161
|
+
<optional>
|
|
162
|
+
<attribute name="src">
|
|
163
|
+
<data type="anyURI"/>
|
|
164
|
+
</attribute>
|
|
165
|
+
</optional>
|
|
166
|
+
</define>
|
|
167
|
+
<define name="annotation">
|
|
168
|
+
<element name="annotation">
|
|
169
|
+
<ref name="annotation.attributes"/>
|
|
170
|
+
<text/>
|
|
171
|
+
</element>
|
|
172
|
+
</define>
|
|
173
|
+
<define name="annotation-xml.model">
|
|
174
|
+
<zeroOrMore>
|
|
175
|
+
<choice>
|
|
176
|
+
<ref name="MathExpression"/>
|
|
177
|
+
<ref name="anyElement"/>
|
|
178
|
+
</choice>
|
|
179
|
+
</zeroOrMore>
|
|
180
|
+
</define>
|
|
181
|
+
<define name="anyElement">
|
|
182
|
+
<element>
|
|
183
|
+
<anyName>
|
|
184
|
+
<except>
|
|
185
|
+
<nsName/>
|
|
186
|
+
</except>
|
|
187
|
+
</anyName>
|
|
188
|
+
<zeroOrMore>
|
|
189
|
+
<choice>
|
|
190
|
+
<attribute>
|
|
191
|
+
<anyName/>
|
|
192
|
+
</attribute>
|
|
193
|
+
<text/>
|
|
194
|
+
<ref name="anyElement"/>
|
|
195
|
+
</choice>
|
|
196
|
+
</zeroOrMore>
|
|
197
|
+
</element>
|
|
198
|
+
</define>
|
|
199
|
+
<define name="annotation-xml">
|
|
200
|
+
<element name="annotation-xml">
|
|
201
|
+
<ref name="annotation.attributes"/>
|
|
202
|
+
<ref name="annotation-xml.model"/>
|
|
203
|
+
</element>
|
|
204
|
+
</define>
|
|
205
|
+
<define name="annotation.attributes">
|
|
206
|
+
<ref name="CommonAtt"/>
|
|
207
|
+
<optional>
|
|
208
|
+
<ref name="cd"/>
|
|
209
|
+
</optional>
|
|
210
|
+
<optional>
|
|
211
|
+
<ref name="name"/>
|
|
212
|
+
</optional>
|
|
213
|
+
<ref name="DefEncAtt"/>
|
|
214
|
+
<optional>
|
|
215
|
+
<ref name="src"/>
|
|
216
|
+
</optional>
|
|
217
|
+
</define>
|
|
218
|
+
<define name="DefEncAtt">
|
|
219
|
+
<optional>
|
|
220
|
+
<attribute name="encoding">
|
|
221
|
+
<data type="string"/>
|
|
222
|
+
</attribute>
|
|
223
|
+
</optional>
|
|
224
|
+
<optional>
|
|
225
|
+
<attribute name="definitionURL">
|
|
226
|
+
<data type="anyURI"/>
|
|
227
|
+
</attribute>
|
|
228
|
+
</optional>
|
|
229
|
+
</define>
|
|
230
|
+
<define name="semantics">
|
|
231
|
+
<element name="semantics">
|
|
232
|
+
<ref name="semantics.attributes"/>
|
|
233
|
+
<ref name="MathExpression"/>
|
|
234
|
+
<zeroOrMore>
|
|
235
|
+
<choice>
|
|
236
|
+
<ref name="annotation"/>
|
|
237
|
+
<ref name="annotation-xml"/>
|
|
238
|
+
</choice>
|
|
239
|
+
</zeroOrMore>
|
|
240
|
+
</element>
|
|
241
|
+
</define>
|
|
242
|
+
<define name="semantics.attributes">
|
|
243
|
+
<ref name="CommonAtt"/>
|
|
244
|
+
<ref name="DefEncAtt"/>
|
|
245
|
+
<optional>
|
|
246
|
+
<ref name="cd"/>
|
|
247
|
+
</optional>
|
|
248
|
+
<optional>
|
|
249
|
+
<ref name="name"/>
|
|
250
|
+
</optional>
|
|
251
|
+
</define>
|
|
252
|
+
<define name="length">
|
|
253
|
+
<data type="string">
|
|
254
|
+
<param name="pattern">\s*((-?[0-9]*([0-9]\.?|\.[0-9])[0-9]*(e[mx]|in|cm|mm|p[xtc]|%)?)|(negative)?((very){0,2}thi(n|ck)|medium)mathspace)\s*</param>
|
|
255
|
+
</data>
|
|
256
|
+
</define>
|
|
257
|
+
</grammar>
|