467,146 Members | 1,124 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,146 developers. It's quick & easy.

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
  • viewed: 1185
Share:
2 Replies
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Derek | last post: by
16 posts views Thread by TT (Tom Tempelaere) | last post: by
7 posts views Thread by Laurence | last post: by
24 posts views Thread by Frank Swarbrick | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.