473,248 Members | 1,230 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,248 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 1606
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: COHENMARVIN | last post by:
I'm just starting out in XML for my business, and already I'm given a large and complicated XML schema. If I write XML files based on the schema, is there any tool that 1. Tells me if I'm valid...
1
by: Prodika | last post by:
With the 1.0 Framework, I've worked out using the XmlValidatingReader. Since I'm using the validation errors as feedback to the end user, I'm hoping to get away from techy messages such as "The...
2
by: PeterW | last post by:
I have an xml file from which I want to generate an xsd schema and at a later stage a cs class. The xml file has a mix of defined namespaces and also an empty namespace. These are defined as...
2
by: Ian | last post by:
I've inherited some xml that doesn't have a namespace and doesn't have a reference to the schema. The schema doesn't have a targetNamespace attribute. I'm trying to build a test tool, in C#, which...
4
by: Geir Aamodt | last post by:
I have an xml schema and an xml file. When parsing the xml file I would like to perform operations on elements marked in the schema with the "search:able" attribute. See sample files below. Any...
0
by: c.w.browne | last post by:
Hi, Ive had a bit of a look around for other people with this problem and cant find anything that solves it in my case, so I'm afraid im going to have to bother you all with a post of my own. ...
1
by: Chris Lieb | last post by:
I have an XML Schema file that I know is correct becuase I currently use it in a VB6 program to validate XML documents. Also, if I load an XML file into VS2005 that is not valid against this...
3
by: Martin Eckart | last post by:
Hi guys, I have an XML Schema and I am validation many XML files against the schema. If successful, the files get transferred to another location. If not, then I would like to add an error tag...
7
by: =?Utf-8?B?Q29kZVJhem9y?= | last post by:
I wrote a method to validate and xml file against a schema. If the file does not conform to the schema, it throws an error. It works fine except for one curious thing. If I try to validate an...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.