Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last item of data in table not working properly!

Status
Not open for further replies.

birney29

Programmer
Oct 11, 2001
140
GB
hi, im using the following code to put data in to a simple table. The first 2 elements go into the table fine but the 3rd part of the table displays all the data for that row combind. any ideas? thanks for the help.

kenny

xsl:

<?xml version=&quot;1.0&quot;?>
<xsl:stylesheet xmlns:xsl=&quot;<xsl:template match=&quot;/&quot;>
<html>
<head>
<title> CD Collection </title>
</head>
<body>
<table border = &quot;2&quot; bgcolor = &quot;red&quot;>
<tr>
<th> Artist </th>
<th> Title </th>
<th> Genre </th>
</tr>
<xsl:for-each select=&quot;cdCollection/cd&quot;>
<tr>
<td><xsl:value-of select=&quot;artist&quot;/></td>
<td><xsl:value-of select=&quot;title&quot;/></td>
<td><xsl:value-of Select=&quot;genre&quot;/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

xml:

<?xml version=&quot;1.0&quot;?>
<?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;cdstyle.xsl&quot; ?>
<cdCollection>
<cd>
<artist> Jurassic 5 </artist>
<title> Concrete Schoolyard </title>
<genre> Hip Hop </genre>
</cd>
<cd>
<artist> Dr Dre </artist>
<title> The Chronic </title>
<genre> Hip Hop </genre>
</cd>
<cd>
<artist> The Doors </artist>
<title> L.A. Woman </title>
<genre> Blues </genre>
</cd>
<cd>
<artist> Nirvana </artist>
<title> Bleach </title>
<genre> Grunge </genre>
</cd>


</cdCollection>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top