Skip to content

Commit

Permalink
Merge pull request music-encoding#1555 from musicEnfanthen/feature/fi…
Browse files Browse the repository at this point in the history
…x_versions

schema: remove defaultVal from meiversion attributes
  • Loading branch information
bwbohl authored Dec 20, 2024
2 parents 18ce61c + e58e710 commit aa67d99
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 18 deletions.
3 changes: 2 additions & 1 deletion customizations/mei-CMN.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@
<classSpec ident="att.meiVersion" module="MEI.shared" type="atts" mode="change">
<attList>
<attDef ident="meiversion" usage="rec" mode="change">
<defaultVal>5.1-dev+CMN</defaultVal>
<valList type="closed" mode="change">
<valItem ident="5.1-dev"/>
<valItem ident="5.1-dev+CMN"/>
<valItem ident="5.1-dev+anyStart" mode="delete"/>
<valItem ident="5.1-dev+basic" mode="delete"/>
<valItem ident="5.1-dev+Mensural" mode="delete"/>
Expand Down
3 changes: 2 additions & 1 deletion customizations/mei-Mensural.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@
<classSpec ident="att.meiVersion" module="MEI.shared" type="atts" mode="change">
<attList>
<attDef ident="meiversion" usage="rec" mode="change">
<defaultVal>5.1-dev+Mensural</defaultVal>
<valList type="closed" mode="change">
<valItem ident="5.1-dev"/>
<valItem ident="5.1-dev+Mensural"/>
<valItem ident="5.1-dev+anyStart" mode="delete"/>
<valItem ident="5.1-dev+basic" mode="delete"/>
<valItem ident="5.1-dev+CMN" mode="delete"/>
Expand Down
3 changes: 2 additions & 1 deletion customizations/mei-Neumes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@
<classSpec ident="att.meiVersion" module="MEI.shared" type="atts" mode="change">
<attList>
<attDef ident="meiversion" usage="rec" mode="change">
<defaultVal>5.1-dev+Neumes</defaultVal>
<valList type="closed" mode="change">
<valItem ident="5.1-dev"/>
<valItem ident="5.1-dev+Neumes"/>
<valItem ident="5.1-dev+anyStart" mode="delete"/>
<valItem ident="5.1-dev+basic" mode="delete"/>
<valItem ident="5.1-dev+CMN" mode="delete"/>
Expand Down
3 changes: 2 additions & 1 deletion customizations/mei-all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@
<classSpec ident="att.meiVersion" module="MEI.shared" type="atts" mode="change">
<attList>
<attDef ident="meiversion" usage="rec" mode="change">
<defaultVal>5.1-dev</defaultVal>

<valList type="closed" mode="change">
<valItem ident="5.1-dev"/>
<valItem ident="5.1-dev+anyStart" mode="delete"/>
<valItem ident="5.1-dev+basic" mode="delete"/>
<valItem ident="5.1-dev+CMN" mode="delete"/>
Expand Down
30 changes: 27 additions & 3 deletions customizations/mei-all_anyStart.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<resp>Authored by</resp>
<name xml:id="PR">Perry Roland</name>
<name xml:id="bwb">Benjamin W. Bohl</name>
<name xml:id="stm">Stefan Münnich</name>
</respStmt>
</titleStmt>
<publicationStmt>
Expand All @@ -43,6 +44,14 @@
</sourceDesc>
</fileDesc>
<revisionDesc>
<change n="3" when="2024-11-27" who="#bwb #stm">
<desc>
<list>
<item>rephrasing errors of schematron rules associated with @meiversion</item>
<item>changing context of schematron rule 'tempo_in_header_disallow_most_attrs' to tempo if it is not root element</item>
</list>
</desc>
</change>
<change n="2" when="2021-11-05" who="#bwb">
<desc>
<list>
Expand Down Expand Up @@ -155,21 +164,23 @@
<constraintSpec ident="meiVersion.root" scheme="schematron">
<desc>Require meiversion attribute on the root element.</desc>
<constraint>
<sch:rule context="root()">
<sch:assert test="/mei:*[@meiversion]">The root element must have the @meiversion attribute in order to indicate the MEI version of the snippet.</sch:assert>
<sch:rule context="/mei:*">
<sch:assert test="@meiversion">The document root element must have the @meiversion attribute in order to indicate the MEI version in use.</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
<constraintSpec ident="meiVersion.warning.anyStart" scheme="schematron" mode="add">
<constraint>
<sch:rule context="/mei:*">
<sch:report role="error" test="not(local-name(.) = ('mei', 'meiHead', 'meiCorpus', 'music')) and not(@meiversion = '5.1-dev+anyStart')">If the root element is any other than mei, meiHead, meiCorpus, or music the value of @meiversion must be '5.1-dev+anyStart'.</sch:report>
<sch:report role="error" test="not(local-name(.) = ('mei', 'meiHead', 'meiCorpus', 'music')) and not(@meiversion = '5.1-dev+anyStart')">If the document root element is any other than mei, meiHead, meiCorpus, or music the value of @meiversion must be '5.1-dev+anyStart'.</sch:report>
</sch:rule>
</constraint>
</constraintSpec>
<attList>
<attDef ident="meiversion" usage="rec" mode="change">
<valList type="closed" mode="change">
<valItem ident="5.1-dev"/>
<valItem ident="5.1-dev+anyStart"/>
<valItem ident="5.1-dev+basic" mode="delete"/>
<valItem ident="5.1-dev+CMN" mode="delete"/>
<valItem ident="5.1-dev+Mensural" mode="delete"/>
Expand Down Expand Up @@ -210,6 +221,19 @@
<memberOf key="att.metadataPointing"/>
</classes>
</elementSpec>

