in reply to Re^3: Bug in XML::Parser
in thread Bug in XML::Parser

Thanks graff. You have been great help. Yes, you are right about stressing on the point about OP and point is well taken. I understand your solution. But, what still confounds me completely is how the XML::Parser is able to detect the badly formed XML file even if the program is parsing one line at a time. This obviously could be because my understanding of the XML::Parser is limited. One of the unintended consequences that your reply had gave me an insight into a problem that I had earlier, but never got around asking the permonks site. Aren't unintended consequences great when they turn out to be good? Thanks macho again!

Replies are listed 'Best First'.
Re^5: Bug in XML::Parser
by graff (Chancellor) on Oct 23, 2013 at 21:03 UTC
    If you happen to be passing one line at a time to the parser, and your input xml file happens to contain a close tag all by itself on one line (or a portion of a complicated open tag that has been broken up into multiple lines), I expect the parser would fail at that point. (At least, xmllint wouldn't accept such a file.)

    (Update: actually, if the data contains just a complete open tag on one line, and you pass that to an xml parser, that should fail as well.)