Skip to content

Commit

Permalink
added @Dur assert for @stem.sameas
Browse files Browse the repository at this point in the history
- notes that are linked through stem.sameas should have equal @Dur values
- updated testing file
  • Loading branch information
frakel authored and kepper committed Oct 29, 2020
1 parent 9279cab commit e05e14e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions source/modules/MEI.shared.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3126,12 +3126,16 @@
<constraint>
<sch:rule context="@stem.sameas">
<sch:let name="layer.n" value="self::node()/ancestor::mei:layer/@n"/>
<sch:let name="ref.id" value="substring(.,2)"/>
<sch:assert role="warning" test="not(normalize-space(.) eq '')">@stem.sameas attribute
should have content.</sch:assert>
<sch:assert role="warning"
test="substring(.,2)=//mei:note[not(ancestor::mei:layer/@n=$layer.n)]/@xml:id">The value in @stem.sameas should
correspond to the @xml:id attribute of the linked note
element of a different layer.</sch:assert>
<sch:assert role="warning"
test="../@dur=//mei:note[@xml:id=$ref.id]/@dur">The linked notes by @stem.sameas should have the same @dur values.
</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
Expand Down
4 changes: 2 additions & 2 deletions tests/mei-CMN/stem-sameas-testing.mei
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<note dur="4" oct="5" pname="c" xml:id="l1n4"/>
</layer>
<layer n="2">
<note dur="4" oct="4" pname="c" stem.sameas="#l1n2" xml:id="l2n1"/>
<note dur="4" oct="4" pname="c" stem.sameas="#l1n1" xml:id="l2n1"/>
<note dur="4" oct="4" pname="c" stem.sameas="#l1n2" xml:id="l2n2"/>
<note dur="4" oct="4" pname="c" stem.sameas="#l1n2" xml:id="l2n3"/>
<note dur="4" oct="4" pname="c" stem.sameas="#l1n3" xml:id="l2n3"/>
<note dur="4" oct="4" pname="c" stem.sameas="#l1n4" xml:id="l2n4"/>
</layer>
</staff>
Expand Down

0 comments on commit e05e14e

Please sign in to comment.