473,395 Members | 1,418 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,395 software developers and data experts.

Find records that do not conform to schema

We have an application right now that determines if an XML document sent in
conforms to schema. What we have now been asked to do is add functionality
that creates an exception report for all records that do not conform to our
schema (XSD). One of the team members has built some functionality that loops
through the records, node by node, and determines which nodes do not conform,
but it is taking way too long to develop.

Does anyone know a quicker way to develop this with the .NET XML classes? We
are at brainstorming stage, so any ideas are potential winners.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
Nov 12 '05 #1
2 1341
Xml Schema validation would be a good solution for your problem.

Given an XML document, and a XSD Schema document it needs to conform to, you
can use the XmlValidatingReader class in .NET 1.1 (XmlReader class in .NET
2.0 beta2) to read the document and associate it with the corresponding
schema. The reader goes through the documents and reports all errors it
encountered through an exception handler which also has line number and line
position information and also a good descriptive error message of what the
problem was. You could use this handler to construct your error report for
the data.

more details on how to use XmlValidatingReader to validate is at:
http://msdn.microsoft.com/library/de...ithschemas.asp

Thanks,
Zafar

"Cowboy (Gregory A. Beamer) - MVP" <No************@comcast.netNoSpamM> wrote
in message news:22**********************************@microsof t.com...
We have an application right now that determines if an XML document sent in conforms to schema. What we have now been asked to do is add functionality
that creates an exception report for all records that do not conform to our schema (XSD). One of the team members has built some functionality that loops through the records, node by node, and determines which nodes do not conform, but it is taking way too long to develop.

Does anyone know a quicker way to develop this with the .NET XML classes? We are at brainstorming stage, so any ideas are potential winners.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

Nov 12 '05 #2
Thank you for your response.

I was planning on looking at the XmlValidatingReader as at least part of the
solution. I briefly examined the documenation, but did not see the list of
exceptions portion. I guess I need a more complete study.

As long as I can discover bad nodes (exceptions) and walk up to get the node
for the entire record, it should fit very nicely with the application. Thank
you again for your quick answer.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Zafar Abbas" wrote:
Xml Schema validation would be a good solution for your problem.

Given an XML document, and a XSD Schema document it needs to conform to, you
can use the XmlValidatingReader class in .NET 1.1 (XmlReader class in .NET
2.0 beta2) to read the document and associate it with the corresponding
schema. The reader goes through the documents and reports all errors it
encountered through an exception handler which also has line number and line
position information and also a good descriptive error message of what the
problem was. You could use this handler to construct your error report for
the data.

more details on how to use XmlValidatingReader to validate is at:
http://msdn.microsoft.com/library/de...ithschemas.asp

Thanks,
Zafar

"Cowboy (Gregory A. Beamer) - MVP" <No************@comcast.netNoSpamM> wrote
in message news:22**********************************@microsof t.com...
We have an application right now that determines if an XML document sent

in
conforms to schema. What we have now been asked to do is add functionality
that creates an exception report for all records that do not conform to

our
schema (XSD). One of the team members has built some functionality that

loops
through the records, node by node, and determines which nodes do not

conform,
but it is taking way too long to develop.

Does anyone know a quicker way to develop this with the .NET XML classes?

We
are at brainstorming stage, so any ideas are potential winners.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************


Nov 12 '05 #3

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

Similar topics

17
by: Steve Jorgensen | last post by:
Terminology question: Is there a term for a set of records related directly or indirectly by key value in several tables? For example, a single invoice record and its line item records -or- a...
8
by: tom | last post by:
I am new to SQL administration. >From a list of IDs that are the primary key in one table (i.e. Customer Table), I want to make changes in tables that use those IDs as a foreign key. ...
6
by: Jeff Kowalczyk | last post by:
I need to adapt this an update statement to a general form that will iterate over multiple orderids for a given customerinvoiceid. My first concern is a form that will work for a given orderid,...
0
by: Derek | last post by:
I am creating an intranet using Visual Web Developer Express Edition. Everything has been working OK until yesterday when I started getting 62 messages all beginning "Could not find schema...
0
by: jhansen | last post by:
I am getting informational warnings about the following app.config and indicate the following. I am using C# visual studio 2005 and used the Settings.settings to set up my values scoped as...
16
by: TT (Tom Tempelaere) | last post by:
Hi all, I created an XSD to define the structure of an XML file for my project. I made an XML file linked to the XSD using XmlSpy. The problem is that if I read the file using .NET XmlDocument...
7
by: Laurence | last post by:
Hi folks, Who knows how to retrieve the owner of SQL objects, such as SCHEMA, TABLE etc.? Is GRANTOR within catalog view owner? Thanks, Laurence
24
by: Frank Swarbrick | last post by:
We have a batch process that inserts large numbers (100,000 - 1,000,000) of records into a database each day. (DL/I database.) We're considering converting it to a DB2 table. Currently we have...
1
by: Christopher M. | last post by:
I'm exporting XML from Access. There is an option to not export key and index information to a schema (XSD) file, but there's no option for the XML file. What I've been doing is using editors...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
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
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...

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.