xerces-j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stef Epardaud <s...@lunatech.com>
Subject Re: Bug: infinite recursion with wrong ENTITY declaration
Date Fri, 04 Apr 2003 08:04:40 GMT
On Fri, Apr 04, 2003 at 11:29:24AM +0000, Neeraj Bajaj wrote:
>     Attached is an XML document that will trigger an infinite recursion in
>     Xerces2 if parsed. This is without stopping at fatal errors, but it
>     seems it cannot recover properly enough to parse the rest of the
>     document. I have found a patch to avoid the infinite recursion,
> 
> Parser behavior is not determined after it encounters fatal error. But its
> good to avoid such behavior so please send your patch.

ok, patch attached.

> There is a feature  http://apache.org/xml/features/continue-after-fatal-error
> which allows you to parse the document after it encounters fatal error, so as
> to recover further error from the document. But you should correct the XML
> file at the first place. Please read the feature documentation [1] for more
> detail.

Yes I know, I'm already using it. the problem is that I expect the
parser to recover after the wrong ENTITY declaration, in order to try to
catch more errors (if any), but with my fix it just prevents it from
doing that infinite loop, but does not help recovering. So since it
cannot recover it becomes so crooked that it reports a dozen error
messages which do not make any sense, since there was only one error.
Be warned that my patch just makes sure xerces finishes parsing with
reporting at least the ENTITY error correctly, the subsequent errors are
likely to make no sense at all.

Regards.
-- 
# Stef Epardaud, # Teachers have potentially more power than military,
# Java Defeater  #   the former can teach us how to not need the latter.
#     Earth      # Lunatech Research,
#  Solar System  #   soon we'll quit researching and start finding...

Mime
View raw message