Meeskond "Head isu"

From ICO wiki
Revision as of 19:42, 14 April 2011 by Eristi (talk | contribs) (→‎XML Schema: add kohvik.xsd)
Jump to navigationJump to search

Meeskond

  • Liisa Viljaste (Lember)
  • Kalev Paju
  • Elvin Risti


XML

XML

<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="kohvik.xslt"?>
<cafemenus>
  <cafes>
    <cafe id="1">
      <name>Reval</name>
      <address id="1">
        <coordinates long="59.430756" lat="24.74565" />
        <street>Pärnu mnt</street>
        <house>271</house>
        <houseExtra />
        <city>Tallinn</city>
        <!-- country -  ISO 3166-1 alpha-2 code - http://en.wikipedia.org/wiki/ISO_3166-2 -->
        <country>EE</country>
        <zip>10141</zip>
        <!-- opened is per location -->
        <opened year="2011">
          <weekdays>
            <!-- http://en.wikipedia.org/wiki/ISO_8601 -->
            <weekday begin="09:00:00+03:00" until="19:00:00+03:00">1</weekday>
            <weekday begin="09:00:00+03:00" until="19:00:00+03:00">2</weekday>
            <weekday begin="09:00:00+03:00" until="19:00:00+03:00">3</weekday>
            <weekday begin="09:00:00+03:00" until="19:00:00+03:00">4</weekday>
            <weekday begin="09:00:00+03:00" until="21:00:00+03:00">5</weekday>
            <weekday begin="10:00:00+03:00" until="15:00:00+03:00">6</weekday>
            <weekday isclosed="true">7</weekday>
          </weekdays>
          <exceptions>
            <date isclosed="true">2011-01-01</date>
            <date isclosed="true">2011-02-24</date>
            <date begin="12:00:00+03:00" until="19:00:00+03:00">2011-02-25</date>
          </exceptions>
        </opened>
        <comment lang="et">Asume kesklinnas Pärnu mnt ja Tatari nurgal.</comment>
      </address>
    </cafe>
    <cafe id="2">
      <name>Reval 2</name>
      <address id="1">
        <coordinates long="59.430756" lat="24.74565" />
        <street>Pärnu mnt</street>
        <house>271</house>
        <houseExtra />
        <city>Tallinn</city>
        <!-- country -  ISO 3166-1 alpha-2 code - http://en.wikipedia.org/wiki/ISO_3166-2 -->
        <country>EE</country>
        <zip>10141</zip>
        <!-- opened is per location -->
        <opened year="2011">
          <weekdays>
            <!-- http://en.wikipedia.org/wiki/ISO_8601 -->
            <weekday begin="09:00:00+03:00" until="19:00:00+03:00">1</weekday>
            <weekday begin="09:00:00+03:00" until="19:00:00+03:00">2</weekday>
            <weekday begin="09:00:00+03:00" until="19:00:00+03:00">3</weekday>
            <weekday begin="09:00:00+03:00" until="19:00:00+03:00">4</weekday>
            <weekday begin="09:00:00+03:00" until="21:00:00+03:00">5</weekday>
            <weekday begin="10:00:00+03:00" until="15:00:00+03:00">6</weekday>
            <weekday isclosed="true">7</weekday>
          </weekdays>
          <exceptions>
            <date isclosed="true">2011-01-01</date>
            <date isclosed="true">2011-02-24</date>
            <date begin="12:00:00+03:00" until="19:00:00+03:00">2011-02-25</date>
          </exceptions>
        </opened>
        <comment lang="et">Asume kesklinnas Pärnu mnt ja Tatari nurgal.</comment>
      </address>
    </cafe>
  </cafes>
  <menus>
    <menuscafe cafeid="1">
      <!-- currency -  ISO 4217 - http://en.wikipedia.org/wiki/ISO_4217 -->
      <currency>EUR</currency>
      <!-- @lang - ISO 639-1 - http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes -->
      <menu lang="et">
        <item type="food" subtype="roast">
          <name>Kiievi kotlett</name>
          <!-- @comment - simple comment -->
          <price comment="väike">2</price>
          <price comment="suur">3</price>
          <!-- availability: true/false -->
          <availability>true</availability>
          <comment>Väiksel portsul üks kotlett, suurel kolm.</comment>
        </item>
        <item type="drink">
          <name>Piim</name>
          <!-- @unit: string,litres -->
          <price quantity="0.33" unit="l">0.5</price>
          <availability>true</availability>
          <comment />
        </item>
        <item type="food" subtype="dessert">
          <name>Martsipani tort</name>
          <!-- @comment - simple comment -->
          <price comment="viil">1</price>
          <price quantity="0.8" unit="kg">9</price>
          <!-- availability: true/false -->
          <availability>true</availability>
          <comment>Tordil on valge jänese pilt.</comment>
        </item>
      </menu>
      <benefits>
        <benefit isprecent="true" name="ISIC kaart">5</benefit>
        <benefit isprecent="true" name="Püsikliendi soodustus">10</benefit>
        <benefit isprecent="false" name="Kampaania X soodustus">1.5</benefit>
      </benefits>
    </menuscafe>
  </menus>
</cafemenus>

XML Schema

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="cafemenus">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="cafes">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="cafe" maxOccurs="unbounded" >
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="name" type="xs:string" />
                    <xs:element name="address">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="coordinates" minOccurs="0" maxOccurs="1">
                            <xs:complexType>
                              <xs:attribute name="long" type="xs:decimal" use="required" />
                              <xs:attribute name="lat" type="xs:decimal" use="required" />
                            </xs:complexType>
                          </xs:element>
                          <xs:element name="street" type="xs:string" />
                          <xs:element name="house" type="xs:unsignedInt" />
                          <xs:element name="houseExtra" type="xs:string" />
                          <xs:element name="city" type="xs:string" />
                          <xs:element name="country" type="xs:string" />
                          <xs:element name="zip" type="xs:unsignedShort" />
                          <xs:element name="opened">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="weekdays">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element minOccurs="7" maxOccurs="7" name="weekday">
                                        <xs:complexType>
                                          <xs:simpleContent>
                                            <xs:extension base="xs:unsignedByte">
                                              <xs:attribute name="begin" type="xs:time" use="optional" />
                                              <xs:attribute name="until" type="xs:time" use="optional" />
                                              <xs:attribute name="isclosed" type="xs:boolean" use="optional" />
                                            </xs:extension>
                                          </xs:simpleContent>
                                        </xs:complexType>
                                      </xs:element>
                                    </xs:sequence>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element name="exceptions">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element maxOccurs="unbounded" name="date">
                                        <xs:complexType>
                                          <xs:simpleContent>
                                            <xs:extension base="xs:date">
                                              <xs:attribute name="isclosed" type="xs:boolean" use="optional" />
                                              <xs:attribute name="begin" type="xs:time" use="optional" />
                                              <xs:attribute name="until" type="xs:time" use="optional" />
                                            </xs:extension>
                                          </xs:simpleContent>
                                        </xs:complexType>
                                      </xs:element>
                                    </xs:sequence>
                                  </xs:complexType>
                                </xs:element>
                              </xs:sequence>
                              <xs:attribute name="year" type="xs:unsignedShort" use="required" />
                            </xs:complexType>
                          </xs:element>
                          <xs:element name="comment">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="lang" type="xs:string" use="required" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                        <xs:attribute name="id" type="xs:unsignedInt" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="id" type="xs:unsignedInt" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="menus">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="menuscafe" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="currency" type="xs:string" />
                    <xs:element name="menu">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element maxOccurs="unbounded" name="item">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="name" type="xs:string" />
                                <xs:element maxOccurs="unbounded" name="price">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:decimal">
                                        <xs:attribute name="comment" type="xs:string" use="optional" />
                                        <xs:attribute name="quantity" type="xs:decimal" use="optional" />
                                        <xs:attribute name="unit" type="xs:string" use="optional" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element name="availability" type="xs:boolean" />
                                <xs:element name="comment" type="xs:string" />
                              </xs:sequence>
                              <xs:attribute name="type" type="xs:string" use="required" />
                              <xs:attribute name="subtype" type="xs:string" use="optional" />
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                        <xs:attribute name="lang" type="xs:string" use="required" />
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="benefits" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="benefit">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:decimal">
                                  <xs:attribute name="isprecent" type="xs:boolean" use="required" />
                                  <xs:attribute name="name" type="xs:string" use="required" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="cafeid" type="xs:unsignedInt" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

XSLT