Re: Perl + XML
by Geir Aalberg other posts by this author
Sep 28 2005 8:28AM messages near this date
view in the new Beta List Site
Perl + XML
|
Re: Perl + XML
& XSLT shouvanik.haldar@[...].com wrote:
> I am using XML::SAX parser.
> I am using it to parse the XML file. If the XML file has one start_tag or
> end_tag missing, then an error was thrown...and the rest of the file was
> discarded.
As mentioned, that is how an XML parser is supposed to work. Think of your
XML file as a program and the parser as a compiler. If you have a syntax
error in your program and it refuses to compile, you're better off trying to
fix the error than asking the compiler manufacturer for assistance.
Having said that, you could drop XML::Parser in favour of XML::LibXML, which
has a "recovery mode" that allows parsing of slightly malformed documents
(like 99% of all HTML on the web). It should certainly be able to cope with
a missing end tag, although the installation requirements and learning curve
are somewhat higher. See your local CPAN mirror for examples.
-geir
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Shouvanik Haldar
Geir Aalberg
Grant McLean
Mark - BLS CTR Thomas
Georg Rehm
Attila Fülöp
Attila Fülöp
Georg Rehm
|