Forum Moderators: coopster

Message Too Old, No Replies

XML Pagination.

         

SanjayV

12:17 pm on Jun 27, 2008 (gmt 0)

10+ Year Member



Hi all,

As anyone done any work with pagination where the input data is an XML document?

Basically I have a PHP page that reads in an XML document. I would like to break up it up so that it only displays 25 results per page. The code snippet below shows what I've done so far. Unfortunately, nothing is being printed out. Any help would be greatly appreciated.

Cheers
Sanjay

//load XML from URL
$xml = simplexml_load_file("https://example.com/rampart/live/getgroups.php?user=$user");

foreach ($xml->xpath("//ns:displayName") as $id){

for($x=($currentpage*25);$x<(($currentpage*25)+25);$x++){
print_r($id($x));
}

}

[edited by: eelixduppy at 12:43 pm (utc) on June 27, 2008]
[edit reason] example.com [/edit]

MrManager

12:32 pm on Jun 29, 2008 (gmt 0)

10+ Year Member



I'm not too familiar with XML parsing in PHP, but "print_r($id($x));" should probably be "print_r($id[$x]);"...