bartneck / swiML

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

validation error for simplified repetition #76

Closed bartneck closed 3 months ago

bartneck commented 4 months ago

A validation error occurs when a simplified repetition includes a continue. This might be due to the fact that the <instruction> inside the <continue> are not of the same <length> as required by the <simplify>true<simplify> element. An example can be found in this file:

JasiMasters2024021301.xml

The error message is:

Assertion evaluation (' ((./sw:simplify = true()) and (every $length in .//sw:length satisfies $length/*[1] = (.//sw:length)[1]/*[1])) or ./sw:simplify = false() or count(./sw:simplify) = 0') for element 'repetition' on schema type 'repetitionType' did not succeed.

bartneck commented 4 months ago

The latest update sort of works, but it still has issues. First, it should be 3x200 and not 6x100 since the 2x100 are a continue. The file is JasiMasters2024022001.html. There is also the number 1 missing in the continue. It should be 1 D Any Any and 1 Any.

SCR-20240222-nasw
bartneck commented 4 months ago

When I compile with 2.0 the total length is incorrect. It is not 4000m

SCR-20240226-qmzo
bartneck commented 4 months ago

When I compile with 2.1, the total length is still wrong, but also the lengths are missing.

SCR-20240226-qncr
bartneck commented 4 months ago

When I try to compile the JasiMasters2024025001.py file, I get the error:

Exception: Cannot simplify continue with repetitions of different lengths
calloc262 commented 4 months ago

just a note for JasiMasters2024022001.html 4000m is the correct total length as the 3x200 set is denoted as 3 x 3 x 200 as its still a repetition and you would be repeating 3 200s 3 times, if you wanted just the one set then you should leave the repetition count empty or not include it

bartneck commented 4 months ago

<RepetitionCount> is a required element for a repetition in the XSD schema. If I set <simplify> to true I get the correct total distance calculation (2800), but the repetition is shown as 6x100, not 3x200 as it should be. Have a look at the JPEG. It shows what was intended. 3x200 in which each 200 is broken into 2x100 (continue). How can this be modelled?

calloc262 commented 3 months ago

this issue should be fixed in the python not 100% sure about the xsd but it was working when last checked

bartneck commented 3 months ago

tested and okay. Great job!