bartneck / swiml Goto Github PK
View Code? Open in Web Editor NEWA project to formalise swimming programs using XML
License: MIT License
A project to formalise swimming programs using XML
License: MIT License
Currently the training program index for a club needs to be created manually. This can be automated by checking all xml files in a directory and creating a new index XML file which in turn can be converted to HTML using XSLT.
It would be possible to move the elements of into the , element. Instead of writing.
In the folder bookExamples, the file repetitionBlockInstructions.xml has valid and invalid test cases.
rewriting the length tag to be inside the instruction group and to have an enclosing length tag
We have to find a way to merge the changes back into the main branch.
We have to find a solution for publishing different versions of the same swiML.xsd schema. The old XML files still need to validate against the v1.0 while new XML files should validate against our upcoming 2.0 version. Do we need a different file with a new file name or is this handled inside the XML with the version tag?
When converting XML to HTML, the <title></title>
remains empty. It should be filled with the <title>
element form the XML.
Create different CSS files depending on output (A4, 11cm for book, Screen). Have an XML element to set the desired output type.
Create a Python package that enables developers to generate valid swiML code.
The <segmentName>
element can currently occur within any <repetition>
or <instruction>
. This makes no sense. It should only be allowed at the top level, right under the first element. In the folder bookExamples, the file segmentName.xml has valid and invalid test cases.
Adding functionality so that any element in the instruction group can be added to containers such that any instructions within the container have the ability to inherit the instruction elements
The <intensity><dynamicAcross>true</dynamicAcross></intensity>
only makes sense within a <repetition>
element. You proposed a new model of <intensity>
that is split between <repetition>
and <instruction>
.
We need an assertion that intensity is always uniquely defined. We have to avoid that there is intensity in the repetition element and in the nested instruction element.
change "o" namespace to "sw" and change the URL to github as before.
At this point there is no direct way to produce a PDF from the XML files using XSLT. The only option right now is to translate the XML to HTML and then use a web browser to create the PDF manually. Alternatively, the XSL-FO language or Oxygen’s PDF Chemistry can be used to directly generate a PDF file.
We have to sort out the proper name space approach to overcome the issues that Callum is having with his branch.
The program needs to adjust to individual speeds. Fast swimmers need to swim more within one hour while slower swimmers less. This should be based on best times, which then creates 70% etc.
The swiML schema currently has no means to express a continue
swimming block. The coach might write 300 FR KDS which is 100 FR Kick, 100 FR Drill, 100 FR Swim. Right now this would be expressed by setting the rest period for these three instructions to zero. We need a dedicated <continue>
XML element for this purpose. This would be similar to how a <repetition>
is currently setup. There will be more blocks like this in the future, such as <pyramid>
. In the folder bookExamples, the file continue.xml has valid and invalid test cases.
The length of the <continue>
block needs to be calculated through XSLT. Neither the coach nor Python should do this calculation. We need to avoid the coaches entering invalid information.
The <continue>
block should have a summary on the left in the HTML/CSS. This summary can be either the sum of the length of the included <instructions>
or a <numberOfContinueInstructions>
. The later is not a good name and we still need to find a better name. It is currently called <simplify>
which is too generic.
when laps is selected as unit and instruction is given in distance then it is unclear if it is meters or yards
At times the intend of repetition and continue are too far apart. This causes layout options. The solution would be:
Write XSLT to convert XML to Garmin's FIT format.
assert that id in club index is unique
The book in which the PDF files will be embedded is exactly 11 cm wide. It would be great to be able to consistently scale all swiML PDF output to fit into a maximum of 11 cm widths. The title and author are currently centered and they should be centered to a specific value, such as 11cm. The display of the current HTML output can be scaled by the browser. Hence the resulting PDF could have smaller or bigger text. This is undesirable. All text should be consistent in size.
Create a list of the programs from the Viking club using the swimTraining.xsd
If a repetition has, for example, pads, then pads cannot occur in any of the descendants. An assertion would be necessary. The same holds true for any other element, such as rest, stroke, intensity...
Setup a project at PyPi to enable others to use the package
Move old version (prior to Callum editing) to version 1 and all new files to version 2 folder.
When transforming XML to HTML, the link to the CSS file is set to ../swiML.css
. This is a relative path which will not work for XML files that are deeper inside a folder structure. This should link to an absolute path on github, such as https://raw.githubusercontent.com/bartneck/swiML/main/swiML.css.
a lot of the xsl got left out of the updates done already
gonna add it all to this instead of trying to redo every issues with separate xslt updates
Change all the URLs to the XML schema for old jasi master programs.
The current XML schema allows the repetition of equipment. Swimmers are allowed to swim with pads with pads. A XPath assertion is necessary to ensure that each piece of equipment can only be used once per <instruction>
.
Some strokes, such as IM Overlap and IM Order only make sense within a <repetition>
. Modify swiML.xsd with an assertion that validates that all such strokes only occur within a repetition. In the folder bookExamples, the file strokeRepetition.xml has valid and invalid test cases.
find a way to express any numbers as roman numeral
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>
The swiML logo on the HTML page does not scale with the rest of the text. Its size should be determined by en or em. This will make it relative to the overall text size which is the basis for all other size units used.
Use XSLT to convert the XML to plain text that can be copied into Strava and other apps that do not handle the structure of swimming programs.
The <continueType>
should not have a <totalLength>
in it. The length should be calculated in XSLT when generating the HTML/PDF. Please remove this element. If we were to have such an element, it should be called something more specific, such as <continueLength>
Please do also update <continue>
documentation. It still refers to a pyramid: <xs:documentation>
Instruction process element to swim a pyramid.</xs:documentation>
For the purpose of data analysis it would be desirable to flatten out all instructions. All repetitions and other structural elements should be converted to a plain list of instructions. The resulting XML file should be have a plain table structure that can be easily imported into statistical programs. In addition, a conversation to a CSV file would be desired.
The individualMedley, individualMedleyOrder and individualMedleyOverlap will make this a bit difficult.
create CSS for pyramid
Repetitions can be subdivided. A 10 x 100 can be divided into the first five freestyle and the second five backstroke. Any number of subdivisions are possible.
the box is not 11cm wide.
The question is if a repetition is just a continue with a rest. If so, we could possibly simplify the whole schema.
a drill could be known by different names.
Adding breath to an instruction inside a repetition causes a validation error. jasiMasters2024011201.xml
<!-- not valid -->
<instruction>
<repetition>
<repetitionCount>4</repetitionCount>
<simplify>true</simplify>
<equipment>fins</equipment>
<instruction>
<length>
<lengthAsDistance>100</lengthAsDistance>
</length>
<stroke>
<standardStroke>freestyle</standardStroke>
</stroke>
<breath>5</breath>
</instruction>
</repetition>
</instruction>
<!-- valid -->
<instruction>
<length>
<lengthAsDistance>100</lengthAsDistance>
</length>
<stroke><standardStroke>freestyle</standardStroke></stroke>
<breath>5</breath>
</instruction>
Write XSLT to convert XML to Garmin's TCX format.
breath cand be as every 5 or 5 times per lap. It can also be expressed as bilateral.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.