<elementSpec ident="tempo" module="MEI.shared" mode="change">
<constraintSpec ident="tempo_in_header_disallow_most_attrs" scheme="schematron" mode="change">
<constraint>
<sch:rule context="/*//mei:tempo[not(ancestor::mei:score or ancestor::mei:part)]">
<sch:assert
test="not(@*[name() != 'analog' and name() != 'class' and name() != 'label' and name() != 'mm' and name() != 'mm.dots' and name() != 'translit' and name() != 'type' and name() != 'mm.unit' and name() != 'n' and name() != 'xml:base' and name() != 'xml:id' and name() != 'xml:lang'])"
>Only analog, class, label, mm, mm.dots, mm.unit, n, translit, type, xml:base, xml:id,
and xml:lang attributes are allowed when tempo is not the document root element or a descendant of a score or part.</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
</elementSpec>

</schemaSpec>
</body>
Expand Down
2 changes: 2 additions & 0 deletions customizations/mei-basic.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,8 @@
<attList>
<attDef ident="meiversion" usage="req" mode="change">
<valList type="closed" mode="change">
<valItem ident="5.1-dev"/>
<valItem ident="5.1-dev+basic"/>
<valItem ident="5.1-dev+anyStart" mode="delete"/>
<valItem ident="5.1-dev+CMN" mode="delete"/>
<valItem ident="5.1-dev+Mensural" mode="delete"/>
Expand Down
2 changes: 1 addition & 1 deletion source/mei-source.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
</respStmt>
</titleStmt>
<editionStmt>
<edition>Development Version</edition>
<edition>MEI 5.1-dev</edition>
</editionStmt>
<publicationStmt>
<distributor>Music Encoding Initiative (MEI) Board</distributor>
Expand Down
21 changes: 14 additions & 7 deletions source/modules/MEI.shared.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1898,28 +1898,35 @@
</classSpec>
<classSpec ident="att.meiVersion" module="MEI.shared" type="atts">
<desc xml:lang="en">Attributes that record the version of MEI in use.</desc>
<constraintSpec ident="meiVersion.onlyRoot" scheme="schematron">
<desc>Prohibit meiversion attribute on non root elements.</desc>
<constraint>
<sch:rule context="/mei:*//*">
<sch:report test="@meiversion">The @meiversion attribute is not allowed on elements that are not the document root element.</sch:report>
</sch:rule>
</constraint>
</constraintSpec>
<attList>
<attDef ident="meiversion" usage="opt">
<desc xml:lang="en">Specifies a generic MEI version label.</desc>
<defaultVal>5.1-dev</defaultVal>
<valList type="closed">
<valItem ident="5.1-dev">
<desc xml:lang="en">Development version</desc>
<desc xml:lang="en">Version of MEI</desc>
</valItem>
<valItem ident="5.1-dev+anyStart">
<desc>Development version</desc>
<desc>Version of MEI all_anyStart customization</desc>
</valItem>
<valItem ident="5.1-dev+basic">
<desc>Development version</desc>
<desc>Version of MEI basic customization</desc>
</valItem>
<valItem ident="5.1-dev+CMN">
<desc>Development version</desc>
<desc>Version of MEI cmn customization</desc>
</valItem>
<valItem ident="5.1-dev+Mensural">
<desc>Development version</desc>
<desc>Version of MEI mensural customization</desc>
</valItem>
<valItem ident="5.1-dev+Neumes">
<desc>Development version</desc>
<desc>Version of MEI neumes customization</desc>
</valItem>
</valList>
</attDef>
Expand Down
4 changes: 2 additions & 2 deletions utils/compare_versions/comparison.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<xsl:output method="html" indent="yes"/>

<xsl:variable name="new.file" select="//tei:back" as="node()"/>
<xsl:variable name="new.version" select="//tei:attDef[@ident='meiversion']//tei:defaultVal" as="xs:string"/>
<xsl:variable name="new.version" select="tokenize(//tei:edition, ' ')[last()]" as="xs:string"/>
<xsl:variable name="new.version.major" as="xs:string*">
<xsl:choose>
<xsl:when test="tokenize($new.version, '-')[2] = 'dev'">
Expand All @@ -31,7 +31,7 @@

<xsl:param name="old.version.filename" select="''" as="xs:string"/>
<xsl:variable name="old.file" select="doc($old.version.filename)//tei:back" as="node()"/>
<xsl:variable name="old.version" select="doc($old.version.filename)//tei:attDef[@ident='meiversion']//tei:defaultVal" as="xs:string"/>
<xsl:variable name="old.version" select="tokenize(doc($old.version.filename)//tei:edition, ' ')[last()]" as="xs:string"/>
<xsl:variable name="old.version.major" select="concat('v',tokenize($old.version, '\.')[1])" as="xs:string"/>

<xsl:variable name="html.guidelines" select="'https://music-encoding.org/guidelines/'"/>
Expand Down
2 changes: 1 addition & 1 deletion utils/guidelines_xslt/odd2html.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<xd:p>The version of the Guidelines</xd:p>
</xd:desc>
</xd:doc>
<xsl:param name="version" select="//tei:classSpec[@ident = ('att.meiversion','att.meiVersion')]//tei:defaultVal/text()" as="xs:string"/>
<xsl:param name="version" select="tokenize(//tei:edition, ' ')[last()]" as="xs:string"/>

<xd:doc>
<xd:desc>
Expand Down

0 comments on commit aa67d99

Please sign in to comment.