You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by ha...@chorus.net on 2002/07/31 23:09:36 UTC

DefaultHandler in SAX 2.0

Hello:

I am having a problem with DefaultHandler.  Here are 
before and after scenarios.

In the past, I registered ContentHandler classes and 
ErrorHandler classes independently with my 
XMLReader object using setContentHandler and 
setErrorHandler.  Everything worked fine.  I used a 
schema to validate and process my XML.  Any errors 
triggered the appropriate error callbacks.

To simplfy my code I decided to subclass 
DefaultHandler and register these subclasses using 
the same methods above with my DefaultHandler 
subclasses as arguments.  This should work right?
Well, my code parses just the same as before except 
for the error callbacks.  These callbacks do not trigger 
when I introduce errors into my XML.  However, I know 
that my schema is still processing and validating 
because parsing will terminate at schema errors.  This 
is particularly bothersome as I no longer can easily pick 
out problem areas in my XML.

Anybody have this same problem?

Duke Hamacher
hamacher@chorus.net
Madison, Wisconsin 


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


Re: DefaultHandler in SAX 2.0

Posted by Loz <lo...@flower.powernet.co.uk>.
hamacher@chorus.net wrote:
> Hello:
> 
> subclasses as arguments.  This should work right?
> Well, my code parses just the same as before except 
> for the error callbacks.  These callbacks do not trigger 
> when I introduce errors into my XML.  However, I know 
> that my schema is still processing and validating 
> because parsing will terminate at schema errors.  This 

See http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11323

or try the attached patch

it only seems to be a problem for schema validation

cheers

Loz