473,404 Members | 2,137 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,404 software developers and data experts.

ValidationEventArgs.Exception.SourceSchemaObject always null!

Rob
Here's my problem: I'm validating a XML file that I generate vs a static
schema file, and am trying to get all the validation errors into a format
that can be understood by a non-technical user. So I'm registering a
ValidationEventHandler with the XmlValidatingReader's delegate, and can get
the ValidationEventArgs just fine. Great.

Problem is that I need to get the specific element out of the
ValidationEventArgs.Exception object so that I can translate what the problem
is into plain english for my non-technical users. But the
ValidationEventArgs.Exception.SourceSchemaObject is ALWAYS NULL!

Grr. Anyone know why this might be? I can't seem to find anyone else doing
this via web-searches. Nothing on this forum that I can see. Without the
SourceSchemaObject, I can't tell the user specifically what the problem is
because I can't get the XML Element that's causing the problem.

And the ValidationEventArgs.Message is too techincal for my users. I need to
get the SourceSchemaObject so that I can pass this to another class I've
created to generate a more user-friendly message.

Anyone? Little help here?

Dec 19 '05 #1
0 1416

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

Similar topics

2
by: Chris Herring | last post by:
Hi there: Well, let me start off by saying that I am a Visual Studio drag and drop weenie, not a real programmer. So I tend to get confused when things do not look like the instructions said they...
0
by: Rishabh.Dayal | last post by:
Hi, I always get a null exception while using XPATH Saxon-8b. I am using this for the first time. My xml document is: <foo xmlns="default-namespace"> <ns1:bar xmlns:ns1="namespace1-uri"...
0
by: dummy | last post by:
Hi, I know there's a way to check the private res property of the ValidationEventArgs class, using reflection. There are number of possible values for this (string) property, for example...
44
by: craig | last post by:
I am wondering if there are some best practices for determining a strategy for using try/catch blocks within an application. My current thoughts are: 1. The code the initiates any high-level...
0
by: Joe | last post by:
Reposting here as there were no useful replies in the dotnet.framework NG... What is the correct pattern for handling exceptions in IDisposable.Dispose, especially in a class that manages...
40
by: Kevin Yu | last post by:
is it a bad programming design to throw exception in the try block then catch it??
16
by: Chuck Cobb | last post by:
I'm implementing a centralized exception handling routine using the Enterprise Library Exception Management Application Block. I trap all unhandled exceptions to one place using the following...
1
by: metsys | last post by:
We have an ASP.NET 2.0 (C#) application that is divided into multiple layers. The multiple layers come from having a web project and 2 different class library projects in the same solution. I'm...
3
by: matko | last post by:
This is a long one, so I'll summarize: 1. What are your opinions on raising an exception within the constructor of a (custom) exception? 2. How do -you- validate arguments in your own...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.