Hi all Well firstly there's a bug in the message here. In your case the message should read:
cvc-maxLength-valid.1.1: string length (9) is greater than maxLength facet (2) for 'yourType' where yourType is QName of the schema type causing the problem. This would be far more helpful and was clearly the intention of the code - someone just put the {0}, {1} etc in the wrong place in the message properties file. I'll fix that and once it's in the message should be far more user-friendly. But secondly here's some general stuff you can do with these error messages. A) Some of the other API's on XmlError could do what you want. For instance when you use scomp we print out line and column numbers for the error - these come from XmlError.getLine() and getColumn(). B) There's also XmlError.getLocation(). According to the comments in the code (I've never used it myself) you pass it XmlCursor.class or XmlObject.class and you get back either the cursor or the XmlObject at that position (provided of course that XmlBeans can construct one). C) Also it's probably worth pointing out that the first part of the "cryptic message" is actually a pointer to the part of the XML Schema spec that is being violated. So in your case the error message has "cvc-maxLength-valid.1.1" in it. Open up the schema spec at http://www.w3.org/TR/xmlschema-1/ and search for cvc-maxLength-valid. You'll find a link to the following page: http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#cvc-ma xLength-valid We are then reporting that step 1.1 of that algorithm is being violated - which (as you say) corresponds to too many characters according to the maxLength facet of the type in question. Hope that helps. Cheers, Lawrence > -----Original Message----- > From: Edward Frederick [mailto:[EMAIL PROTECTED] > Sent: Friday, March 03, 2006 8:32 AM > To: user@xmlbeans.apache.org > Subject: Re: [2.0] validation > > I was wondering the same thing, actually. > > I bet there's not much hope outside of traversing the model directly > so you know where the validation failures occur. > > Look forward to hearing the responses. > > Ed > > On 3/3/06, Nathaniel Auvil <[EMAIL PROTECTED]> wrote: > > When i validate my XmlObject, i get a cryptic message as in: error: > > cvc-maxLength-valid.1.1: string length (string) is greater than > maxLength > > facet (9) for '2' > > > > How do i get more information, as in, the specific element which is > invalid > > so i can tell the user that: "hey, the: 'userName' element is too big" > > > > when i try to use the other methods on the XmlError type i get: > > error.getMessage()= error: cvc-maxLength-valid.1.1: string length > (string) > > is greater than maxLength facet (9) for '2' > > error.getSourceName()= null > > error.getCursorLocation().xmlText()= <xml-fragment xmlns=""/> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] _______________________________________________________________________ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]