Paging recordsets with XML/XSL?

Results 1 to 2 of 2

Thread: Paging recordsets with XML/XSL?

  1. #1
    Nick Sumner Guest

    Default Paging recordsets with XML/XSL?

    I am using XML to output results from a database to a web browser, with the hope that this will enable the user to still have searchability amongst the records returned, when offline. I can construct a html page which shows either one, or all of the records - my question is, is it possible to page the results ie display 20 at a time, and provide links to the next/previous 20 results?<BR>muchos gracias

  2. #2
    Join Date
    Dec 1969

    Default RE: Paging recordsets with XML/XSL?

    What i do (serverside, at least) is take the original XML file (or data island?) and pull however-many nodes into a new XML object, then render that.<BR><BR>&#039 nodeList = nodelist of all &#039main&#039 nodes from the file/island<BR>&#039 newNode = top-level node of a *new* xml doc object<BR>&#039 nodesPerPage = constant or passed value<BR><BR>intPage = Request("start")<BR>For intCtr = intPage to intPage + nodesPerPage<BR> If nodelist(intCtr).nodeType = 1 Then &#039 1 = NODE_ELEMENT<BR> newNode.appendChild nodelist(intCtr)<BR> End If<BR>Next<BR><BR>Then you can render newXML however you need to (XSL or a loop). And intPage + newXML.selectNodes(...).length would be the value to pass for the next page, like simple recordset paging. The main difference is relying on the nodelist&#039s length value instead of ADO&#039s PageCount/PageSize/etc. <BR><BR>I&#039ve never worked much with clientside XML, so that might not work as it is.. It&#039d probably use document.form.etc.etc instead of the querystring. And how the main XML file/island is structured could cause a couple problems. Hopefully it&#039ll give some idea of how to do it though.<BR><BR>- tim<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts