473,383 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

20 results per page

Hi all,

I was wandering is anyone can help. When I click on the 'view all' link on
my homepage http://www.guitarmidi.co.uk I woild like to output the first 20
results on screen then have a 'next' link at the bottom of the page and when
I click on that, the next 20 results are shown on screen and so on. When I
click the 'view all' link, the view .asp page opens the data.xml and
view.xsl pages but the xsl page isn't outputing the results.

I think it is something to do with the line below from the xsl page because
when I use <xsl:for-each select="cat/links"> all the results are output but
on the same page.

<xsl:for-each select="cat/links[position() >= $startPos and position() <=
$endPos]">

Anybody any ideas on what i'm doing wrong?

view.asp
======

<%@ Language="VBScript" %>

<%

dim objDom, fileExists, objFieldValue, objPI

set xmlDocument = CreateObject("MSXML2.FreeThreadedDOMDocument")
xmlDocument.async="false"
xmlDocument.load(Server.MapPath("db/data.xml"))

set xslDocument = CreateObject("MSXML2.FreeThreadedDOMDocument")
xslDocument.async="false"
xslDocument.load(Server.MapPath("view.xsl"))

Set XSLTemplate = Server.CreateObject("MSXML2.XSLTemplate")
Set XSLTemplate.stylesheet = xslDocument
Set proc = XSLTemplate.createProcessor()

proc.input = xmlDocument
proc.Transform
Response.Write proc.output

%>

view.xsl
======

<?xml version="1.0"?>

<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>

<xsl:param name="startPos" select="1"/>
<xsl:param name="recordsPerPage" select="20"/>
<xsl:param name="endPos" select="$startPos + $recordsPerPage"/>

<xsl:template match="/">

<html>

<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
<title>Results</title>
</head>

<body>

<table class="three" align="center">

<col width="40%"/>
<col width="40%"/>
<col width="10%"/>
<col width="10%"/>

<tr>
<th class="head1">Artist</th>
<th class="head1">Song</th>
<th class="head">Chord</th>
<th class="head">Midi</th>
</tr>

<xsl:for-each select="cat/links[position() >= $startPos and position() <=
$endPos]">
<xsl:sort select="artist"/>

<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="media/{$path1}.txt" target="_blank">view</a></td>
<td><a href="media/{$path1}.mid">play</a></td>
</tr>

</xsl:for-each>

</table>

<a href="javascript:history.go(-1)">previous</a> |
<a href="next.asp?startPos={$endPos}">next</a>

<p></p>

<a href="index.html">Click here to return to search page</a>

</body>

</html>

</xsl:template>

</xsl:stylesheet>
Oct 28 '05 #1
0 1395

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Francisco | last post by:
I have this question: I have a simple search to a db, something like: "select description from games where year = '1990'" suppose I get 300 results, I would like to display this in pages of 30...
4
by: NotGiven | last post by:
Say you have three pages, a search page, a results/master, and a detail page. You choose parameters on your search page and submit the page. The results show in the reults/master page. You...
0
by: david liu | last post by:
access 2000 query: here's what i want to do. from an asp page, perform a search on a table in access. i have used sql code in the asp page itself, but i'd rather execute a query in access. i...
2
by: CharitiesOnline | last post by:
Hello, I have set this script up to add paging to a search results page. Which on the first page works fine. I calculates how many pages there should be depending on the number of results returned...
3
by: AbeR | last post by:
I have written a fairly simple reporting app that has been working for a few years without any issues until this past week. The application has a login page with a DSN lookup for login/password...
5
by: George | last post by:
Hi, Anyone has the background for explaining? I have made a search on my name and I have got a link to another search engine. The link's title was the search phrase for the other search engine...
3
by: Rick | last post by:
Hello, I ran Microsoft's free "Web Application Stress" tool to see how asp.net/c# performed against html. Are these results typical? Network: WAS ran on a server with a t3 Internet...
4
by: PI | last post by:
Hi guys, I'm struggling with this much longer than I think I need to, I guess you could help me here: How do I make the results of a search display on the same page as the search, sort of beneath...
7
by: daveeboi | last post by:
..I have been strugling to get this part of my site working correctly even though I can't see anything wrong with my code. I am trying to search a database and display paged results. But everytime...
3
by: Bigalan | last post by:
Hello, i am relatively new to PHP and i am struggling with printing multiple search results on to different pages. The code below works ok but when you click on next page button, it brings up a blank...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.