data.STAFFREL

Location of musical material relative to a staff.
Module
Used by
Constraints

The @staff attribute must contain 2 numerically-adjacent integer values.
Staves and are not adjacent.

Declaration
<dataSpec xmlns="http://www.tei-c.org/ns/1.0" rend="add" ident="data.STAFFREL" module="MEI">
<desc xml:lang="en">Location of musical material relative to a staff.</desc>
<content>
<alternate minOccurs="1" maxOccurs="1">
<dataRef key="data.STAFFREL.basic"/>
<dataRef key="data.STAFFREL.extended"/>
</alternate>
</content>
<constraintSpec ident="between_requires_adjacent_staves" scheme="schematron">
<constraint>
<sch:rule context="mei:*[@place eq 'between']">
<sch:assert test="count(tokenize(normalize-space(string(@staff)), '\s+')) = 2">The @staff attribute must contain 2 numerically-adjacent integer values.</sch:assert>
<sch:let name="tokenizedStaff" value="tokenize(normalize-space(string(@staff)), '\s+')"/>
<sch:let name="maxValue" value="max((number($tokenizedStaff[1]), number($tokenizedStaff[2])))"/>
<sch:let name="minValue" value="min((number($tokenizedStaff[1]), number($tokenizedStaff[2])))"/>
<sch:assert test="$maxValue - $minValue = 1">Staves
<sch:value-of select="$minValue"/>
and
<sch:value-of select="$maxValue"/>
are not adjacent.</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
</dataSpec>