473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to get more details from validation errors

Hi,

I have to develop an application that is supposed to accept XML data.
I already have defined an XSD schema and validation against it works
properly.

Problem appears when my client, instead of error messages like

"The value 'AAA' of attribute 'code' on element
'comm-response' is not valid with respect to
its type, 'integer'.]"

(SAXException message) would like to receive error information
codified. Client only wants to receive a code for the tag that
produced the error (in this case, we will send a code assigned to tag
'AAA') and line/column information wouldn't be enough for him.

I tried to add a ContentHandler to the parser but it seems like
content-related events are fired before the validation process so I
can't keep control on what part of the XML file is being validated.

Thanks in advanced,
Jorge
Jul 20 '05 #1
4 1723
Jorge Ortiz Claver wrote:
Problem appears when my client, instead of error messages like

"The value 'AAA' of attribute 'code' on element
'comm-response' is not valid with respect to
its type, 'integer'.]"

(SAXException message) would like to receive error information
codified. Client only wants to receive a code for the tag that
produced the error (in this case, we will send a code assigned to tag
'AAA') and line/column information wouldn't be enough for him.


In case you are using Xerces, you can overwrite the
XMLSchemaMessages.properties file. Bit of a hack, but it might work for you.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #2
Thanks,

Good shoot! It doesn't fullfit all my requirements but it's a lot more
than I expected.

Trying to go further, is there any way to do it without hacking the
Xerces jar package ... let's say a multi-language configuration or
something like that?

Thanks again
Jorge

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3
Thanks,

Good shoot! It doesn't fullfit all my requirements but it's a lot more
than I expected.

Trying to go further, is there any way to do it without hacking the
Xerces jar package ... let's say a multi-language configuration or
something like that?

Thanks again
Jorge
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #4
Jorge Ortiz wrote:
Trying to go further, is there any way to do it without hacking the
Xerces jar package ... let's say a multi-language configuration or
something like that?


You can add XMLSchemaMessage_foo.properties and set the language to 'foo'.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: MJ | last post by:
I am attempting to write a ServletFilter in Java/J2EE that checks if the incoming data is valid according to a schema. If errors occur, I want to return the error list and not proceed down the...
6
by: MickG | last post by:
Hi, I am trying to validate these values, this seems to work fine for the phone number and name but I am trying to get the program to fail to submit and set the focus on the date when 2006 is...
67
by: Scott Meyers | last post by:
I have a web site that, due to maintenance by several people, some of whom are fairly clueless about HTML and CSS, etc. (notably me), has gotten to the point where I'm pretty sure it's suffering...
2
by: Sudip Chakraborty | last post by:
Is there a way to see constraint validation errors while loading xml into a DataSet ? I'm interested in the line number in the xml file which is causing the error. I've enclosed the relevant stack...
2
by: TCORDON | last post by:
Is there a way to make the form validation highlight the fields where the errors occur? (change the backcolor of the textboxes)? And second, perform validation without postback and run some...
12
by: Nalaka | last post by:
Hi, I suddenly started getting a lot of errors from html validation (some CSS) so I followed the following instructions to disable it. If you'd rather not have these types of HTML validation...
9
by: julie.siebel | last post by:
Hello all! As embarrassing as it is to admit this, I've been designing db driven websites using javascript and vbscript for about 6-7 years now, and I am *horrible* at form validation. To be...
7
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
8
by: Bryan | last post by:
I want my business objects to be able to do this: class Person(base): def __init__(self): self.name = None @base.validator def validate_name(self): if not self.name: return
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.