Parsing XML - Small issue

Hai folks,

i am using this php class (http://www.phpclasses.org/package/4-PHP-Arbitrary-XML-parser-.html) to parse xml data received when i execute this encorded url (example) http://www.test.com/api.php?firstname=abc;lastname=xyz

But the script works only if i specify the xml file directly as shown in below code. Does not work if specify the above url :rolleyes:

This works :

    $file_name="example.xml"; 
    $error=XMLParseFile($parser,$file_name,1,$file_name.".cache");
    if(strcmp($error,""))
        echo "<H2><CENTER>Parser error: $error</CENTER></H2>\
";
    else
    {

This does not work:

    
$url="http://www.test.com/api.php?firstname=abc;lastname=xyz"
$file_name=$url; 
    $error=XMLParseFile($parser,$file_name,1,$file_name.".cache");
    if(strcmp($error,""))
        echo "<H2><CENTER>Parser error: $error</CENTER></H2>\
";
    else
    {

what could be the problem?

Thanks folks,
there is an updated version of the class for remote files has been posted. my friend just pointed out that.

http://www.phpclasses.org/discuss/package/4/thread/6/

thread solved!

Can you use [fphp]SimpleXMLElement[/fphp] ?

Thanks anthonysterling!
Sure! ill take a look at this also in case of any issue with the current :slight_smile: