XML Parser Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
techlinks
Forum Newbie
Posts: 18
Joined: Sun Dec 29, 2002 4:00 am

XML Parser Question

Post 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
Post Reply