Team SPOT
From ICO wiki
Kodutöö aines "Võrgurakendused II: hajussüsteemide ehitamine"
Liikmed
- Sigrid Pachel
- Oliver Tiks
Idee
XML / XSD / XSLT
XML
<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="trainingsToHtml.xslt"?> <Trainings> <Styles> <Style Id="1"><![CDATA[Cardio]]></Style> <Style Id="2"><![CDATA[Body&Mind]]></Style> <Style Id="3"><![CDATA[Strength]]></Style> <Style Id="4"><![CDATA[Dance&Fun]]></Style> </Styles> <Instructors> <Instructor Id="1" Rating="5"> <Name><![CDATA[Minnie Yogafier]]></Name> </Instructor> <Instructor Id="2" Rating="4.7"> <Name><![CDATA[Mickey Mouse]]></Name> </Instructor> <Instructor Id="3" Rating="4.6"> <Name><![CDATA[Minnie Mouse]]></Name> </Instructor> <Instructor Id="4" Rating="4.2"> <Name><![CDATA[Donald Duck]]></Name> </Instructor> <Instructor Id="5" Rating="3.9"> <Name><![CDATA[Goofy]]></Name> </Instructor> <Instructor Id="6" Rating="5"> <Name><![CDATA[Arnold Schwarzenegger]]></Name> </Instructor> <Instructor Id="7" Rating="4.2"> <Name><![CDATA[Arnold Zumbaschnegger]]></Name> </Instructor> <Instructor Id="8" Rating="4.8"> <Name><![CDATA[Kayla Weightlifter]]></Name> </Instructor> <Instructor Id="9" Rating="5"> <Name><![CDATA[Margaret Strengthener]]></Name> </Instructor> </Instructors> <Venues> <Venue Id="1" GroupSize="45"><![CDATA[Main Hall]]></Venue> <Venue Id="2" GroupSize="30"><![CDATA[Hall 2]]></Venue> <Venue Id="3" GroupSize="30"><![CDATA[Hall 3]]></Venue> <Venue Id="4" GroupSize="20"><![CDATA[Hall 4]]></Venue> <Venue Id="5" GroupSize="20"><![CDATA[Hall 5]]></Venue> <Venue Id="6" GroupSize="15"><![CDATA[Area 6]]></Venue> <Venue Id="7" GroupSize="30"><![CDATA[Yoga Hall]]></Venue> </Venues> <Training Id="1"> <Name><![CDATA[Yoga]]></Name> <Description> <![CDATA[Yoga is a group of physical, mental, and spiritual practices or disciplines which originated in ancient India. ]]> </Description> <Styles> <Style Id="2" /> </Styles> <Schedule> <ScheduleItem Id="1" VenueId="7"> <Time Duration="PT60M">2017-03-25T14:00:00</Time> <Instructors> <Instructor Id="1"/> </Instructors> </ScheduleItem> <ScheduleItem Id="14" VenueId="7" GroupSize="15"> <Time Duration="PT1H20M">2017-03-28T14:00:00</Time> <Instructors> <Instructor Id="1"/> </Instructors> <Comment> <![CDATA[Special class!]]> </Comment> </ScheduleItem> </Schedule> <VideoUrl>https://www.youtube.com/embed/Nvlxn0EnmbM</VideoUrl> </Training> <Training Id="2" Licence="LesMills"> <Name><![CDATA[BodyBalance™]]></Name> <Styles> <Style Id="2" /> </Styles> <Description> <![CDATA[BODYBALANCE™ is the Yoga, Tai Chi, Pilates workout that builds flexibility and strength and leaves you feeling centered and calm. Based on a carefully structured series of stretches, moves and poses to music it creates a holistic workout that brings the body into a state of harmony and balance. This class will heighten your flexibility and inner strength creating a strong supple body from the inside out. Burn on average 390cals per hour.]]> </Description> <Schedule> <ScheduleItem Id="2" VenueId="3"> <Instructors> <Instructor Id="2"/> </Instructors> <Time Duration="PT1H15M">2017-03-31T12:15:00</Time> </ScheduleItem> <ScheduleItem Id="3" VenueId="2" > <Time Duration="PT1H15M">2017-03-30T13:30:00</Time> <Instructors> <Instructor Id="3"/> </Instructors> </ScheduleItem> </Schedule> <VideoUrl>https://www.youtube.com/embed/jJxA6vBjUqY</VideoUrl> </Training> <Training Id="3" Licence="LesMills"> <Name><![CDATA[BodyJam™]]></Name> <Styles> <Style Id="4" /> <Style Id="1" /> </Styles> <Description> <![CDATA[The Body Jam program is an addictive fusion of the latest dance styles to the hottest new sounds. This class isn’t just for dancers, it’s for everyone because the emphasis is put on not only having fun but also breaking a sweat. So grab a friend, get front and centre … you bring the attitude and we’ll bring the moves!]]> </Description> <Schedule> <ScheduleItem Id="4" VenueId="3" > <Time Duration="PT60M">2017-03-30T16:10:00</Time> <Instructors> <Instructor Id="4"/> </Instructors> </ScheduleItem> <ScheduleItem Id="5" VenueId="5" > <Time Duration="PT45M">2017-04-01T12:00:00</Time> <Instructors> <Instructor Id="5"/> </Instructors> </ScheduleItem> </Schedule> <VideoUrl>https://www.youtube.com/embed/8PTXyg9si_4</VideoUrl> </Training> <Training Id="4" Licence="LesMills"> <Name><![CDATA[BodyPump™]]></Name> <Description> <![CDATA[BodyPump classes are 59 minutes long and contain eight separate muscle-group specific songs or "tracks" along with an opening warm up track and closing cool-down track. There are also 45-minute and 30-minute class formats. The classes are performed to music using free weights-plates, barbells and an aerobic step. Participants choose their weights based on the exercise and their personal goals. Major muscle groups are worked via series of compound and isolation-based exercises including squats, presses, dead lifts. The focus is towards muscle endurance by moving light weights at high repetitions, what Les Mills calls the Rep Effect.]]> </Description> <Styles> <Style Id="3" /> </Styles> <Schedule> <ScheduleItem Id="6" VenueId="1"> <Time Duration="PT60M">2017-03-30T13:00:00</Time> <Instructors> <Instructor Id="6"/> </Instructors> </ScheduleItem> <ScheduleItem Id="7" VenueId="1"> <Time Duration="PT60M">2017-03-23T13:00:00</Time> <Instructors> <Instructor Id="6"/> </Instructors> </ScheduleItem> </Schedule> <VideoUrl>https://www.youtube.com/embed/zU_0XrdO3wo</VideoUrl> </Training> <Training Id="5"> <Name><![CDATA[CoreStrength]]></Name> <Description> <![CDATA[CoreStrenght is a very hard workout! Not for beginners.]]> </Description> <Styles> <Style Id="3" /> </Styles> <Schedule> <ScheduleItem Id="8" VenueId="6" GroupSize="10"> <Time Duration="PT2H">2017-03-23T12:00:00</Time> <Instructors> <Instructor Id="9"/> </Instructors> <Comment> <![CDATA[Special challenge!]]> </Comment> </ScheduleItem> <ScheduleItem Id="9" VenueId="6"> <Time Duration="PT60M">2017-03-30T12:00:00</Time> <Instructors> <Instructor Id="8"/> </Instructors> </ScheduleItem> <ScheduleItem Id="10" VenueId="6"> <Time Duration="PT60M">2017-04-05T12:00:00</Time> <Instructors> <Instructor Id="8"/> <Instructor Id="9"/> </Instructors> </ScheduleItem> </Schedule> <VideoUrl>https://www.youtube.com/embed/ZxTVmpvyUt8</VideoUrl> </Training> <Training Id="6"> <Name><![CDATA[Zumba®]]></Name> <Description> <![CDATA[Zumba involves dance and aerobic movements performed to energetic music. The choreography incorporates hip-hop, soca, samba, salsa, merengue and mambo. Squats and lunges are also included.]]> </Description> <Styles> <Style Id="4" /> </Styles> <Schedule> <ScheduleItem Id="11" VenueId="2"> <Time Duration="PT55M">2017-03-26T15:00:00</Time> <Instructors> <Instructor Id="7"/> </Instructors> </ScheduleItem> <ScheduleItem Id="12" VenueId="4"> <Instructors> <Instructor Id="7"/> </Instructors> <Time Duration="PT60M">2017-03-28T12:00:00</Time> </ScheduleItem> <ScheduleItem Id="13" VenueId="2"> <Time Duration="PT60M">2017-03-30T12:00:00</Time> <Instructors> <Instructor Id="7"/> </Instructors> </ScheduleItem> </Schedule> <VideoUrl>https://www.youtube.com/embed/-ZB6XIkfxnQ</VideoUrl> </Training> </Trainings>
XSD
<?xml version="1.0" encoding="utf-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Trainings"> <xs:complexType> <xs:sequence> <xs:element name="Styles"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Style"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="Id" type="xs:int" use="required" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> <xs:unique name="UniqueStyleId"> <xs:selector xpath="Style"/> <xs:field xpath="@Id"/> </xs:unique> </xs:element> <xs:element name="Instructors"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Instructor"> <xs:complexType> <xs:sequence> <xs:element name="Name" type="xs:string"/> </xs:sequence> <xs:attribute name="Id" type="xs:int" use="required" /> <xs:attribute name="Rating" type="xs:decimal" use="required" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> <xs:unique name="UniqueInstructorId"> <xs:selector xpath="Instructor"/> <xs:field xpath="@Id"/> </xs:unique> </xs:element> <xs:element name="Venues"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Venue"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="Id" type="xs:int" use="required" /> <xs:attribute name="GroupSize" type="xs:int" use="required" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> <xs:unique name="UniqueVenueId"> <xs:selector xpath="Venue"/> <xs:field xpath="@Id"/> </xs:unique> </xs:element> <xs:element maxOccurs="unbounded" name="Training"> <xs:complexType> <xs:all> <xs:element name="Name" type="xs:string" /> <xs:element name="Description" type="xs:string" /> <xs:element name="Styles"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Style"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="Id" type="xs:int" use="required" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Schedule"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="ScheduleItem"> <xs:complexType> <xs:all> <xs:element maxOccurs="1" name="Time"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:dateTime"> <xs:attribute name="Duration" type="xs:duration" use="required" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name="Instructors"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Instructor"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="Id" type="xs:int" use="required" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element minOccurs="0" maxOccurs="1" name="Comment" type="xs:string" /> </xs:all> <xs:attribute name="Id" type="xs:int" use="required" /> <xs:attribute name="VenueId" type="xs:int" use="required" /> <xs:attribute name="GroupSize" type="xs:int" use="optional" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="VideoUrl" type="xs:string" /> </xs:all> <xs:attribute name="Id" type="xs:int" use="required" /> <xs:attribute name="Licence" type="xs:string" use="optional" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> <xs:unique name="UniqueTrainingId"> <xs:selector xpath="Training"/> <xs:field xpath="@Id"/> </xs:unique> <xs:unique name="UniqueScheduleItemId"> <xs:selector xpath="Training/Schedule/ScheduleItem"/> <xs:field xpath="@Id"/> </xs:unique> </xs:element> </xs:schema>
XSLT (html)
XSLT (xml)
Log
- 03.03.17 Esimene kohtumine. Idee.
- 17.03.17 Osa XMList valmis, osa XSLT-st valmis
- 18.03.17 Teine kohtumine. XMLi täiendamine, esimene ülekäimine XSD-s.
- 19.03.17 XML/XSLT/XSD täiendamine ja lõpetamine.