ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-xml
perl-xml
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved