471,594 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

How can I generate a user friendly error message when validating XML against a schema?

Hello

When validating xml against a schema, the most frequent error I get is
something like "The 'FOO' attribute has an invalid value according to its
data type. An
error occurred at , (25, 913)". That error message is not very user
friendly, so I'd like to extract the data in the failing node along with its
parent node data, and show that to the user.

Do you know a way to do this? I don't think there's any other information
about the error position than the line number and position.
Nov 12 '05 #1
2 1541
Yes, line number and position is the only information that you have to work
with.

"Joakim Olesen" <jo*@logosconsult.dk> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hello

When validating xml against a schema, the most frequent error I get is
something like "The 'FOO' attribute has an invalid value according to its
data type. An
error occurred at , (25, 913)". That error message is not very user
friendly, so I'd like to extract the data in the failing node along with its parent node data, and show that to the user.

Do you know a way to do this? I don't think there's any other information
about the error position than the line number and position.

Nov 12 '05 #2
You could use Schematron ;)

Zafar Abbas wrote:
Yes, line number and position is the only information that you have to work
with.

"Joakim Olesen" <jo*@logosconsult.dk> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hello

When validating xml against a schema, the most frequent error I get is
something like "The 'FOO' attribute has an invalid value according to its
data type. An
error occurred at , (25, 913)". That error message is not very user
friendly, so I'd like to extract the data in the failing node along with


its
parent node data, and show that to the user.

Do you know a way to do this? I don't think there's any other information
about the error position than the line number and position.



--
*Daniel Cazzulino** [MVP XML]*
Clarius Consulting SA
http://clariusconsulting.net/kzu

"He who is good for making excuses, is seldom good for anything else."
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by COHENMARVIN | last post: by
2 posts views Thread by PeterW | last post: by
4 posts views Thread by Geir Aamodt | last post: by
reply views Thread by c.w.browne | last post: by
3 posts views Thread by Martin Eckart | last post: by
7 posts views Thread by =?Utf-8?B?Q29kZVJhem9y?= | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

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.