70 lines
1.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<h1 style="">Список интересных животных</h1>
<style>
table {
width: 100%;
}
th, td {
border: 3px solid rgb(255, 150, 100);
padding: 8px;
text-align: center;
}
th {
background-color: rgba(255, 150, 100, 0.5);
}
</style>
</head>
<body>
<table>
<tr>
<th>Название</th>
<th>Размер (Ширина x Высота)</th>
<th>Вес</th>
<th>Окрас</th>
<th>Рацион</th>
<th>Среднее потребление пищи (в день)</th>
<th>Место обитания</th>
<th>Интересный факт</th>
</tr>
<!-- Цикл по каждому животному -->
<xsl:for-each select="animals/animal">
<xsl:sort select="weight" data-type="number" />
<tr>
<td>
<xsl:value-of select="name"/>
</td>
<td>
<xsl:value-of select="size/width"/> метра(ов) *
<xsl:value-of select="size/height"/> метра(ов)
</td>
<td>
<xsl:value-of select="weight"/> кг
</td>
<td>
<xsl:value-of select="color"/>
</td>
<td>
<xsl:value-of select="diet/food"/>
</td>
<td>
<xsl:value-of select="diet/averageIntake"/> кг
</td>
<td>
<xsl:value-of select="habitat"/>
</td>
<td>
<xsl:value-of select="interestingFact"/> :D
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>