xerces-j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajiv Shivane <mur...@yahoo.com>
Subject Re: Error recovery while parsing XMLs ..
Date Fri, 04 Apr 2003 09:02:03 GMT
Hi Neeraj,

Thanks for the prompt reply. I had tried this feature.
But I am not sure if continue-on-error is same as
error-recovery. When we continue on error, the parser
does not seem to take the grammar into consideration
and hence generates lots of spurious errors. On error
recovery I would expect the parser to proceed in a
normal fashion. But, you recommend it only at
development time as there are no guarantees on normal
operation of the parser after a recovery and since it
might result in infinite loops. 

For example for the following document framgment:

  <icon >
   <small-icon>stillTypingMygif
   <large-icon>/tmp/large.gif</large-icon> 
  </icon> 

the content model for small-icon has only #PCDATA. I
would expect the parser to recover by inserting
</small-icon> into the stream before encountering
<large-icon>. But the parser recovers by changing
</icon> to </small-icon>. This results in cascading
spurious errors.

How does the error recovery work? Could you give me
some pointers as to where I can look for it in the
sources? All I could see was that in case of a fatal
error if the feature is set, then the saxexception is
not propagated.

Would appreaciate any suggestions/pointers you can
provide.

Thanks!
Rajiv

--- Neeraj Bajaj <neeraj.bajaj@sun.com> wrote:
> 
> set the following  feature to true.
>
http://apache.org/xml/features/continue-after-fatal-error
> 
> You should be completely aware of the fact that
> there is no guarntee 
> that parser will behave in normal fashion after
> encountering fatal 
> error. It is advisable to use this feature only
> during development time 
> and NEVER at the production time. XML document
> should be corrected as 
> the first step. Please read the feature
> documentation [1] for more detail.
> 
> 
> [1] http://xml.apache.org/xerces2-j/features.html
> 
> 
> Neeraj
> 
> 

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


Mime
View raw message