[xsl] client side paging using XML, XSLT, and script from www.bayes.co.uk?

Subject: [xsl] client side paging using XML, XSLT, and script from www.bayes.co.uk?
From: "Subscriptions @ Team 7 Projects" <subscriptions@xxxxxxxxxxxxxxxxx>
Date: Thu, 4 Aug 2005 21:42:39 +0200
Hi All,

I am in need of some desperate help here. I am attempting to use the article
found on http://www.bayes.co.uk with respect to client side paging using XML
and XSLT. I have searched high and low on the web and have not managed to
find an answer/solution to my problem. Hoping someone can help.

Basically, I am using ASP.Net and SQL Server to return to me a randomised
result set. I then manually build up a XML document and use the stylesheet
example and javascript function from the bayes website to do the client side
paging. It filters nicely, i.e. displaying only 5 records, but when I click
the next 'button' and it executes the javascript it gives me an "object

It seems to be at this point: "navigator.XSLDocument.xml" - undefined.

Remember my XML is created manually and dynamically.

I have found an article on the list that has the same problem, but there
does not seem to be a solution. Can someone please help. Below are code
extracts to help explain....

Thanx in advance

--------------------- ASP.Net C# code extract Start
System.IO.StringReader strReader = new System.IO.StringReader(xmlData);
xpathDoc = new XPathDocument(strReader); XslTransform transform = new
XslTransform(); transform.Load(Server.MapPath("results_page.xslt"));
transform.Transform(xpathDoc,null,Response.Output,new XmlUrlResolver());
--------------------- ASP.Net C# code extract End
-------------------------------- XML Start
			<CompanyName>ABC (Pty) Ltd.</CompanyName>
			<ContactPerson>Mr ABC</ContactPerson>
			<CompanyName>Co. B</CompanyName>
			<ContactPerson>Trust Me</ContactPerson>
			<CompanyName>ABC (Pty) Ltd.</CompanyName>
			<ContactPerson>Mr ABC</ContactPerson>
--------------------------------- XML End

My XSLT is as follows:
------------------------------- XSLT Start

<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0"
<xsl:param name="pagenumber" select="1" />

<xsl:template match="*|@*">
		<xsl:apply-templates select="@* | * | comment() |
processing-instruction() | text()" />

<xsl:template match="series">
		<!-- <link rel="stylesheet" type="text/css"
href="slider.css" />  -->
		<!-- <script language="javascript" src="slider.js" />  -->
		<script language="javascript">
				function changePage(number){
							var s = new
							var x =
							if (x == null){
								x =




							var tem = new
							tem.stylesheet = s;
							var proc =

proc.addParameter("pagenumber", number);
							proc.input = x;
							var str =
							var newDoc =
document.open("text/html", "replace");

navigator.XMLDocument = x;

navigator.XSLDocument = s;
		<xsl:apply-templates select="page[$pagenumber]" />
				<xsl:call-template name="footerPages">
					<xsl:with-param name="element"
select="'page'" />
					<xsl:with-param name="pagenumber"
select="$pagenumber" />

<xsl:template match="ad">
	<table width="600" border="0" cellspacing="0" cellpadding="0">
		<td width="112">Company Name:</td>
		<td colspan="3"><xsl:value-of select="CompanyName"/></td>
		<td><font size="1" face="MS Sans Serif, MS Serif">Contact
		<td><font size="1" face="MS Sans Serif, MS
Serif"><xsl:value-of select="CPerson"/></font></td>
		<td><font size="1" face="MS Sans Serif, MS Serif">E-Mail
		<td><font size="1" face="MS Sans Serif, MS
Serif"><xsl:value-of select="PriEMail"/></font></td>


<xsl:template name="footerPages">
	<xsl:param name="element" />
	<xsl:param name="pagenumber" />
	<xsl:variable name="total" select="count(*[name() = $element])" />
		<xsl:if test="$pagenumber &gt; 1">
			<a href="JavaScript:changePage({$pagenumber
		<xsl:for-each select="*[name() = $element]">
test="not(count(preceding-sibling::*)+1 = $pagenumber)">
select="count(preceding-sibling::*)+1" />
select="count(preceding-sibling::*)+1" />
		<xsl:if test="$pagenumber &lt; $total">
			<a href="JavaScript:changePage({$pagenumber

----------------------------------- XSLT END

Current Thread