Meeskond: Falador: Difference between revisions
From ICO wiki
Jump to navigationJump to search
No edit summary |
|||
Line 172: | Line 172: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="width:75em"> | <div class="toccolours mw-collapsible mw-collapsed" style="width:75em"> | ||
<source lang="xml"> | <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:element name="vehicles"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element minOccurs="0" maxOccurs="unbounded" name="vehicle"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element name="type" type="xs:string" /> | |||
<xs:element name="make" type="xs:string" /> | |||
<xs:element minOccurs="0" name="model" type="xs:string" /> | |||
<xs:element minOccurs="0" name="specification" type="xs:string" /> | |||
<xs:element name="date" type="xs:string" /> | |||
<xs:element name="price"> | |||
<xs:complexType> | |||
<xs:simpleContent> | |||
<xs:extension base="xs:unsignedInt"> | |||
<xs:attribute name="currency" type="xs:string" use="required" /> | |||
</xs:extension> | |||
</xs:simpleContent> | |||
</xs:complexType> | |||
</xs:element> | |||
<xs:element minOccurs="0" name="license-plate" type="xs:string" /> | |||
<xs:element name="location" type="xs:string" /> | |||
<xs:element minOccurs="0" name="description" type="xs:string" /> | |||
<xs:element minOccurs="0" name="technical-specs"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element minOccurs="0" name="seats" type="xs:unsignedInt" /> | |||
<xs:element minOccurs="0" name="doors" type="xs:unsignedInt" /> | |||
<xs:element minOccurs="0" name="engine"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element minOccurs="0" name="power"> | |||
<xs:complexType> | |||
<xs:simpleContent> | |||
<xs:extension base="xs:unsignedShort"> | |||
<xs:attribute name="unit" type="xs:string" use="required" /> | |||
</xs:extension> | |||
</xs:simpleContent> | |||
</xs:complexType> | |||
</xs:element> | |||
<xs:element minOccurs="0" name="displacement"> | |||
<xs:complexType> | |||
<xs:simpleContent> | |||
<xs:extension base="xs:decimal"> | |||
<xs:attribute name="unit" type="xs:string" use="required" /> | |||
</xs:extension> | |||
</xs:simpleContent> | |||
</xs:complexType> | |||
</xs:element> | |||
<xs:element minOccurs="0" name="type" type="xs:string" /> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
<xs:element minOccurs="0" name="mileage"> | |||
<xs:complexType> | |||
<xs:simpleContent> | |||
<xs:extension base="xs:unsignedInt"> | |||
<xs:attribute name="unit" type="xs:string" use="required" /> | |||
</xs:extension> | |||
</xs:simpleContent> | |||
</xs:complexType> | |||
</xs:element> | |||
<xs:element minOccurs="0" name="fuel" type="xs:string" /> | |||
<xs:element minOccurs="0" name="transmission" type="xs:string" /> | |||
<xs:element minOccurs="0" name="color" type="xs:string" /> | |||
<xs:element minOccurs="0" name="weights"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element minOccurs="0" name="cross-weight"> | |||
<xs:complexType> | |||
<xs:simpleContent> | |||
<xs:extension base="xs:unsignedShort"> | |||
<xs:attribute name="unit" type="xs:string" use="required" /> | |||
</xs:extension> | |||
</xs:simpleContent> | |||
</xs:complexType> | |||
</xs:element> | |||
<xs:element minOccurs="0" name="load-carring"> | |||
<xs:complexType> | |||
<xs:simpleContent> | |||
<xs:extension base="xs:unsignedShort"> | |||
<xs:attribute name="unit" type="xs:string" use="required" /> | |||
</xs:extension> | |||
</xs:simpleContent> | |||
</xs:complexType> | |||
</xs:element> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
<xs:element minOccurs="0" name="equipment"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element minOccurs="0" maxOccurs="unbounded" name="item" type="xs:string" /> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
<xs:element minOccurs="0" name="images"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element minOccurs="0" maxOccurs="unbounded" name="image" type="xs:string" /> | |||
</xs:sequence> | |||
</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:schema> | |||
</source> | </source> | ||
</div> | </div> | ||
===XSLT HTML=== | ===XSLT HTML=== |
Revision as of 21:18, 20 March 2017
Meeskond: Falador
- Madis Lugus
- Taavi Metsvahi
- Kristjan Kivisild
XML/XSD/XSLT
XML
Vehicles that are being sold
<?xml version="1.0" encoding="utf-8"?>
<vehicles>
<vehicle id="1">
<type><![CDATA[Bus]]></type>
<make><![CDATA[Mercedes-Benz]]></make>
<model><![CDATA[Sprinter]]></model>
<date>05/2003</date>
<price currency="EUR">5500</price>
<license-plate><![CDATA[ABS 550]]></license-plate>
<location><![CDATA[Estonia, Tallinn, Raja 4C]]></location>
<description><![CDATA[Selling a big white van, it can haul ass with alot of people in it, making it ideal for transporting immigrants across the border]]></description>
<technical-specs>
<seats>5</seats>
<doors>4</doors>
<engine>
<power unit="kW">95</power>
<displacement unit="L">2.2</displacement>
<type><![CDATA[R6]]></type>
</engine>
<mileage unit="KM">75600</mileage>
<fuel><![CDATA[Diesel]]></fuel>
<transmission><![CDATA[Automatic]]></transmission>
<color><![CDATA[white]]></color>
<weights>
<cross-weight unit="kg">4000</cross-weight>
<load-carring unit="kg">1760</load-carring>
</weights>
</technical-specs>
<equipment>
<item><![CDATA[ABS]]></item>
<item><![CDATA[Traction control]]></item>
<item><![CDATA[Sunroof]]></item>
<item><![CDATA[Tow hitch]]></item>
</equipment>
<images>
<image><![CDATA[https://static.cargurus.com/images/site/2008/04/30/19/51/2003_mercedes-benz_sprinter-pic-65605-1600x1200.jpeg]]></image>
<image><![CDATA[https://i.ytimg.com/vi/sDv15TPLvvo/maxresdefault.jpg]]></image>
</images>
</vehicle>
<vehicle id="2">
<type><![CDATA[Passenger car]]></type>
<make><![CDATA[Audi]]></make>
<model><![CDATA[S5]]></model>
<specification><![CDATA[Sportback Quattro TFSI]]></specification>
<date>02/2012</date>
<price currency="EUR">26900</price>
<license-plate><![CDATA[WAU ZZZ]]></license-plate>
<location><![CDATA[Estonia, Tallinn, Raja 4C]]></location>
<description><![CDATA[Stolen from: Germany]]></description>
<technical-specs>
<seats>5</seats>
<doors>5</doors>
<engine>
<power unit="kW">245</power>
<displacement unit="L">3.0</displacement>
<type><![CDATA[V6]]></type>
</engine>
<mileage unit="KM">169000</mileage>
<fuel><![CDATA[Petrol]]></fuel>
<transmission><![CDATA[Automatic (Tiptronic)]]></transmission>
<color><![CDATA[Dark brown metal]]></color>
<weights>
<cross-weight unit="kg">1820</cross-weight>
</weights>
</technical-specs>
<equipment>
<item><![CDATA[ABS]]></item>
<item><![CDATA[Traction control]]></item>
<item><![CDATA[Sunroof]]></item>
<item><![CDATA[Electric handbrake]]></item>
<item><![CDATA[Central locking]]></item>
<item><![CDATA[Bang & Olufsen sound system]]></item>
<item><![CDATA[Xenon headlight]]></item>
<item><![CDATA[Adaptive lights]]></item>
</equipment>
<images>
<image><![CDATA[http://img6.auto24.ee/auto24/320/863/84913863.jpg]]></image>
<image><![CDATA[http://img5.auto24.ee/auto24/320/872/84913872.jpg]]></image>
<image><![CDATA[http://img5.auto24.ee/auto24/320/876/84913876.jpg]]></image>
</images>
</vehicle>
<vehicle id="40000">
<type><![CDATA[Mototechnics]]></type>
<make><![CDATA[BMW]]></make>
<model><![CDATA[S1000RR]]></model>
<date>04/2010</date>
<price currency="EUR">8000</price>
<license-plate><![CDATA[WB 50]]></license-plate>
<location><![CDATA[Estonia, Tallinn, Raja 4C]]></location>
<description><![CDATA[ABS ja veojõukontroll.
Lisadeks: Paagi kaitse kleebis ja stomgrip.
Tehniliselt heas korras !]]></description>
<technical-specs>
<seats>2</seats>
<engine>
<power unit="kW">142</power>
<displacement unit="cm3">999</displacement>
<type><![CDATA[R4]]></type>
</engine>
<mileage unit="KM">13467</mileage>
<fuel><![CDATA[Petrol]]></fuel>
<transmission><![CDATA[Manual]]></transmission>
<color><![CDATA[White]]></color>
</technical-specs>
<equipment>
<item><![CDATA[ABS]]></item>
<item><![CDATA[Traction control]]></item>
<item><![CDATA[DTC]]></item>
</equipment>
<images>
<image><![CDATA[http://img6.auto24.ee/auto24/320/780/87505780.jpg]]></image>
<image><![CDATA[http://img7.auto24.ee/auto24/320/785/87505785.jpg]]></image>
</images>
</vehicle>
<vehicle id="400001">
<type><![CDATA[passenger car]]></type>
<make><![CDATA[Tesla]]></make>
<model><![CDATA[Model S 85D]]></model>
<date>06/2015</date>
<price currency="EUR">97340</price>
<location><![CDATA[Estonia, Tallinn, Raja 4C]]></location>
<description><![CDATA[Selling a car, that is ment for people who want to brag about saving the planet, but actually sell their farely new car to buy this one, making them acctually more harmful to the planet]]></description>
<technical-specs>
<seats>5</seats>
<doors>4</doors>
<engine>
<power unit="kW">310</power>
</engine>
<mileage unit="KM">45000</mileage>
<fuel><![CDATA[Electric]]></fuel>
<transmission><![CDATA[Automatic]]></transmission>
<color><![CDATA[dark gray met.]]></color>
</technical-specs>
<equipment>
<item><![CDATA[Parking camera]]></item>
<item><![CDATA[Parking aid]]></item>
<item><![CDATA[Lane assist]]></item>
<item><![CDATA[Airbars]]></item>
<item><![CDATA[Alloy wheels]]></item>
<item><![CDATA[Power steering]]></item>
<item><![CDATA[ABS]]></item>
<item><![CDATA[Traction control]]></item>
<item><![CDATA[Sunroof]]></item>
<item><![CDATA[Tow hitch]]></item>
</equipment>
<images>
<image><![CDATA[https://s1.cdn.autoevolution.com/images/news/tesla-model-s-85d-range-to-increase-with-new-software-coming-in-january-90666-7.jpg]]></image>
<image><![CDATA[http://www.themotorreport.com.au/content/image/2/0/2015_tesla_model_s_p85d_05-0224-920x544.jpg]]></image>
</images>
</vehicle>
</vehicles>
XSD
Assigned minOccurs to PLANT and DIM2, changed attribute SpiritAnimal's use to optional and Plants attribute Id to unsignedInt
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="vehicles">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="vehicle">
<xs:complexType>
<xs:sequence>
<xs:element name="type" type="xs:string" />
<xs:element name="make" type="xs:string" />
<xs:element minOccurs="0" name="model" type="xs:string" />
<xs:element minOccurs="0" name="specification" type="xs:string" />
<xs:element name="date" type="xs:string" />
<xs:element name="price">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedInt">
<xs:attribute name="currency" type="xs:string" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="license-plate" type="xs:string" />
<xs:element name="location" type="xs:string" />
<xs:element minOccurs="0" name="description" type="xs:string" />
<xs:element minOccurs="0" name="technical-specs">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="seats" type="xs:unsignedInt" />
<xs:element minOccurs="0" name="doors" type="xs:unsignedInt" />
<xs:element minOccurs="0" name="engine">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="power">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedShort">
<xs:attribute name="unit" type="xs:string" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="displacement">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="unit" type="xs:string" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="type" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="mileage">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedInt">
<xs:attribute name="unit" type="xs:string" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="fuel" type="xs:string" />
<xs:element minOccurs="0" name="transmission" type="xs:string" />
<xs:element minOccurs="0" name="color" type="xs:string" />
<xs:element minOccurs="0" name="weights">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="cross-weight">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedShort">
<xs:attribute name="unit" type="xs:string" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="load-carring">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:unsignedShort">
<xs:attribute name="unit" type="xs:string" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="equipment">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="item" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="images">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="image" type="xs:string" />
</xs:sequence>
</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:schema>
XSLT HTML
XSLT that returns HTML as output. It creates a table that consists of plants common name, necessary light condition and price. Assigned light conditon necessity is color coded by availability value fulfilling certaing condition.
XSLT XML
XSLT that returns XML as output. It sorts plants inside each DIM2 separately and lists only the ones with availability value below 050000.
Output
Pictures of outputs created by XSLT-s listed above.