good chemistry is complicated,
and a little bit messy -LW
XML::Parser breaks onby r.joseph (Hermit)
|on Aug 16, 2001 at 11:59 UTC||Need Help??|
r.joseph has asked for the
wisdom of the Perl Monks concerning the following question:
Hello again everyone,
Been a long time since my last post, but I am really stuck this time, and can't figure why.
I am using XML::Parser to parse .RSS documents from Linux.com and Newsforge.net for a "live news feed" if you will. First, below is a snippet from Linux.com's RSS doc:
Now, if you look at the <link> tag, you see that there is a proper sequence, & to represent an ampersand. However, here is the problem. When XML::Parser encounters this chunk of data, it calls the Char handler, whatever you define it to be. Mine happens to be very simple, atleast right now (BTW, I am using the Subs style for the parser, but tha shouldn't matter):
So I should expect a simple string that has Link: and then the link, whatever that may be. However, it seems that XML::Parser instead, for some reason, splits on that escape sequence, so I get this output:
What I CANNOT figure out is why it seems to consider that string within the <link> element three strings!
Does anyone know how this can be fixed - I have seen this problem happen with other "non-element" data, and I just want it to grab all of the pertient data at one time.
Thanks a ton!
r. j o s e p h
"Violence is a last resort of the incompetent" - Salvor Hardin, Foundation by Issac Asimov