Hi all
The next thing I'm trying to do here at www.guitarmidi.co.uk is show how
many results a query returns above a table displaying those results. Doing
this willl eventually lead to showing links to pages of the table as well
Whats happening here is the first <xsl:for-each select> in the code loops
and counts the results, I know this will work because the 'x' is displayed
however many results there are.
I know there has to be some sort of counter were the 'x' is and some code to
output the text after the <xsl:for-each select> but I'm not to sure how to
implement it.
Any ideas?
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="ISO-8859-1" />
<xsl:param name="text0" />
<xsl:param name="text1" />
<xsl:param name="text2" />
<xsl:param name="text3" />
<xsl:param name="text4" />
<xsl:template match="/">
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
<title>Results</title>
</head>
<body>
<xsl:for-each select="(cat/links[(contains(artist, $text0) or contains(song,
$text0)) and
(contains(artist, $text1) or contains(song, $text1)) and
(contains(artist, $text2) or contains(song, $text2)) and
(contains(artist, $text3) or contains(song, $text3)) and
(contains(artist, $text4) or contains(song, $text4))])">
x
</xsl:for-each>
<table class="three">
<col width="40%"/>
<col width="40%"/>
<col width="10%"/>
<col width="10%"/>
<tr>
<th class="head">Artist</th>
<th class="head">Song</th>
<th class="head"></th>
<th class="head"></th>
</tr>
<xsl:for-each select="(cat/links[(contains(artist, $text0) or contains(song,
$text0)) and
(contains(artist, $text1) or contains(song, $text1)) and
(contains(artist, $text2) or contains(song, $text2)) and
(contains(artist, $text3) or contains(song, $text3)) and
(contains(artist, $text4) or contains(song, $text4))])">
<tr>
<td class="one"><xsl:apply-templates select="./artist"/></td>
<td class="one"><xsl:apply-templates select="./song"/></td>
<xsl:variable name="path1"><xsl:apply-templates
select="./path"/></xsl:variable>
<td><a href="javascript:newWindow1('media/{$path1}.txt')"><img
src="images/tab.gif" border="0"/></a></td>
<td><a href="javascript:newWindow2('media/{$path1}.mid')"><img
src="images/play.gif" border="0"/></a></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>