I sure haven't seen anything like this,
Here is my wishlist for improvements in the validation framework.
I think my number 2 is similar to what you're requesting here.

1) Currently, when the validator encounters an exception, it punts right away (punt 
like in American football).
Instead, the validator should make an attempt to validate as much of the 
document/object as possible.

2) The code that uses castor should be able to programmatically inspect the validation 
errors.  
Currently, if your code wants to know which element is 'broken',
you'll need to parse the english text of the validation exception (this is ugly).
It would be better to have an API that enumerated the errors via a data structure or 
something like that.

3) i18n.  the sol'n must enable multiple language versions of the a single validation 
error.
This solution could be built on top of the above item (2).  I think rendering 
the message into a particular language could be (and should be) easily be separated 
from the validation framework.


-----Original Message-----
From: Subodh Damle [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 15, 2004 4:33 AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] ValidationException : how to determine exact XML
data error




>From ValidationException, is it possible to determine the name of XML
element whose validation failed ?

For ex, if there is a element 'el' whose validation given in schema
fails during unmarshal, 
        then is there any way to get the name 'el' from
ValidationException ?

I am thinking of extending FieldValidators & ValidationException to
include an error code .
Is something like this already implemented by anyone ?


Thanks,
S


*********************************************************
Disclaimer:          

This message (including any attachments) contains 
confidential information intended for a specific 
individual and purpose, and is protected by law. 
If you are not the intended recipient, you should 
delete this message and are hereby notified that 
any disclosure, copying, or distribution of this
message, or the taking of any action based on it, 
is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to