Re: Parsed XML will not update
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Wed, 16 Dec 2009 13:53:41 -0500
Nosferatum wrote:
On 15 Des, 18:33, Jerry Stuckle <jstuck...@xxxxxxxxxxxxx> wrote:Nosferatum wrote:Hello, my script parsers data from a external XML file, but my localI guess you haven't gotten any answers because your question is
PHP-script won't update with new date after the parsing.
My script is simple:
function getValueAttribute($xml) {
$atts = $xml->attributes();
return $atts['Value'];
}
$url ="http://somewhere.out.there/pathto/feed/external/thesource/
the_feed_itself.xml";
$xml = simplexml_load_file($url);
$result = $xml->xpath('Going/Down/Theladder');
foreach ($result as $node) {
echo "<strong>Name:</strong>
<em>".getValueAttribute($node->LoginName)."</em><br />";
echo "<strong>Country:</strong>
<span class='rwz'>".getValueAttribute($node->Country)."</span><br />";
echo "<strong>The Issue:</strong> <span
class='ekt'>".getValueAttribute($node->Issue)."</span><br />";
}
?>
What do I do in order to get the most recent data when calling this
file? The XML is updated, but not when parsed through this...
confusing. Your simplexml_load_file($url) should fetch the latest
version of the XML. If it isn't, something outside of PHP must be
caching the old file.
– Vis sitert tekst –
Hello Jerry!
Thanks you so much for your reply! I thought about that myself, but
the XML file IS indeed updated when I view the file alone. I tried to
delete everything from all my browseres, but the parsed data were the
same (old). So I really don't know how to grasp this issue.
But your browser isn't involved in fetching the data, so browser cache isn't related. However, if you get fresh data in your browser when you look at it, then some server isn't caching it.
I think you need to look at the XML itself to see what's going on - is it actually changed like you think it is? Without the xml itself or (preferably) a URL, there isn't much we can do here.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- References:
- Parsed XML will not update
- From: Nosferatum
- Re: Parsed XML will not update
- From: Jerry Stuckle
- Re: Parsed XML will not update
- From: Nosferatum
- Parsed XML will not update
- Prev by Date: Re: Developing web based VoIP client
- Next by Date: Re: Top 25 Web Design Faux Pas
- Previous by thread: Re: Parsed XML will not update
- Next by thread: Null vs Zero vs Empty String vs Not Set
- Index(es):
Relevant Pages
|