<example>
<list>
<element>element A</element> <element>element B</element>
<element>element C</element> <element>element D</element>
<element>element E</element>
</list>
<list>
<element>element AA</element> <element>element BB</element>
...
</element>
</list>
Liste: element A, element B, element C, element D, element E.
Liste: element AA, element BB, element CC, .
<xsl:template match="example">
<html><title> <xsl:value-of select="title"/></title>
<body> <xsl:apply-templates/> </body>
</html>
</xsl:template>
<xsl:template match="list">
Liste:
<xsl:apply-templates/>.
<br/>
</xsl:template>
<xsl:template match="element">
<xsl:apply-templates/>
<xsl:if test="position()!=last()"> <xsl:text>, </xsl:text> </xsl:if>
</xsl:template>
<!-- Content: (xsl:when+, xsl:otherwise?) -->
<example>
<title>Simple XSLT example that will show how to deal with animal eyes
</title>
<list>
<animal couleur="noir">Panthère</animal>
<animal couleur="compliquée avec des tâches">Panthère</animal>
<animal couleur="blanc">Ours polaire</animal>
<animal couleur="vert">Grenouille</animal>
<animal>Vache</animal>
</list>
<xsl:template match="list">
Liste d'animaux:
<ul> <xsl:apply-templates/> </ul>
</xsl:template>
<xsl:template match="animal">
<li>
<xsl:choose>
<xsl:when test="@couleur='noir'">
<p style="color:black;font-weight:bold">
<xsl:value-of select="."/>
</p>
</xsl:when>
<xsl:when test="@couleur='vert'">
<p style="color:green">
<xsl:value-of select="."/>
</p>
</xsl:when>
<xsl:otherwise>
<p style="color:blue">
<xsl:value-of select="."/>
</p>
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:template>
<ROWSET>
<ROW>
<id>1</id>
<login>test</login>
<fullname>Joe Test </fullname>
<url>http://tecfa.unige.ch/</url>
<food>3</food>
<work>4</work>
<love>5</love>
<leisure>2</leisure>
</ROW>
<ROW>
.....
</ROW>
....
</ROWSET>
<xsl:template match="ROWSET">
<table border="2" cellspacing="1" cellpadding="6">
<tr><th>id</th>
<th>Login</th>
<th>Full Name</th>
<th>URL</th>
<th>food</th><th>work</th><th>love</th><th>leisure</th>
</tr>
<xsl:for-each select="ROW">
<tr>
<td><xsl:value-of select="id"/></td>
<td><xsl:value-of select="login"/></td>
<td><xsl:value-of select="fullname"/></td>
<td bgcolor="tan"><a href="{url}"><xsl:value-of select="url"/></a></td>
<td><xsl:value-of select="food"/></td>
<td><xsl:value-of select="work"/></td>
<td><xsl:value-of select="love"/></td>
<td><xsl:value-of select="leisure"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>