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/_iceUrlFlag=1?r awURL=http%3A%2 F%2Fwww.google. com%2Faclk%3Fsa %3DL%26ai%3DB7a KJlO76SIPGEpiUt QOAg5iLAq2ot1Pd 9Mn6CdaXmQXwo1c QARgBIKj29AEoAz gBUMaXqLD6_____ wFgyQbIAQGAAgHI AqGYuAHZA2TCF_9 mH1G-%26num%3D1%26si g%3DAGiWqtzE4dJ 8v6950akv_hV5zH IHySGrjg%26q%3D http%3A%2F%2Fww w.rkdms.com%2Fr edirect%253Fc%2 53D50920722%252 6en%253D1%2526c l%253D180%2526u %253Dhttp%25253 A%25252F%25252F www.1800flowers .com%25252Frefe r.do%25253Fr%25 253Dgoogenrkg%2 52526u%25253Dda taset.do%252525 3Fdataset%25252 53D10535&0= &1=0&4= 206.29.197.150& amp;5=10.10.10. 10&9=a2bdef 1e64514dae8c1f7 44db831c901& ;10=1&11=pe monitor.api& ;13=search& 14=245874&1 5=main-title&17=1& amp;18=1&19 =1&20=1& ;21=0&22=5q zGM15%2Fwmc%3D& amp;40=oKLlDmjy xsJIBQ4SuI5EWw% 3D%3D&_IceU rl=true</site-link>
.............
Here's the problem...I registered my callback function "contents" in:
xml_set_charact er_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
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/_iceUrlFlag=1?r awURL=http%3A%2 F%2Fwww.google. com%2Faclk%3Fsa %3DL%26ai%3DB7a KJlO76SIPGEpiUt QOAg5iLAq2ot1Pd 9Mn6CdaXmQXwo1c QARgBIKj29AEoAz gBUMaXqLD6_____ wFgyQbIAQGAAgHI AqGYuAHZA2TCF_9 mH1G-%26num%3D1%26si g%3DAGiWqtzE4dJ 8v6950akv_hV5zH IHySGrjg%26q%3D http%3A%2F%2Fww w.rkdms.com%2Fr edirect%253Fc%2 53D50920722%252 6en%253D1%2526c l%253D180%2526u %253Dhttp%25253 A%25252F%25252F www.1800flowers .com%25252Frefe r.do%25253Fr%25 253Dgoogenrkg%2 52526u%25253Dda taset.do%252525 3Fdataset%25252 53D10535&0= &1=0&4= 206.29.197.150& amp;5=10.10.10. 10&9=a2bdef 1e64514dae8c1f7 44db831c901& ;10=1&11=pe monitor.api& ;13=search& 14=245874&1 5=main-title&17=1& amp;18=1&19 =1&20=1& ;21=0&22=5q zGM15%2Fwmc%3D& amp;40=oKLlDmjy xsJIBQ4SuI5EWw% 3D%3D&_IceU rl=true</site-link>
.............
Here's the problem...I registered my callback function "contents" in:
xml_set_charact er_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
Comment