> when using latest xerces2 (CVS) I get two error handler calls for a
single
> failed constraint. Can someone please explain if this was indended? I
don't
> see a good reason for that.

It's intended, because we didn't think that either one of the error
messages is sufficient. And it's not (currently) possible to combine the
two messages, because they use different error codes.

> Value '2' is not facet-valid with respect to minInclusive '50'.

This message helps the user to fix the problem.

> The value '2' of element 'number' is not valid.

This message tells that it's value of the 'number' element is invalid.
Consider this:

<number att1="2">2</number>

Without this message, the user won't know which '2' is invalid.

> a) the full path to the node that cause the error

You can easily do it by yourself. We don't want other users who don't want
such list to suffer from the performance impact of computing it.

> b) not just a text message but an object (some kind of constraint or
facet
> object) that makes machine based processing based on the validation
result
> possible. AFAICS the current information is only useful if you want to
pass
> it directly to a user. I'd need to parse it to get the desired
information.
> (but that would ugly as hell...)

How do you think such object would look like? There are so many different
kinds of errors. I don't think it's possible to capture all parameters
('2', '50' in you example) of all those errors in one object. One thing you
can get out of the error message is the error code, which tells you which
constraint was violated. This doesn't solve your problem, but it might be
helpful.

Cheers,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
[EMAIL PROTECTED]



                                                                                
                              
                    Torsten Curdt                                               
                              
                    <[EMAIL PROTECTED]       To:     [EMAIL PROTECTED]          
                       
                    >                    cc:                                    
                              
                                         Subject:     validation errors         
                              
                    06/07/2002                                                  
                              
                    01:01 PM                                                    
                              
                    Please respond                                              
                              
                    to                                                          
                              
                    xerces-j-user                                               
                              
                                                                                
                              
                                                                                
                              



when using latest xerces2 (CVS) I get two error handler calls for a single
failed constraint. Can someone please explain if this was indended? I don't

see a good reason for that.

org.xml.sax.SAXParseException:
cvc-minInclusive-valid:
 Value '2' is not facet-valid with respect to minInclusive '50'.
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)

org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:173)

org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:362)

...

and

org.xml.sax.SAXParseException:
cvc-type.3.1.3:
 The value '2' of element 'number' is not valid.
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)

org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:173)

org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:362)

...

An I am also wondering if it is already possible to get some more
information
from the SAXException.

a) the full path to the node that cause the error

b) not just a text message but an object (some kind of constraint or facet
object) that makes machine based processing based on the validation result
possible. AFAICS the current information is only useful if you want to pass

it directly to a user. I'd need to parse it to get the desired information.

(but that would ugly as hell...)

Or is there already a way to get the information:

 minInclusive
 value-is: 2
 value-is-supposed-to-be: 50

out of the above exception?

Thanks
--
Torsten


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





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

Reply via email to