all groups > dotnet xml > june 2005 >
You're in the

dotnet xml

group:

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


How can I generate a user friendly error message when validating XML against a schema? Joakim Olesen
6/20/2005 12:00:00 AM
dotnet xml:
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.

Re: How can I generate a user friendly error message when validating XML against a schema? Zafar Abbas
6/20/2005 9:46:48 AM
Yes, line number and position is the only information that you have to work
with.

[quoted text, click to view]

Re: How can I generate a user friendly error message when validating XML against a schema? Daniel Cazzulino [XML MVP]
6/30/2005 12:00:00 AM
You could use Schematron ;)

[quoted text, click to view]

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

AddThis Social Bookmark Button