bartneck / swiML

A project to formalise swimming programs using XML
MIT License
2 stars 2 forks source link

instruction in repetition invalid #71

Closed bartneck closed 5 months ago

bartneck commented 5 months ago

The following example give and error in validation. This is visible in jasiMasaters2024012101.xml

<!-- not valid -->
<instruction>
    <repetition>
        <repetitionCount>4</repetitionCount>
        <stroke><standardStroke>freestyle</standardStroke></stroke>
        <equipment>fins</equipment>
        <instruction>
            <length>
                <lengthAsDistance>100</lengthAsDistance>
            </length>
            <stroke>
                <drill>
                    <drillName>123</drillName>
                    <drillStroke>freestyle</drillStroke>
                </drill>
            </stroke>
        </instruction>
    </repetition>
</instruction>

<!-- valid -->
<instruction>
    <length>
        <lengthAsDistance>100</lengthAsDistance>
    </length>
    <stroke>
        <drill>
            <drillName>123</drillName>
            <drillStroke>freestyle</drillStroke>
        </drill>
    </stroke>
</instruction>
calloc262 commented 5 months ago

This error occurred because the 100 in the repetition has two different strokes defined, which we decided wasn't going to be allowed. It's from the assertion related to this comment you sent in an email the other day

\<!-- to do: cross check that only one stroke is defined. —>

bartneck commented 5 months ago

I see your point. I was caught out by thinking that drill is not a stroke.