Hi,

I have Marc Robards article on XML Parsing with PHP 
(wirelessdevnet.com).. which talks about parsing an XML FILE.  My XML is 
from a remote server (used curl to get it back to PHP as a variable).

How do I change the following while to read from variable instead of 
file without getting these lame "XML error: junk after document element 
at line 1"?

while($data=fread($fp, 4096)){
    if(!xml_parse($sml_parser, $data, feof($fp))){
       die.........
        }
    }

What I tried was $data being the variable containing xml from remote 
host.. so I say
while($data){
}
which works but when it gets to the end it dies with:
XML error: junk after document element at line 1

Can anybody help me?  Can anybody see?  Sundays on the phone with 
monday.. sorry beatles flashback.  I am not the walrus but I'm not a 
newbie either.. so very sorry for this newbie-esque question.

Kris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to