SHOP: Difference between revisions
From ICO wiki
Jump to navigationJump to search
Line 134: | Line 134: | ||
===XSD=== | ===XSD=== | ||
< | <source lang="xml"> | ||
</ | <?xml version="1.0" encoding="utf-8"?> | ||
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" > | |||
<xs:complexType name="CatalogsType"> | |||
<xs:choice minOccurs="0" maxOccurs="unbounded"> | |||
<xs:element name="Catalog" type="CatalogsType"> | |||
</xs:element> | |||
</xs:choice> | |||
<xs:attribute name="Name" type="xs:string" use="required" /> | |||
</xs:complexType> | |||
<xs:complexType name="CatalogType"> | |||
<xs:choice minOccurs="0" maxOccurs="1"> | |||
<xs:element name="Catalog" type="CatalogType"> | |||
</xs:element> | |||
</xs:choice> | |||
<xs:attribute name="Name" type="xs:string" use="required" /> | |||
</xs:complexType> | |||
<xs:simpleType name="RatingType"> | |||
<xs:restriction base="xs:integer"> | |||
<xs:minInclusive value="1"/> | |||
<xs:maxInclusive value="5"/> | |||
</xs:restriction> | |||
</xs:simpleType> | |||
<xs:simpleType name="PriceType"> | |||
<xs:restriction base="xs:decimal"> | |||
<xs:minInclusive value="0"/> | |||
</xs:restriction> | |||
</xs:simpleType> | |||
<xs:element name="Items"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element name="Catalogs"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element maxOccurs="unbounded" name="Catalog" type="CatalogsType" /> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
<xs:element maxOccurs="unbounded" name="Item"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element name="Name" type="xs:string" /> | |||
<xs:element name="Catalog" type="CatalogType" /> | |||
<xs:element name="Price"> | |||
<xs:complexType> | |||
<xs:simpleContent> | |||
<xs:extension base="PriceType"> | |||
<xs:attribute name="Currency" type="xs:string" use="required" /> | |||
</xs:extension> | |||
</xs:simpleContent> | |||
</xs:complexType> | |||
</xs:element> | |||
<xs:element name="Description" type="xs:string" /> | |||
<xs:element name="Images" minOccurs="0"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element maxOccurs="unbounded" name="Image" type="xs:string" /> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
<xs:element name="Availabilities" minOccurs="0"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element maxOccurs="unbounded" name="Availability"> | |||
<xs:complexType> | |||
<xs:simpleContent> | |||
<xs:extension base="xs:string"> | |||
<xs:attribute name="Quantity" type="xs:unsignedInt" use="required" /> | |||
</xs:extension> | |||
</xs:simpleContent> | |||
</xs:complexType> | |||
</xs:element> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
<xs:element name="Feedbacks" minOccurs="0"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element maxOccurs="unbounded" name="Feedback"> | |||
<xs:complexType> | |||
<xs:simpleContent> | |||
<xs:extension base="xs:string"> | |||
<xs:attribute name="Rating" type="RatingType" use="required" /> | |||
</xs:extension> | |||
</xs:simpleContent> | |||
</xs:complexType> | |||
</xs:element> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
</xs:sequence> | |||
<xs:attribute name="Activated" type="xs:boolean" use="required" /> | |||
<xs:attribute name="Id" type="xs:ID" use="required" /> | |||
</xs:complexType> | |||
<xs:unique name="UniqueAddKey"> | |||
<xs:selector xpath="Item" /> | |||
<xs:field xpath="@Key" /> | |||
</xs:unique> | |||
</xs:element> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
</xs:schema> | |||
</source> | |||
===XSLT=== | ===XSLT=== | ||
<pre> | <pre> |
Revision as of 11:57, 17 March 2016
Meeskond
- Johannes Tamm
- Martin Mägi
- Martin Betlem
- Merilyn Renser
XML fail, stiilifail ja skeemifail
XML
<?xml version="1.0" encoding="utf-8" ?>
<Items>
<Catalogs>
<Catalog Name="Technology">
<Catalog Name="Memory"></Catalog>
<Catalog Name="Protsessor"></Catalog>
<Catalog Name="Storage">
<Catalog Name="Solid-state drive"></Catalog>
<Catalog Name="Hard disk drive"></Catalog>
</Catalog>
<Catalog Name="Computer"></Catalog>
<Catalog Name="Laptop"></Catalog>
</Catalog>
<Catalog Name="Furniture">
<Catalog Name="Chair"></Catalog>
<Catalog Name="Sofa"></Catalog>
<Catalog Name="Bed"></Catalog>
<Catalog Name="Table"></Catalog>
</Catalog>
</Catalogs>
<Item Activated="true" Id="i1">
<Name><![CDATA[Dell XPS 15]]></Name>
<Catalog Name="Technology">
<Catalog Name="Laptop"></Catalog>
</Catalog>
<Price Currency="EUR"><![CDATA[100]]></Price>
<Description><![CDATA[Intel i7 6500U 2.5 GHz (3852p) 16 GB, 512GB SSD Intel HD Graphics 520 (1326p) 13.3" 3200x1800]]></Description>
<Images>
<Image><![CDATA[http://dri1.img.digitalrivercontent.net/Storefront/Company/msintl/images/English/en-INTL-Dell-XPS-15-i5-8gb-256gb-QF9-00100/en-INTL-L-Dell-XPS-15-i5-8gb-256gb-QF9-00100-mnco.jpg]]></Image>
<Image><![CDATA[http://scr.wfcdn.de/12791/Dell-XPS-15-2015-mit-Windows-10-1433327983-0-0.jpg]]></Image>
</Images>
<Availabilities>
<Availability Quantity="5"><![CDATA[Akadeemia 5, Tallinn]]></Availability>
<Availability Quantity="1"><![CDATA[Pikk 20, Tartu]]></Availability>
</Availabilities>
<Feedbacks>
<Feedback Rating="5"><![CDATA[Very good]]></Feedback>
<Feedback Rating="5"><![CDATA[I like it]]></Feedback>
</Feedbacks>
</Item>
<Item Activated="true" Id="i2">
<Name><![CDATA[4GB DDR2]]></Name>
<Catalog Name="Technology">
<Catalog Name="Memory"></Catalog>
</Catalog>
<Price Currency="EUR"><![CDATA[100]]></Price>
<Description><![CDATA[4GB DDR2 800Mhz CL6]]></Description>
<Images>
<Image><![CDATA[http://76.my/Malaysia/4gb-kingston-desktop-pc-ddr2-ram-800mhz-pc-6400-kvr800d2n6-4g-amd-anonymous321-1410-25-Anonymous321@1.jpg]]></Image>
</Images>
<Availabilities>
<Availability Quantity="10"><![CDATA[Akadeemia 5, Tallinn]]></Availability>
<Availability Quantity="1"><![CDATA[Pikk 20, Tartu]]></Availability>
</Availabilities>
<Feedbacks>
<Feedback Rating="5"><![CDATA[Very good]]></Feedback>
<Feedback Rating="5"><![CDATA[I like it]]></Feedback>
</Feedbacks>
</Item>
<Item Activated="true" Id="i3">
<Name><![CDATA[HP DV600]]></Name>
<Catalog Name="Technology">
<Catalog Name="Laptop"></Catalog>
</Catalog>
<Price Currency="EUR"><![CDATA[50]]></Price>
<Description><![CDATA[CPU: T2080, RAM: 4GB, HDD 120GB, 15,3"]]></Description>
<Images>
<Image><![CDATA[http://cnet2.cbsistatic.com/hub/i/r/2010/08/03/7ded434e-bb7a-11e2-8a8e-0291187978f3/thumbnail/770x433/3e631d8f8a16a3a9c6e69e0d98b652a9/32036702-2-440-overview-1.gif]]></Image>
<Image><![CDATA[http://i.ebayimg.com/00/s/NTI5WDcwMA==/z/Je8AAOSwcnpTrAD0/$_32.JPG]]></Image>
</Images>
<Availabilities>
<Availability Quantity="5"><![CDATA[Akadeemia 5, Tallinn]]></Availability>
<Availability Quantity="8"><![CDATA[Pikk 20, Tartu]]></Availability>
</Availabilities>
<Feedbacks>
<Feedback Rating="1"><![CDATA[It is not working well.]]></Feedback>
<Feedback Rating="3"><![CDATA[Videocard is problem]]></Feedback>
</Feedbacks>
</Item>
<Item Activated="true" Id="i4">
<Name><![CDATA[Oak chair]]></Name>
<Catalog Name="Furniture">
<Catalog Name="Chair"></Catalog>
</Catalog>
<Price Currency="EUR"><![CDATA[75]]></Price>
<Description><![CDATA[OAK 100%]]></Description>
<Images>
<Image><![CDATA[http://curtainsandcomfort.com/furniture/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/w/e/westbury-reclaimed-oak-timber-dining-chairs---pair---wsr19.jpg]]></Image>
</Images>
<Availabilities>
<Availability Quantity="8"><![CDATA[Pikk 20, Tartu]]></Availability>
</Availabilities>
<Feedbacks>
<Feedback Rating="5"><![CDATA[I like very]]></Feedback>
</Feedbacks>
</Item>
<Item Activated="true" Id="i5">
<Name><![CDATA[Oak big table]]></Name>
<Catalog Name="Furniture">
<Catalog Name="Table"></Catalog>
</Catalog>
<Price Currency="EUR"><![CDATA[400]]></Price>
<Description><![CDATA[NOW SALES!!!]]></Description>
<Images>
<Image><![CDATA[http://iceinteriors.co.uk/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/c/l/clemence-richard-massive-dining-table_3.jpg]]></Image>
</Images>
<Availabilities>
<Availability Quantity="131"><![CDATA[Punane 12, Tallinn]]></Availability>
</Availabilities>
<Feedbacks>
<Feedback Rating="5"><![CDATA[I like very]]></Feedback>
<Feedback Rating="5"><![CDATA[Cheapest!]]></Feedback>
<Feedback Rating="5"><![CDATA[I love it]]></Feedback>
<Feedback Rating="5"><![CDATA[Thanks!]]></Feedback>
</Feedbacks>
</Item>
</Items>
XSD
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" >
<xs:complexType name="CatalogsType">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Catalog" type="CatalogsType">
</xs:element>
</xs:choice>
<xs:attribute name="Name" type="xs:string" use="required" />
</xs:complexType>
<xs:complexType name="CatalogType">
<xs:choice minOccurs="0" maxOccurs="1">
<xs:element name="Catalog" type="CatalogType">
</xs:element>
</xs:choice>
<xs:attribute name="Name" type="xs:string" use="required" />
</xs:complexType>
<xs:simpleType name="RatingType">
<xs:restriction base="xs:integer">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="5"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="PriceType">
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="Items">
<xs:complexType>
<xs:sequence>
<xs:element name="Catalogs">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Catalog" type="CatalogsType" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" name="Item">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string" />
<xs:element name="Catalog" type="CatalogType" />
<xs:element name="Price">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="PriceType">
<xs:attribute name="Currency" type="xs:string" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="Description" type="xs:string" />
<xs:element name="Images" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Image" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Availabilities" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Availability">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="Quantity" type="xs:unsignedInt" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Feedbacks" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Feedback">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="Rating" type="RatingType" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="Activated" type="xs:boolean" use="required" />
<xs:attribute name="Id" type="xs:ID" use="required" />
</xs:complexType>
<xs:unique name="UniqueAddKey">
<xs:selector xpath="Item" />
<xs:field xpath="@Key" />
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
XSLT
Logi
15.veebruar
- Meeskonna kokkupanek
- Arutlemine
- Plaanimine
- XML loomine
16.märts
- Wiki lehe loomine