> Hi Robert,
> Xerces does the validation of an element after the element is 
> closed, so 
> that it has a list of child nodes to look at.
> You will always get parsing errors as soon as they are 
> encountered; only 
> validation errors will be reported after the endElement notification.

Oh, I see. And to be honest I did not expect another answer as I was told
Xerces handles this the same way for a long time.

In my case to be sure bad XML does not break the SAX handler code I have to
implement an empty ContentHandler to be run before the real parsing is donne
just to get hold of validation errors.

One could say: well why not do this with DOM? And the answer is: a lot of
SAX handler code would have to be rewritten and this code has evolved for 4
years now.

Anyway, maybe some of the validation code of Xerces could be improved to
report wrong order of child elements before their parent is closed. 
This would reduce a lot of responsibility out of any SAX handler code and I
am not sure if all SAX writers are aware of this as I was not for a long
time.

Thanks for the quick answer Alberto

 Robert

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

Reply via email to