Page 1 of 1

XML Parser Question

Posted: Mon Oct 20, 2008 11:41 am
by techlinks
Hi Folks:

I hope this is an OK place to post a newbie question. I'm trying to parse an XML file that contains a URL as one of it's nodes. For instance:

http://wsdsapi-p.xxxxxx.com/clickserver ... /site-link>

............

Here's the problem...I registered my callback function "contents" in:

xml_set_character_data_handler($xml_parser, "contents");

...but whenever it processes the URL above, it only captures half of it...basically everything before the first ampersand.

By the way, I'm reading 8K at a time. See here:

$fp = fopen($file, "r");
$data = fread($fp, 80000);


................

So my question is why isn't the callback function parsing the entire URL? Is there something setting it off? How can I force the XML parser to read all of it?

Thanks