Jump to content

Xpath multiple queries


mrnightowl

Recommended Posts

If anyone could help or have a link to point me in the right direction..

I'm using xpath.class to parse xml node value from a site.  This site has a different xml file for each of its users.  Which I have 30 of them loaded onto a page for easy viewing.  I'm trying to parse viewers count information from each of the 30 different users I have on my site.  Problem is, if I try parsing more than 6 or 7 the script freezes.  Below is a example of what I'm doing.  How can I have it load them in order or something to prevent the script from freezing?

 

<?php
include("XPath.class.php");?>

User1 Viewers: <?php
$xp = new XPath();
$xp->importFromFile("http://www.abc123.com/user1/meta.xml");
$viewers = $xp->getData('//viewers');
echo($viewers);
?>
<br>
User 2 Viewers: <?php
$xp = new XPath();
$xp->importFromFile("http://www.abc123.com/user2/meta.xml");
$viewers = $xp->getData('//viewers');
echo($viewers);
?> 

 

The above code does function properly but only up to a certain amount... If I repeat that process it eventually freezes.

Any info would be greatly appreciated.  thanks in advance!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.