File: Data.xml
<?xml version="1.0"?>
<cv>
<para>
<performance>
<publication>H</publication>
G
<venue>F</venue>
E
<group>D</group>
C
<date>1998</date>
B
<quote>
A
</quote>
</performance>
</para>
</cv>
File: Transform.xslt
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates />
<table bgcolor="#cccccc" border="1" cellpadding="5">
<tr>
<td>
<b>Date</b>
</td>
<td>
<b>Venue</b>
</td>
<td>
<b>Composer</b>
</td>
<td>
<b>Work</b>
</td>
<td>
<b>Role</b>
</td>
</tr>
<xsl:apply-templates mode="index" />
</table>
</body>
</html>
</xsl:template>
<xsl:template match="performance" mode="index">
<tr>
<td>
<xsl:value-of select="date" />
 
</td>
<td>
<xsl:value-of select="venue" />
 
</td>
<td>
<xsl:value-of select="composer" />
 
</td>
<td>
<xsl:value-of select="work" />
 
</td>
<td>
<xsl:value-of select="role" />
 
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
Output:
<html>
<body>
H
G
F
E
D
C
1998
B
A
<table bgcolor="#cccccc" border="1" cellpadding="5">
<tr>
<td><b>Date</b></td>
<td><b>Venue</b></td>
<td><b>Composer</b></td>
<td><b>Work</b></td>
<td><b>Role</b></td>
</tr>
<tr>
<td>1998
</td>
<td>F
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</body>
</html>
|