Welcome to WebmasterWorld Guest from 34.231.247.139

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

XML Pagination.

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

New User

10+ Year Member

joined:June 27, 2008
posts: 1
votes: 0


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]

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

New User

10+ Year Member

joined:Mar 12, 2007
posts:26
votes: 0


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

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members