I think that the parser quits when it hits its first error because it
literally can't continue.  Parsers aren't as smart as people.  They can't
recover from syntax errors as well as we can (that's why when you write a
perl program that has a syntax error in it, usually only the first error
that the parser reports is worth paying attention to).  People tend to
understand each other even when they aren't speaking grammatically
correctly.  For parsers, a miss is as good as a mile.

If you want to find all the errors in your XML file, I believe you'll have
to correct them one by one.

-ted


----- Original Message -----
From: "ravikanth gangarapu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 19, 2002 1:05 AM
Subject: need to get all parsing errors


> Hi
>    How can I make my parser report all errors in a document while
> parsing it?
> I did something like
> my $p = XML::Xerces::DOMParser->new();
> $p->setDoNamespaces(1);
> ......
> ......
> $p->setExitOnFirstFatalError(0);
>
> validation is off.
>
> eval
> {
>   $p->parse(XML::Xerces::LocalFileInputSource->new("$file"));
> };
>
> if($@)
> {
>   open(MYFILE, ">>./errors") or die "$!";
>    print  MYFILE $@ ;
>   close MYFILE;
> }
>
> But, MYFILE file contains only the first error parser encounters.
> how can I retrieve all errors?
>
> thanks for help
> grk
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to