Mockaroo abil genereerisin sql-andmebaasi ja seejärel konverteerisin selle xml-failiks, millel on järgmine kolmetasandiline struktuur
<reis airport="Nicosia International Airport" airline="South African Airways" number="SA9373">
<city city="Bin Tre">
<street>Nevada</street>
</city>
<currency>Dong</currency>
<transport>Flight</transport>
<transport_cost>200</transport_cost>
<accommodation>50</accommodation>
<excursions>30</excursions>
<rating>4.5</rating>
</reis>
Seejärel avasin VisualStudio ja lõin selles ASP.NET Web Aplication projektis xml- ja xslt-failid.

XSLT-koodis on kasutatud CSS-klassi third-level kollase taustaga.
<td>
<span class="third-level">
<xsl:value-of select="city/street"/>
</span>
</td>
Summa arvutamine
<td>
<xsl:choose>
<xsl:when test="$kogumaksumus > 300">
<span class="high-price">
<xsl:value-of select="$kogumaksumus"/>
</span>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$kogumaksumus"/>
</xsl:otherwise>
</xsl:choose>
</td>
Sorteerimine reitingu järgi
<xsl:sort select="rating" data-type="number" order="descending"/>
reis.xsd määrab XML-faili struktuuri, mis sisaldab teavet reiside kohta

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="reisi">
<xs:complexType>
<xs:sequence>
<xs:element name="reis" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="city">
<xs:complexType>
<xs:sequence>
<xs:element name="street" type="xs:string"/>
</xs:sequence>
<xs:attribute name="city" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="currency" type="xs:string"/>
<xs:element name="transport" type="xs:string"/>
<xs:element name="transport_cost" type="xs:decimal"/>
<xs:element name="accommodation" type="xs:decimal"/>
<xs:element name="excursions" type="xs:decimal"/>
<xs:element name="rating" type="xs:decimal"/>
</xs:sequence>
<xs:attribute name="airport" type="xs:string" use="required"/>
<xs:attribute name="airline" type="xs:string" use="required"/>
<xs:attribute name="number" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
XML-failile lisatud viide XSD-failile
<reisi xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="reisi.xsd">

Minu ülesanded
1. kui hind on üle 300, siis märgitakse see punasega
<td>
<xsl:choose>
<xsl:when test="$kogumaksumus > 300">
<span class="high-price">
<xsl:value-of select="$kogumaksumus"/>
</span>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$kogumaksumus"/>
</xsl:otherwise>
</xsl:choose>
</td>
2. tabel, mis sorteerib kõik reisid kogumaksumuse järgi kõige kallimast odavaimani
<xsl:sort select="number(transport_cost) + number(accommodation) + number(excursions)" data-type="number" order="descending"/>
<xsl:variable name="kogumaksumus"
select="number(transport_cost) + number(accommodation) + number(excursions)"/>

3. reiting üle 4,5
<table>
<tr>
<th>Sihtkoht</th>
<th>Hinnang</th>
</tr>
<xsl:for-each select="reisi/reis[rating > 4.5]">
<xsl:sort select="rating" data-type="number" order="descending"/>
<tr>
<td>
<xsl:value-of select="city/@city"/>
</td>
<td>
<xsl:value-of select="rating"/>
</td>
</tr>
</xsl:for-each>
</table>
