Re: Parsed XML will not update



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 local
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>&nbsp;
<em>".getValueAttribute($node->LoginName)."</em><br />";
echo "<strong>Country:</strong>&nbsp;
<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...
I guess you haven't gotten any answers because your question is
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
==================
.



Relevant Pages

  • Re: Using Word Mail Merge feature for custom templates
    ... > You are suggesting that I store the content in XML at server end and when I ... A browser knows to open a ... WordProcessingML file in Word due to the PI Word writes into it. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: HttpRequest Question
    ... browser (that is the result of the XSL transformation) and what you really ... have (that is the original XML file). ... What do you want to do on this XML file? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Open File
    ... > targeted asp script need only send the data read from the requested file> back to ... >> need client-side code and reduced security levels on the browser? ... > You'll need a lot more than "reduced security" to open a file directly> with the ... You can then use the FileSystemObject to open and read text files or the ms xml components to read local XML files. ...
    (microsoft.public.scripting.vbscript)
  • Re: opening a client application from a server?
    ... database into my script, generate many csv files, or txt files, or pdf ... files, or xml file, etc., and generate links. ... Acrobat, open a txt file in the browser window, and so on. ... incorporate a Content-Type element in the XML would create a problem. ...
    (comp.lang.perl.misc)
  • Re: Attempt to de-mystify AJAX
    ... you could declare all your variables as Variant. ... the browser, and I still think of that as a mixed blessing. ... XML, which is far from being the most efficient data representation ... done as a fat client, ...
    (comp.databases.pick)