every $inst in .//sw:instruction satisfies
( ($inst/ancestor-or-self::*/sw:stroke
and $inst/ancestor-or-self::*/sw:length) or $inst/sw:repetition
or $inst/sw:continue or $inst/sw:pyramid
or $inst/sw:segmentName)
checks every instruction has stroke, rest and length defined any other element in an instruction doesnt have to be defined
Source
<xs:element name="program"><!-- ====================================================== --><!-- The meta information for each program --><!-- ====================================================== --><xs:complexType><xs:sequence><!-- The title of the program --><xs:element name="title" type="titleString" minOccurs="0" maxOccurs="1"><xs:annotation><xs:documentation>A short title of the program.</xs:documentation></xs:annotation></xs:element><!-- The author(s) of the program --><xs:element maxOccurs="unbounded" minOccurs="0" name="author"><xs:annotation><xs:documentation>Each program can have one or more authors.</xs:documentation></xs:annotation><xs:complexType><xs:sequence><xs:element name="firstName" minOccurs="1" type="xs:string"><xs:annotation><xs:documentation>The first name of the author. Can contain middle names if necessary.</xs:documentation></xs:annotation></xs:element><xs:element name="lastName" minOccurs="1" type="xs:string"><xs:annotation><xs:documentation>The last name of the author.</xs:documentation></xs:annotation></xs:element><xs:element minOccurs="0" name="email" type="emailAddress"><xs:annotation><xs:documentation>The email address of the author (optional).</xs:documentation></xs:annotation></xs:element></xs:sequence></xs:complexType></xs:element><!-- The description of the program --><xs:element name="programDescription" type="descriptionString" minOccurs="0" maxOccurs="1"><xs:annotation><xs:documentation>A short description for the program.</xs:documentation></xs:annotation></xs:element><!-- The date --><xs:element minOccurs="0" name="creationDate" type="xs:date" maxOccurs="1" default="2022-02-22"><xs:annotation><xs:documentation>The date on which the program was created.</xs:documentation></xs:annotation></xs:element><xs:element name="poolLength" minOccurs="1" maxOccurs="1" type="xs:nonNegativeInteger" default="25"><xs:annotation><xs:documentation>The length of pool</xs:documentation></xs:annotation></xs:element><xs:element name="lengthUnit" minOccurs="1" maxOccurs="1" type="lengthUnits" default="meters"><xs:annotation><xs:documentation>The length of pool requires a measurement unit.</xs:documentation></xs:annotation></xs:element><xs:element name="programAlign" minOccurs="0" maxOccurs="1" type="xs:boolean"><xs:annotation><xs:documentation>When set to False all elements in the program will not align</xs:documentation></xs:annotation></xs:element><xs:element name="numeralSystem" minOccurs="0" maxOccurs="1" type="numeralSystems"><xs:annotation><xs:documentation>Can set to different numeral systems to display</xs:documentation></xs:annotation></xs:element><!-- Element to hide the intro text --><xs:element name="hideIntro" minOccurs="0" maxOccurs="1" type="xs:boolean"><xs:annotation><xs:documentation>True if intro should be hidden in output.</xs:documentation></xs:annotation></xs:element><!-- Element to set the width of the program in HTML --><!-- The unit is characters. 50ch are 11cm wide --><xs:element name="layoutWidth" minOccurs="0" maxOccurs="1" type="xs:nonNegativeInteger" default="50"><xs:annotation><xs:documentation>The width of the program on the HTML page. The unit is characters. 50ch are 11cm wide.</xs:documentation></xs:annotation></xs:element><!-- ====================================================== --><!-- The main element(s) for each program. Each instruction can contain instructions. This is recursion. --><!-- This is the main recursive element for a program --><!-- ====================================================== --><xs:element name="instruction" type="instructionType" minOccurs="1" maxOccurs="unbounded"><xs:annotation><xs:documentation>The basic elements for programs. Each instruction defines what to swim.</xs:documentation></xs:annotation><xs:unique name="mainEquipmentUnique"><xs:annotation><xs:documentation>Ensures all equipment values in an instruction are unique</xs:documentation></xs:annotation><xs:selector xpath="./sw:equipment"/><xs:field xpath="."/></xs:unique></xs:element></xs:sequence><xs:assert test=" every $inst in .//sw:instruction satisfies ( ($inst/ancestor-or-self::*/sw:stroke and $inst/ancestor-or-self::*/sw:length) or $inst/sw:repetition or $inst/sw:continue or $inst/sw:pyramid or $inst/sw:segmentName) "><xs:annotation><xs:documentation>checks every instruction has stroke, rest and length defined any other element in an instruction doesnt have to be defined</xs:documentation></xs:annotation></xs:assert></xs:complexType></xs:element>
<xs:element name="title" type="titleString" minOccurs="0" maxOccurs="1"><xs:annotation><xs:documentation>A short title of the program.</xs:documentation></xs:annotation></xs:element>
<xs:element maxOccurs="unbounded" minOccurs="0" name="author"><xs:annotation><xs:documentation>Each program can have one or more authors.</xs:documentation></xs:annotation><xs:complexType><xs:sequence><xs:element name="firstName" minOccurs="1" type="xs:string"><xs:annotation><xs:documentation>The first name of the author. Can contain middle names if necessary.</xs:documentation></xs:annotation></xs:element><xs:element name="lastName" minOccurs="1" type="xs:string"><xs:annotation><xs:documentation>The last name of the author.</xs:documentation></xs:annotation></xs:element><xs:element minOccurs="0" name="email" type="emailAddress"><xs:annotation><xs:documentation>The email address of the author (optional).</xs:documentation></xs:annotation></xs:element></xs:sequence></xs:complexType></xs:element>
The first name of the author. Can containmiddle names if necessary.
Diagram
Type
xs:string
Properties
content
simple
minOccurs
1
Source
<xs:element name="firstName" minOccurs="1" type="xs:string"><xs:annotation><xs:documentation>The first name of the author. Can contain middle names if necessary.</xs:documentation></xs:annotation></xs:element>
<xs:element name="lastName" minOccurs="1" type="xs:string"><xs:annotation><xs:documentation>The last name of the author.</xs:documentation></xs:annotation></xs:element>
<xs:element minOccurs="0" name="email" type="emailAddress"><xs:annotation><xs:documentation>The email address of the author (optional).</xs:documentation></xs:annotation></xs:element>
<xs:element name="programDescription" type="descriptionString" minOccurs="0" maxOccurs="1"><xs:annotation><xs:documentation>A short description for the program.</xs:documentation></xs:annotation></xs:element>
<xs:element minOccurs="0" name="creationDate" type="xs:date" maxOccurs="1" default="2022-02-22"><xs:annotation><xs:documentation>The date on which the program was created.</xs:documentation></xs:annotation></xs:element>
<xs:element name="lengthUnit" minOccurs="1" maxOccurs="1" type="lengthUnits" default="meters"><xs:annotation><xs:documentation>The length of pool requires a measurement unit.</xs:documentation></xs:annotation></xs:element>
When set to False all elements in the program will not align
Diagram
Type
xs:boolean
Properties
content
simple
minOccurs
0
maxOccurs
1
Source
<xs:element name="programAlign" minOccurs="0" maxOccurs="1" type="xs:boolean"><xs:annotation><xs:documentation>When set to False all elements in the program will not align</xs:documentation></xs:annotation></xs:element>
<xs:element name="numeralSystem" minOccurs="0" maxOccurs="1" type="numeralSystems"><xs:annotation><xs:documentation>Can set to different numeral systems to display</xs:documentation></xs:annotation></xs:element>
<xs:element name="hideIntro" minOccurs="0" maxOccurs="1" type="xs:boolean"><xs:annotation><xs:documentation>True if intro should be hidden in output.</xs:documentation></xs:annotation></xs:element>
The width of the program on the HTML page. The unit is characters. 50ch are 11cm wide.
Diagram
Type
xs:nonNegativeInteger
Properties
content
simple
minOccurs
0
maxOccurs
1
default
50
Source
<xs:element name="layoutWidth" minOccurs="0" maxOccurs="1" type="xs:nonNegativeInteger" default="50"><xs:annotation><xs:documentation>The width of the program on the HTML page. The unit is characters. 50ch are 11cm wide.</xs:documentation></xs:annotation></xs:element>
(./ancestor-or-self::*/sw:stroke and ./ancestor-or-self::*/sw:length)
or ./sw:repetition or ./sw:continue or ./sw:pyramid
or ./sw:segmentName
checks every instruction has stroke, rest and length defined any other element in an instruction doesnt have to be defined
if (not(./sw:repetition or ./sw:continue
or ./sw:pyramid or ./sw:segmentName)) then
( every $element in ./* satisfies (
every $match in ./ancestor::*[name() = 'instruction' or name() = 'repetition' or name()
= 'continue' or name() = 'pyramid'][not(./sw:repetition or ./sw:continue or ./sw:pyramid
or ./sw:segmentName)]/*[name() = 'length' or name() = 'stroke' or name() = 'rest'
or name() = 'intensity' or name() = 'breath' or name() = 'underwater']
satisfies not(name($element) = name($match))
)) else (true())
returns false if any instruction has a repeating element, e.g two different defined lengths
if (not(./sw:repetition or ./sw:continue
or ./sw:pyramid or ./sw:segmentName)) then
( every $element in ./*[name() = 'equipment']
satisfies ( every $match in ./ancestor::*[name() = 'instruction'
or name() = 'repetition' or name() = 'continue' or name() = 'pyramid'][not(./sw:repetition
or ./sw:continue or ./sw:pyramid or ./sw:segmentName)]/*[name() = 'equipment']
satisfies not($element/text() = $match/text())
)) else (true())
returns false if any instruction has a repeating equipment, e.g two seperate equipment elements both containing fins
if (count(./sw:segmentName) > 0) then
(count(./sw:segmentName/../../ancestor::*) = 0) else
(true())
returns false if any segmentName element is not at the top level e.g. it is nested within a repetition
every $stroke in ./sw:stroke satisfies
if ($stroke/sw:standardStroke = 'individualMedleyOverlap' or $stroke/sw:standardStroke
= 'individualMedleyOrder' or $stroke/sw:standardStroke = 'reverseIndividualMedleyOrder'
or $stroke/sw:kicking/sw:standardKick = 'individualMedleyOverlap' or $stroke/sw:kicking/sw:standardKick
= 'individualMedleyOrder' or $stroke/sw:kicking/sw:standardKick = 'reverseIndividualMedleyOrder'
or$stroke/sw:drill/sw:drillStroke = 'individualMedleyOverlap' or $stroke/sw:drill/sw:drillStroke
= 'individualMedleyOrder' or $stroke/sw:drill/sw:drillStroke = 'reverseIndividualMedleyOrder')
then ($stroke/ancestor::*/sw:repetition)
or ($stroke/ancestor::*/sw:continue/sw:continueLength)
else ($stroke/parent::*)
checks all strokes to make sure medley order or overlaps are onlyused in a repetition
Identity constraints
QName
Type
Refer
Selector
Field(s)
mainEquipmentUnique
unique
./sw:equipment
.
Source
<xs:element name="instruction" type="instructionType" minOccurs="1" maxOccurs="unbounded"><xs:annotation><xs:documentation>The basic elements for programs. Each instruction defines what to swim.</xs:documentation></xs:annotation><xs:unique name="mainEquipmentUnique"><xs:annotation><xs:documentation>Ensures all equipment values in an instruction are unique</xs:documentation></xs:annotation><xs:selector xpath="./sw:equipment"/><xs:field xpath="."/></xs:unique></xs:element>
if(./sw:simplify = true())then( (
every $instruction in ./sw:instruction[not(./sw:pyramid or ./sw:segmentName)] satisfies(
(if($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)]) then(
if(count($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)]) = 1) then(
number( ($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length
| ancestor-or-self::*/sw:length)[last()]/sw:lengthAsDistance
) ) else( sum(
($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length
| ancestor-or-self::*/sw:length)[last()]/sw:lengthAsDistance
) ) ) else(
0 )+( if($instruction/descendant-or-self::sw:continueLength)
then( number($instruction/descendant-or-self::sw:continueLength)
) else( 0 )
)) = number( ( (
(./descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length
| ancestor-or-self::*/sw:length)[last()]/sw:lengthAsDistance
) | ( ./descendant-or-self::sw:continueLength
) )[1] ) )
)or( every $instruction in ./sw:instruction[not(./sw:pyramid or
./sw:segmentName)] satisfies( (if($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)]) then(
if(count($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)]) = 1) then(
number( ($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length
| ancestor-or-self::*/sw:length)[last()]/sw:lengthAsLaps
) ) else( sum(
($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length
| ancestor-or-self::*/sw:length)[last()]/sw:lengthAsLaps
) ) ) else(
0 )+( if($instruction/descendant-or-self::sw:continueLength)
then( number(
$instruction/descendant-or-self::sw:continueLength
) ) else( 0
) )) = number( (
( (./descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length
| ancestor-or-self::*/sw:length)[last()]/sw:lengthAsLaps
) | ( ./descendant-or-self::sw:continueLength
) )[1] ) )
) )else( true() )
checks all lengths within simplified repetition are the sameDoes this by using two seperate statments so that either all lengthAsDistances are the same or all lengthAsLapschecks that every instruction, repetition and continue has the same base length e.g. 100m , 4x100m and 50,50 swim as 100 ; these are all of length 100 so can be simplified in the same repetitionhas to choose whether to use continueLength or add up all instructions within a continue
./sw:simplify[text() = 'true'] or ./sw:repetitionCount and not(./sw:simplify[text()
= 'true'] and ./sw:repetitionCount)
Source
<xs:element name="repetition" type="repetitionType"><xs:annotation><xs:documentation>Instruction process element to repeat enclosed instructions.</xs:documentation></xs:annotation></xs:element>
true -> repetition tag is simplifying a larger set ofrepetitions false -> normal repetition
Diagram
Type
xs:boolean
Properties
content
simple
minOccurs
0
maxOccurs
1
Source
<xs:element name="simplify" minOccurs="0" maxOccurs="1" type="xs:boolean"><xs:annotation><xs:documentation>true -> repetition tag is simplifying a larger set of repetitions false -> normal repetition</xs:documentation></xs:annotation></xs:element>
<xs:element name="repetitionDescription" minOccurs="0" maxOccurs="1" type="instructionDescriptionType"><xs:annotation><xs:documentation>Additional information for the repetition. This can be used to customise the repetition.</xs:documentation></xs:annotation></xs:element>
<xs:element name="length" minOccurs="0" maxOccurs="1" type="lengthType"><xs:annotation><xs:documentation>The length of the instruction.</xs:documentation></xs:annotation></xs:element>
<xs:element name="lengthAsDistance" type="xs:nonNegativeInteger"><xs:annotation><xs:documentation>Length of instruction as distance.</xs:documentation></xs:annotation></xs:element>
Duration starts with PT followed by int M and int S. Forexample PT1M30S for 1:30.
Diagram
Type
xs:duration
Properties
content
simple
Source
<xs:element name="lengthAsTime" type="xs:duration"><xs:annotation><xs:documentation>Duration starts with PT followed by int M and int S. For example PT1M30S for 1:30.</xs:documentation></xs:annotation></xs:element>
<xs:element name="lengthAsLaps" type="xs:nonNegativeInteger"><xs:annotation><xs:documentation>Length of instruction in number of laps.</xs:documentation></xs:annotation></xs:element>
<xs:element name="stroke" minOccurs="0" maxOccurs="1" type="strokeType"><xs:annotation><xs:documentation>The stroke to swim. This includes basic strokes, kicking and drills.</xs:documentation></xs:annotation></xs:element>
<xs:element name="orientation" type="orientationType" minOccurs="0" maxOccurs="1"><xs:annotation><xs:documentation>The orientation of the swimmers body.</xs:documentation></xs:annotation></xs:element>
<xs:element name="legMovement" type="legMovementType" minOccurs="1" maxOccurs="1"><xs:annotation><xs:documentation>The style of the leg movements.</xs:documentation></xs:annotation></xs:element>
<xs:element name="drillStroke" type="standardStrokeType" maxOccurs="1" minOccurs="1"><xs:annotation><xs:documentation>Drills are based on stroke types. For example, the drill 123 can be swum with freestyle or backstroke.</xs:documentation></xs:annotation></xs:element>
<xs:element name="rest" minOccurs="0" maxOccurs="1" type="restType"><xs:annotation><xs:documentation>The rest period after the instruction.</xs:documentation></xs:annotation></xs:element>
Duration of rest after stopping a swimming instruction.Example: 20 seconds means that the swimmer will rest for 20 seconds afterstopping the current instructions.
Diagram
Type
xs:duration
Properties
content
simple
Source
<xs:element name="afterStop" type="xs:duration"><xs:annotation><xs:documentation>Duration of rest after stopping a swimming instruction. Example: 20 seconds means that the swimmer will rest for 20 seconds after stopping the current instructions.</xs:documentation></xs:annotation></xs:element>
The interval on which swimming instructions start. Example: on1:30 means that the next instructions starts after 1:30 from starting thecurrent instruction.
Diagram
Type
xs:duration
Properties
content
simple
Source
<xs:element name="sinceStart" type="xs:duration"><xs:annotation><xs:documentation>The interval on which swimming instructions start. Example: on 1:30 means that the next instructions starts after 1:30 from starting the current instruction.</xs:documentation></xs:annotation></xs:element>
The time since the end of the last rest. This is useful whenseveral instructions without a rest period are swum, followed by a sincestart type rest.
Diagram
Type
xs:duration
Properties
content
simple
Source
<xs:element name="sinceLastRest" type="xs:duration"><xs:annotation><xs:documentation>The time since the end of the last rest. This is useful when several instructions without a rest period are swum, followed by a since start type rest.</xs:documentation></xs:annotation></xs:element>
Number of swimmers arriving. Example: 3rd in: Once the 3rdswimmer in the lane arrives, the 1st swimmer starts.
Diagram
Type
xs:nonNegativeInteger
Properties
content
simple
Source
<xs:element name="inOut" type="xs:nonNegativeInteger"><xs:annotation><xs:documentation>Number of swimmers arriving. Example: 3rd in: Once the 3rd swimmer in the lane arrives, the 1st swimmer starts.</xs:documentation></xs:annotation></xs:element>
<xs:element name="intensity" minOccurs="0" maxOccurs="1" type="intensityProfile"><xs:annotation><xs:documentation>The intensity at which to swim the instruction.</xs:documentation></xs:annotation></xs:element>
<xs:element name="percentageEffort" type="percentType"><xs:annotation><xs:documentation>Effort in percentage. Example: 100 means maximum effort.</xs:documentation></xs:annotation></xs:element>
<xs:element name="percentageHeartRate" type="percentType"><xs:annotation><xs:documentation>Heart rate in percentage of maximum heart rate.</xs:documentation></xs:annotation></xs:element>
<xs:element name="breath" minOccurs="0" maxOccurs="1" type="xs:nonNegativeInteger"><xs:annotation><xs:documentation>Number of arm strokes per breath.</xs:documentation></xs:annotation></xs:element>
<xs:element name="underwater" minOccurs="0" maxOccurs="1" type="xs:boolean"><xs:annotation><xs:documentation>True if swimming under water.</xs:documentation></xs:annotation></xs:element>
<xs:element name="equipment" minOccurs="0" maxOccurs="unbounded" type="equipmentType"><xs:annotation><xs:documentation>Equipment to be used, such as board or pads.</xs:documentation></xs:annotation></xs:element>
<xs:element name="instructionDescription" type="instructionDescriptionType" minOccurs="0" maxOccurs="1"><xs:annotation><xs:documentation>Short description to modify the instrution.</xs:documentation></xs:annotation></xs:element>
(./ancestor-or-self::*/sw:stroke and ./ancestor-or-self::*/sw:length)
or ./sw:repetition or ./sw:continue or ./sw:pyramid
or ./sw:segmentName
checks every instruction has stroke, rest and length defined any other element in an instruction doesnt have to be defined
if (not(./sw:repetition or ./sw:continue
or ./sw:pyramid or ./sw:segmentName)) then
( every $element in ./* satisfies (
every $match in ./ancestor::*[name() = 'instruction' or name() = 'repetition' or name()
= 'continue' or name() = 'pyramid'][not(./sw:repetition or ./sw:continue or ./sw:pyramid
or ./sw:segmentName)]/*[name() = 'length' or name() = 'stroke' or name() = 'rest'
or name() = 'intensity' or name() = 'breath' or name() = 'underwater']
satisfies not(name($element) = name($match))
)) else (true())
returns false if any instruction has a repeating element, e.g two different defined lengths
if (not(./sw:repetition or ./sw:continue
or ./sw:pyramid or ./sw:segmentName)) then
( every $element in ./*[name() = 'equipment']
satisfies ( every $match in ./ancestor::*[name() = 'instruction'
or name() = 'repetition' or name() = 'continue' or name() = 'pyramid'][not(./sw:repetition
or ./sw:continue or ./sw:pyramid or ./sw:segmentName)]/*[name() = 'equipment']
satisfies not($element/text() = $match/text())
)) else (true())
returns false if any instruction has a repeating equipment, e.g two seperate equipment elements both containing fins
if (count(./sw:segmentName) > 0) then
(count(./sw:segmentName/../../ancestor::*) = 0) else
(true())
returns false if any segmentName element is not at the top level e.g. it is nested within a repetition
every $stroke in ./sw:stroke satisfies
if ($stroke/sw:standardStroke = 'individualMedleyOverlap' or $stroke/sw:standardStroke
= 'individualMedleyOrder' or $stroke/sw:standardStroke = 'reverseIndividualMedleyOrder'
or $stroke/sw:kicking/sw:standardKick = 'individualMedleyOverlap' or $stroke/sw:kicking/sw:standardKick
= 'individualMedleyOrder' or $stroke/sw:kicking/sw:standardKick = 'reverseIndividualMedleyOrder'
or$stroke/sw:drill/sw:drillStroke = 'individualMedleyOverlap' or $stroke/sw:drill/sw:drillStroke
= 'individualMedleyOrder' or $stroke/sw:drill/sw:drillStroke = 'reverseIndividualMedleyOrder')
then ($stroke/ancestor::*/sw:repetition)
or ($stroke/ancestor::*/sw:continue/sw:continueLength)
else ($stroke/parent::*)
checks all strokes to make sure medley order or overlaps are onlyused in a repetition
Identity constraints
QName
Type
Refer
Selector
Field(s)
repEquipmentUnique
unique
./sw:equipment
.
Source
<xs:element name="instruction" minOccurs="1" maxOccurs="unbounded" type="instructionType"><xs:annotation><xs:documentation>A repetition can include any number of instructions, which in turn can contain repetitions or continues.</xs:documentation></xs:annotation><xs:unique name="repEquipmentUnique"><xs:annotation><xs:documentation>Ensures all equipment values in an instruction are unique</xs:documentation></xs:annotation><xs:selector xpath="./sw:equipment"/><xs:field xpath="."/></xs:unique></xs:element>
(./sw:startLength/sw:lengthAsDistance and ./sw:stopLength/sw:lengthAsDistance)
or (./sw:startLength/sw:lengthAsLaps and ./sw:stopLength/sw:lengthAsLaps)
or (./sw:startLength/sw:lengthAsTime and ./sw:stopLength/sw:lengthAsTime)
Source
<xs:element name="pyramid" type="pyramidType"><xs:annotation><xs:documentation>Instruction process element to swim a pyramid.</xs:documentation></xs:annotation></xs:element>
<xs:element name="startLength" minOccurs="1" maxOccurs="1" type="lengthType"><xs:annotation><xs:documentation>The start length of the pyramid.</xs:documentation></xs:annotation></xs:element>
<xs:element name="stopLength" minOccurs="1" maxOccurs="1" type="lengthType"><xs:annotation><xs:documentation>The stop length of the pyramid. This is the highest point of the pyramid.</xs:documentation></xs:annotation></xs:element>
The increment at which the pyramid increases. This defines theslope.
Diagram
Type
xs:nonNegativeInteger
Properties
content
simple
minOccurs
1
maxOccurs
1
Source
<xs:element name="increment" minOccurs="1" maxOccurs="1" type="xs:nonNegativeInteger"><xs:annotation><xs:documentation>The increment at which the pyramid increases. This defines the slope.</xs:documentation></xs:annotation></xs:element>
ensures no rest tags occur within the instructions of a continueonly at top level
Source
<xs:element name="continue" type="continueType"><xs:annotation><xs:documentation>Instruction process element to denote a continuosly swum block of instructions.</xs:documentation></xs:annotation></xs:element>
total length to swim continuously or total number ofrepetitions May or may not be defined but if not it will automaticallycalculated from given instructions
<xs:element name="continueLength" minOccurs="0" maxOccurs="1" type="lengthType"><xs:annotation><xs:documentation>total length to swim continuously or total number of repetitions May or may not be defined but if not it will automatically calculated from given instructions</xs:documentation></xs:annotation></xs:element>
(./ancestor-or-self::*/sw:stroke and ./ancestor-or-self::*/sw:length)
or ./sw:repetition or ./sw:continue or ./sw:pyramid
or ./sw:segmentName
checks every instruction has stroke, rest and length defined any other element in an instruction doesnt have to be defined
if (not(./sw:repetition or ./sw:continue
or ./sw:pyramid or ./sw:segmentName)) then
( every $element in ./* satisfies (
every $match in ./ancestor::*[name() = 'instruction' or name() = 'repetition' or name()
= 'continue' or name() = 'pyramid'][not(./sw:repetition or ./sw:continue or ./sw:pyramid
or ./sw:segmentName)]/*[name() = 'length' or name() = 'stroke' or name() = 'rest'
or name() = 'intensity' or name() = 'breath' or name() = 'underwater']
satisfies not(name($element) = name($match))
)) else (true())
returns false if any instruction has a repeating element, e.g two different defined lengths
if (not(./sw:repetition or ./sw:continue
or ./sw:pyramid or ./sw:segmentName)) then
( every $element in ./*[name() = 'equipment']
satisfies ( every $match in ./ancestor::*[name() = 'instruction'
or name() = 'repetition' or name() = 'continue' or name() = 'pyramid'][not(./sw:repetition
or ./sw:continue or ./sw:pyramid or ./sw:segmentName)]/*[name() = 'equipment']
satisfies not($element/text() = $match/text())
)) else (true())
returns false if any instruction has a repeating equipment, e.g two seperate equipment elements both containing fins
if (count(./sw:segmentName) > 0) then
(count(./sw:segmentName/../../ancestor::*) = 0) else
(true())
returns false if any segmentName element is not at the top level e.g. it is nested within a repetition
every $stroke in ./sw:stroke satisfies
if ($stroke/sw:standardStroke = 'individualMedleyOverlap' or $stroke/sw:standardStroke
= 'individualMedleyOrder' or $stroke/sw:standardStroke = 'reverseIndividualMedleyOrder'
or $stroke/sw:kicking/sw:standardKick = 'individualMedleyOverlap' or $stroke/sw:kicking/sw:standardKick
= 'individualMedleyOrder' or $stroke/sw:kicking/sw:standardKick = 'reverseIndividualMedleyOrder'
or$stroke/sw:drill/sw:drillStroke = 'individualMedleyOverlap' or $stroke/sw:drill/sw:drillStroke
= 'individualMedleyOrder' or $stroke/sw:drill/sw:drillStroke = 'reverseIndividualMedleyOrder')
then ($stroke/ancestor::*/sw:repetition)
or ($stroke/ancestor::*/sw:continue/sw:continueLength)
else ($stroke/parent::*)
checks all strokes to make sure medley order or overlaps are onlyused in a repetition
Identity constraints
QName
Type
Refer
Selector
Field(s)
contEquipmentUnique
unique
./sw:equipment
.
Source
<xs:element name="instruction" minOccurs="1" maxOccurs="unbounded" type="instructionType"><xs:annotation><xs:documentation>A continue can include any number of instructions, which in turn can contain repetitions or any other complex instruction type.</xs:documentation></xs:annotation><xs:unique name="contEquipmentUnique"><xs:annotation><xs:documentation>Ensures all equipment values in an instruction are unique</xs:documentation></xs:annotation><xs:selector xpath="./sw:equipment"/><xs:field xpath="."/></xs:unique></xs:element>
<xs:simpleType name="titleString"><xs:annotation><xs:documentation>The length of the title is constraint in length.</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:maxLength value="60"/></xs:restriction></xs:simpleType>
<xs:simpleType name="descriptionString"><xs:annotation><xs:documentation>The length of the description text is constraint in length.</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:maxLength value="400"/></xs:restriction></xs:simpleType>
<xs:simpleType name="lengthUnits"><xs:annotation><xs:documentation>The unit of measurement for the length of the target pool (meter or yards).</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:enumeration value="meters"/><xs:enumeration value="kilometers"/><xs:enumeration value="miles"/><xs:enumeration value="yards"/></xs:restriction></xs:simpleType>
<xs:simpleType name="numeralSystems"><xs:annotation><xs:documentation>Numeral system type to be used for displaying the document</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:enumeration value="decimal"/><xs:enumeration value="roman"/></xs:restriction></xs:simpleType>
(./ancestor-or-self::*/sw:stroke and ./ancestor-or-self::*/sw:length)
or ./sw:repetition or ./sw:continue or ./sw:pyramid
or ./sw:segmentName
checks every instruction has stroke, rest and length defined any other element in an instruction doesnt have to be defined
if (not(./sw:repetition or ./sw:continue
or ./sw:pyramid or ./sw:segmentName)) then
( every $element in ./* satisfies (
every $match in ./ancestor::*[name() = 'instruction' or name() = 'repetition' or name()
= 'continue' or name() = 'pyramid'][not(./sw:repetition or ./sw:continue or ./sw:pyramid
or ./sw:segmentName)]/*[name() = 'length' or name() = 'stroke' or name() = 'rest'
or name() = 'intensity' or name() = 'breath' or name() = 'underwater']
satisfies not(name($element) = name($match))
)) else (true())
returns false if any instruction has a repeating element, e.g two different defined lengths
if (not(./sw:repetition or ./sw:continue
or ./sw:pyramid or ./sw:segmentName)) then
( every $element in ./*[name() = 'equipment']
satisfies ( every $match in ./ancestor::*[name() = 'instruction'
or name() = 'repetition' or name() = 'continue' or name() = 'pyramid'][not(./sw:repetition
or ./sw:continue or ./sw:pyramid or ./sw:segmentName)]/*[name() = 'equipment']
satisfies not($element/text() = $match/text())
)) else (true())
returns false if any instruction has a repeating equipment, e.g two seperate equipment elements both containing fins
if (count(./sw:segmentName) > 0) then
(count(./sw:segmentName/../../ancestor::*) = 0) else
(true())
returns false if any segmentName element is not at the top level e.g. it is nested within a repetition
every $stroke in ./sw:stroke satisfies
if ($stroke/sw:standardStroke = 'individualMedleyOverlap' or $stroke/sw:standardStroke
= 'individualMedleyOrder' or $stroke/sw:standardStroke = 'reverseIndividualMedleyOrder'
or $stroke/sw:kicking/sw:standardKick = 'individualMedleyOverlap' or $stroke/sw:kicking/sw:standardKick
= 'individualMedleyOrder' or $stroke/sw:kicking/sw:standardKick = 'reverseIndividualMedleyOrder'
or$stroke/sw:drill/sw:drillStroke = 'individualMedleyOverlap' or $stroke/sw:drill/sw:drillStroke
= 'individualMedleyOrder' or $stroke/sw:drill/sw:drillStroke = 'reverseIndividualMedleyOrder')
then ($stroke/ancestor::*/sw:repetition)
or ($stroke/ancestor::*/sw:continue/sw:continueLength)
else ($stroke/parent::*)
checks all strokes to make sure medley order or overlaps are onlyused in a repetition
Source
<xs:complexType name="instructionType" mixed="true"><xs:annotation><xs:documentation>An instruction can consists of process or a direct instruction on what to swim.</xs:documentation></xs:annotation><xs:sequence><xs:choice><xs:annotation><xs:documentation>The different types of instructions,</xs:documentation></xs:annotation><!-- ====================================================== --><!-- Process based elements for instructions --><xs:element name="segmentName" minOccurs="0" maxOccurs="1" type="segmentNameType"/><xs:element name="repetition" type="repetitionType"><xs:annotation><xs:documentation>Instruction process element to repeat enclosed instructions.</xs:documentation></xs:annotation></xs:element><xs:element name="pyramid" type="pyramidType"><xs:annotation><xs:documentation>Instruction process element to swim a pyramid.</xs:documentation></xs:annotation></xs:element><xs:element name="continue" type="continueType"><xs:annotation><xs:documentation>Instruction process element to denote a continuosly swum block of instructions.</xs:documentation></xs:annotation></xs:element><!-- ====================================================== --><!-- Direct instruction on what to swim --><xs:group ref="instructionGroup"/></xs:choice><xs:element name="excludeAlign" type="xs:boolean" minOccurs="0" maxOccurs="1"><xs:annotation><xs:documentation>If true xslt will exclude from alignment process</xs:documentation></xs:annotation></xs:element></xs:sequence><!-- checks every instruction has stroke, rest and length defined
any other element in an instruction doesnt have to be defined--><xs:assert test=" (./ancestor-or-self::*/sw:stroke and ./ancestor-or-self::*/sw:length) or ./sw:repetition or ./sw:continue or ./sw:pyramid or ./sw:segmentName "><xs:annotation><xs:documentation>checks every instruction has stroke, rest and length defined any other element in an instruction doesnt have to be defined</xs:documentation></xs:annotation></xs:assert><!-- checks every instruction doesnt have repetitions of elements defined and cannot be extended --><xs:assert test=" if (not(./sw:repetition or ./sw:continue or ./sw:pyramid or ./sw:segmentName)) then ( every $element in ./* satisfies ( every $match in ./ancestor::*[name() = 'instruction' or name() = 'repetition' or name() = 'continue' or name() = 'pyramid'][not(./sw:repetition or ./sw:continue or ./sw:pyramid or ./sw:segmentName)]/*[name() = 'length' or name() = 'stroke' or name() = 'rest' or name() = 'intensity' or name() = 'breath' or name() = 'underwater'] satisfies not(name($element) = name($match)) )) else (true()) "><xs:annotation><xs:documentation>returns false if any instruction has a repeating element, e.g two different defined lengths</xs:documentation></xs:annotation></xs:assert><xs:assert test=" if (not(./sw:repetition or ./sw:continue or ./sw:pyramid or ./sw:segmentName)) then ( every $element in ./*[name() = 'equipment'] satisfies ( every $match in ./ancestor::*[name() = 'instruction' or name() = 'repetition' or name() = 'continue' or name() = 'pyramid'][not(./sw:repetition or ./sw:continue or ./sw:pyramid or ./sw:segmentName)]/*[name() = 'equipment'] satisfies not($element/text() = $match/text()) )) else (true()) "><xs:annotation><xs:documentation>returns false if any instruction has a repeating equipment, e.g two seperate equipment elements both containing fins</xs:documentation></xs:annotation></xs:assert><xs:assert test=" if (count(./sw:segmentName) > 0) then (count(./sw:segmentName/../../ancestor::*) = 0) else (true()) "><xs:annotation><xs:documentation>returns false if any segmentName element is not at the top level e.g. it is nested within a repetition</xs:documentation></xs:annotation></xs:assert><!-- check if this is just for standard stroke or for kicks and drills too --><xs:assert test=" every $stroke in ./sw:stroke satisfies if ($stroke/sw:standardStroke = 'individualMedleyOverlap' or $stroke/sw:standardStroke = 'individualMedleyOrder' or $stroke/sw:standardStroke = 'reverseIndividualMedleyOrder' or $stroke/sw:kicking/sw:standardKick = 'individualMedleyOverlap' or $stroke/sw:kicking/sw:standardKick = 'individualMedleyOrder' or $stroke/sw:kicking/sw:standardKick = 'reverseIndividualMedleyOrder' or$stroke/sw:drill/sw:drillStroke = 'individualMedleyOverlap' or $stroke/sw:drill/sw:drillStroke = 'individualMedleyOrder' or $stroke/sw:drill/sw:drillStroke = 'reverseIndividualMedleyOrder') then ($stroke/ancestor::*/sw:repetition) or ($stroke/ancestor::*/sw:continue/sw:continueLength) else ($stroke/parent::*) "><xs:annotation><xs:documentation>checks all strokes to make sure medley order or overlaps are only used in a repetition</xs:documentation></xs:annotation></xs:assert></xs:complexType>
if(./sw:simplify = true())then( (
every $instruction in ./sw:instruction[not(./sw:pyramid or ./sw:segmentName)] satisfies(
(if($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)]) then(
if(count($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)]) = 1) then(
number( ($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length
| ancestor-or-self::*/sw:length)[last()]/sw:lengthAsDistance
) ) else( sum(
($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length
| ancestor-or-self::*/sw:length)[last()]/sw:lengthAsDistance
) ) ) else(
0 )+( if($instruction/descendant-or-self::sw:continueLength)
then( number($instruction/descendant-or-self::sw:continueLength)
) else( 0 )
)) = number( ( (
(./descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length
| ancestor-or-self::*/sw:length)[last()]/sw:lengthAsDistance
) | ( ./descendant-or-self::sw:continueLength
) )[1] ) )
)or( every $instruction in ./sw:instruction[not(./sw:pyramid or
./sw:segmentName)] satisfies( (if($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)]) then(
if(count($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)]) = 1) then(
number( ($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length
| ancestor-or-self::*/sw:length)[last()]/sw:lengthAsLaps
) ) else( sum(
($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length
| ancestor-or-self::*/sw:length)[last()]/sw:lengthAsLaps
) ) ) else(
0 )+( if($instruction/descendant-or-self::sw:continueLength)
then( number(
$instruction/descendant-or-self::sw:continueLength
) ) else( 0
) )) = number( (
( (./descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength)
and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length
| ancestor-or-self::*/sw:length)[last()]/sw:lengthAsLaps
) | ( ./descendant-or-self::sw:continueLength
) )[1] ) )
) )else( true() )
checks all lengths within simplified repetition are the sameDoes this by using two seperate statments so that either all lengthAsDistances are the same or all lengthAsLapschecks that every instruction, repetition and continue has the same base length e.g. 100m , 4x100m and 50,50 swim as 100 ; these are all of length 100 so can be simplified in the same repetitionhas to choose whether to use continueLength or add up all instructions within a continue
./sw:simplify[text() = 'true'] or ./sw:repetitionCount and not(./sw:simplify[text()
= 'true'] and ./sw:repetitionCount)
Source
<xs:complexType name="repetitionType"><xs:annotation><xs:documentation/></xs:annotation><xs:sequence><xs:element name="repetitionCount" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1"><xs:annotation><xs:documentation>Count of repetition.</xs:documentation></xs:annotation></xs:element><xs:element name="simplify" minOccurs="0" maxOccurs="1" type="xs:boolean"><xs:annotation><xs:documentation>true -> repetition tag is simplifying a larger set of repetitions false -> normal repetition</xs:documentation></xs:annotation></xs:element><xs:element name="repetitionDescription" minOccurs="0" maxOccurs="1" type="instructionDescriptionType"><xs:annotation><xs:documentation>Additional information for the repetition. This can be used to customise the repetition.</xs:documentation></xs:annotation></xs:element><!-- Common elements for instructions --><xs:group ref="instructionGroup"/><!-- This is the main recursion statement. Every repetition contains instructions. --><!-- Every instruction can contain a repetition --><xs:element name="instruction" minOccurs="1" maxOccurs="unbounded" type="instructionType"><xs:annotation><xs:documentation>A repetition can include any number of instructions, which in turn can contain repetitions or continues.</xs:documentation></xs:annotation><xs:unique name="repEquipmentUnique"><xs:annotation><xs:documentation>Ensures all equipment values in an instruction are unique</xs:documentation></xs:annotation><xs:selector xpath="./sw:equipment"/><xs:field xpath="."/></xs:unique></xs:element></xs:sequence><!-- ====================================================== --><!-- Assertions --><xs:assert test=" if(./sw:simplify = true())then( ( every $instruction in ./sw:instruction[not(./sw:pyramid or ./sw:segmentName)] satisfies( (if($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength) and not(./sw:continue/sw:continueLength) and not(./sw:repetition)]) then( if(count($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength) and not(./sw:continue/sw:continueLength) and not(./sw:repetition)]) = 1) then( number( ($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength) and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length | ancestor-or-self::*/sw:length)[last()]/sw:lengthAsDistance ) ) else( sum( ($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength) and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length | ancestor-or-self::*/sw:length)[last()]/sw:lengthAsDistance ) ) ) else( 0 )+( if($instruction/descendant-or-self::sw:continueLength) then( number($instruction/descendant-or-self::sw:continueLength) ) else( 0 ) )) = number( ( ( (./descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength) and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length | ancestor-or-self::*/sw:length)[last()]/sw:lengthAsDistance ) | ( ./descendant-or-self::sw:continueLength ) )[1] ) ) )or( every $instruction in ./sw:instruction[not(./sw:pyramid or ./sw:segmentName)] satisfies( (if($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength) and not(./sw:continue/sw:continueLength) and not(./sw:repetition)]) then( if(count($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength) and not(./sw:continue/sw:continueLength) and not(./sw:repetition)]) = 1) then( number( ($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength) and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length | ancestor-or-self::*/sw:length)[last()]/sw:lengthAsLaps ) ) else( sum( ($instruction/descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength) and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length | ancestor-or-self::*/sw:length)[last()]/sw:lengthAsLaps ) ) ) else( 0 )+( if($instruction/descendant-or-self::sw:continueLength) then( number( $instruction/descendant-or-self::sw:continueLength ) ) else( 0 ) )) = number( ( ( (./descendant-or-self::sw:instruction[not(ancestor::sw:continue/sw:continueLength) and not(./sw:continue/sw:continueLength) and not(./sw:repetition)][1])//(preceding-sibling::sw:length | ancestor-or-self::*/sw:length)[last()]/sw:lengthAsLaps ) | ( ./descendant-or-self::sw:continueLength ) )[1] ) ) ) )else( true() ) "><xs:annotation><xs:documentation>checks all lengths within simplified repetition are the same Does this by using two seperate statments so that either all lengthAsDistances are the same or all lengthAsLaps checks that every instruction, repetition and continue has the same base length e.g. 100m , 4x100m and 50,50 swim as 100 ; these are all of length 100 so can be simplified in the same repetition has to choose whether to use continueLength or add up all instructions within a continue</xs:documentation></xs:annotation></xs:assert><!-- Explain what this assertion does --><xs:assert test="./sw:simplify[text() = 'true'] or ./sw:repetitionCount and not(./sw:simplify[text() = 'true'] and ./sw:repetitionCount)"/></xs:complexType>
<xs:simpleType name="instructionDescriptionType"><xs:annotation><xs:documentation>The length of the description text is constraint in length.</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:maxLength value="100"/></xs:restriction></xs:simpleType>
<xs:complexType name="lengthType" mixed="true"><xs:annotation><xs:documentation>The length for a swimming instruction.</xs:documentation></xs:annotation><!-- Length as either distance, laps or time --><xs:choice><xs:annotation><xs:documentation>Length can be descriped as distance or time.</xs:documentation></xs:annotation><xs:element name="lengthAsDistance" type="xs:nonNegativeInteger"><xs:annotation><xs:documentation>Length of instruction as distance.</xs:documentation></xs:annotation></xs:element><xs:element name="lengthAsTime" type="xs:duration"><xs:annotation><xs:documentation>Duration starts with PT followed by int M and int S. For example PT1M30S for 1:30.</xs:documentation></xs:annotation></xs:element><xs:element name="lengthAsLaps" type="xs:nonNegativeInteger"><xs:annotation><xs:documentation>Length of instruction in number of laps.</xs:documentation></xs:annotation></xs:element></xs:choice></xs:complexType>
<xs:complexType name="kickStyle"><xs:choice><xs:sequence><xs:element name="orientation" type="orientationType" minOccurs="0" maxOccurs="1"><xs:annotation><xs:documentation>The orientation of the swimmers body.</xs:documentation></xs:annotation></xs:element><xs:element name="legMovement" type="legMovementType" minOccurs="1" maxOccurs="1"><xs:annotation><xs:documentation>The style of the leg movements.</xs:documentation></xs:annotation></xs:element></xs:sequence><xs:element name="standardKick" minOccurs="1" maxOccurs="1" type="standardStrokeType"/></xs:choice></xs:complexType>
<xs:complexType name="drillType"><xs:annotation><xs:documentation>Drill type consists of a drill name and a stroke. For example, this could mean 6 kick drill freestyle.</xs:documentation></xs:annotation><xs:sequence><xs:element name="drillName" minOccurs="0" maxOccurs="1" type="drillNameType"/><xs:element name="drillStroke" type="standardStrokeType" maxOccurs="1" minOccurs="1"><xs:annotation><xs:documentation>Drills are based on stroke types. For example, the drill 123 can be swum with freestyle or backstroke.</xs:documentation></xs:annotation></xs:element></xs:sequence></xs:complexType>
<xs:complexType name="restType" mixed="true"><xs:annotation><xs:documentation>The length units for a rest after a swimming instruction.</xs:documentation></xs:annotation><xs:choice><xs:element name="afterStop" type="xs:duration"><xs:annotation><xs:documentation>Duration of rest after stopping a swimming instruction. Example: 20 seconds means that the swimmer will rest for 20 seconds after stopping the current instructions.</xs:documentation></xs:annotation></xs:element><xs:element name="sinceStart" type="xs:duration"><xs:annotation><xs:documentation>The interval on which swimming instructions start. Example: on 1:30 means that the next instructions starts after 1:30 from starting the current instruction.</xs:documentation></xs:annotation></xs:element><xs:element name="sinceLastRest" type="xs:duration"><xs:annotation><xs:documentation>The time since the end of the last rest. This is useful when several instructions without a rest period are swum, followed by a since start type rest.</xs:documentation></xs:annotation></xs:element><xs:element name="inOut" type="xs:nonNegativeInteger"><xs:annotation><xs:documentation>Number of swimmers arriving. Example: 3rd in: Once the 3rd swimmer in the lane arrives, the 1st swimmer starts.</xs:documentation></xs:annotation></xs:element></xs:choice></xs:complexType>
The intensity of the instruction. When given at the lowest level juststart intensity indicates a constant intensity if the stop intensity is given thenit is a build within the instruction If the intensity is given at a higher level(repetition or continue) just start intensity is the same constant for all childinstructions given a stop intensity then it is descending/ascending over the childinstructions
<xs:complexType name="intensityProfile" mixed="true"><xs:annotation><xs:documentation>The intensity of the instruction. When given at the lowest level just start intensity indicates a constant intensity if the stop intensity is given then it is a build within the instruction If the intensity is given at a higher level (repetition or continue) just start intensity is the same constant for all child instructions given a stop intensity then it is descending/ascending over the child instructions</xs:documentation></xs:annotation><xs:sequence><xs:element name="startIntensity" minOccurs="1" maxOccurs="1" type="intensityType"/><xs:element name="stopIntensity" minOccurs="0" maxOccurs="1" type="intensityType"/></xs:sequence></xs:complexType>
<xs:complexType name="intensityType"><xs:annotation><xs:documentation>The intensity of the instructions.</xs:documentation></xs:annotation><xs:choice><xs:element name="percentageEffort" type="percentType"><xs:annotation><xs:documentation>Effort in percentage. Example: 100 means maximum effort.</xs:documentation></xs:annotation></xs:element><xs:element name="zone" type="zoneType"><xs:annotation><xs:documentation>Effort in training zone.</xs:documentation></xs:annotation></xs:element><xs:element name="percentageHeartRate" type="percentType"><xs:annotation><xs:documentation>Heart rate in percentage of maximum heart rate.</xs:documentation></xs:annotation></xs:element></xs:choice></xs:complexType>
<xs:simpleType name="percentType"><xs:annotation><xs:documentation>The percent type specifies a value from 0 to 100.</xs:documentation></xs:annotation><xs:restriction base="xs:decimal"><xs:minInclusive value="0"/><xs:maxInclusive value="100"/></xs:restriction></xs:simpleType>
(./sw:startLength/sw:lengthAsDistance and ./sw:stopLength/sw:lengthAsDistance)
or (./sw:startLength/sw:lengthAsLaps and ./sw:stopLength/sw:lengthAsLaps)
or (./sw:startLength/sw:lengthAsTime and ./sw:stopLength/sw:lengthAsTime)
Source
<xs:complexType name="pyramidType"><xs:annotation><xs:documentation>Pyramids start with short instructions (e.g. 50) and increase to their stop length (e.g. 200). They then decrease back to the start length.</xs:documentation></xs:annotation><xs:sequence><xs:element name="startLength" minOccurs="1" maxOccurs="1" type="lengthType"><xs:annotation><xs:documentation>The start length of the pyramid.</xs:documentation></xs:annotation></xs:element><xs:element name="stopLength" minOccurs="1" maxOccurs="1" type="lengthType"><xs:annotation><xs:documentation>The stop length of the pyramid. This is the highest point of the pyramid.</xs:documentation></xs:annotation></xs:element><xs:element name="increment" minOccurs="1" maxOccurs="1" type="xs:nonNegativeInteger"><xs:annotation><xs:documentation>The increment at which the pyramid increases. This defines the slope.</xs:documentation></xs:annotation></xs:element><xs:element name="incremenentLengthUnit" type="lengthUnits" minOccurs="0" maxOccurs="1"/><xs:element name="isPointy" minOccurs="1" maxOccurs="1" type="xs:boolean"><xs:annotation><xs:documentation>A pointy pyramid swims the stop length only once. A non-pointy pyramid swims the stop length twice.</xs:documentation></xs:annotation></xs:element><xs:group ref="instructionGroup"/></xs:sequence><xs:assert test=" (./sw:startLength/sw:lengthAsDistance and ./sw:stopLength/sw:lengthAsDistance) or (./sw:startLength/sw:lengthAsLaps and ./sw:stopLength/sw:lengthAsLaps) or (./sw:startLength/sw:lengthAsTime and ./sw:stopLength/sw:lengthAsTime) "/></xs:complexType>
ensures no rest tags occur within the instructions of a continueonly at top level
Source
<xs:complexType name="continueType"><xs:annotation><xs:documentation>Continues for when different strokes, equipment or styles need to be swum continuously</xs:documentation></xs:annotation><xs:sequence><xs:element name="continueLength" minOccurs="0" maxOccurs="1" type="lengthType"><xs:annotation><xs:documentation>total length to swim continuously or total number of repetitions May or may not be defined but if not it will automatically calculated from given instructions</xs:documentation></xs:annotation></xs:element><!-- Common elements for instructions --><xs:group ref="instructionGroup"/><xs:element name="instruction" minOccurs="1" maxOccurs="unbounded" type="instructionType"><xs:annotation><xs:documentation>A continue can include any number of instructions, which in turn can contain repetitions or any other complex instruction type.</xs:documentation></xs:annotation><xs:unique name="contEquipmentUnique"><xs:annotation><xs:documentation>Ensures all equipment values in an instruction are unique</xs:documentation></xs:annotation><xs:selector xpath="./sw:equipment"/><xs:field xpath="."/></xs:unique></xs:element></xs:sequence><!-- ====================================================== --><!-- Assertions --><!-- Explain what this assertion does --><xs:assert test="(count(.//sw:instruction/sw:rest) = 0)"><xs:annotation><xs:documentation>ensures no rest tags occur within the instructions of a continue only at top level</xs:documentation></xs:annotation></xs:assert></xs:complexType>
<xs:group name="instructionGroup"><xs:sequence><xs:annotation><xs:documentation>Sequence of basic elements for an instruction.</xs:documentation></xs:annotation><xs:element name="length" minOccurs="0" maxOccurs="1" type="lengthType"><xs:annotation><xs:documentation>The length of the instruction.</xs:documentation></xs:annotation></xs:element><xs:element name="stroke" minOccurs="0" maxOccurs="1" type="strokeType"><xs:annotation><xs:documentation>The stroke to swim. This includes basic strokes, kicking and drills.</xs:documentation></xs:annotation></xs:element><xs:element name="rest" minOccurs="0" maxOccurs="1" type="restType"><xs:annotation><xs:documentation>The rest period after the instruction.</xs:documentation></xs:annotation></xs:element><xs:element name="intensity" minOccurs="0" maxOccurs="1" type="intensityProfile"><xs:annotation><xs:documentation>The intensity at which to swim the instruction.</xs:documentation></xs:annotation></xs:element><xs:element name="breath" minOccurs="0" maxOccurs="1" type="xs:nonNegativeInteger"><xs:annotation><xs:documentation>Number of arm strokes per breath.</xs:documentation></xs:annotation></xs:element><xs:element name="underwater" minOccurs="0" maxOccurs="1" type="xs:boolean"><xs:annotation><xs:documentation>True if swimming under water.</xs:documentation></xs:annotation></xs:element><xs:element name="equipment" minOccurs="0" maxOccurs="unbounded" type="equipmentType"><xs:annotation><xs:documentation>Equipment to be used, such as board or pads.</xs:documentation></xs:annotation></xs:element><xs:element name="instructionDescription" type="instructionDescriptionType" minOccurs="0" maxOccurs="1"><xs:annotation><xs:documentation>Short description to modify the instrution.</xs:documentation></xs:annotation></xs:element></xs:sequence></xs:group>