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
https://forums.phpfreaks.com/topic/72714-xpath-multiple-queries/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.