Validating an XML file with a schema

C

Curious

Hi,

I will be reading a series of XML files, and before extracting the data
from them, I would like to make sure that they have the correct schema.

The schema will be readily available into an xsd file. How should I
tackle this problem?

Can someone help me out
Thanks in Advance
 
M

Martin Honnen

Curious said:
I will be reading a series of XML files, and before extracting the data
from them, I would like to make sure that they have the correct schema.

The schema will be readily available into an xsd file. How should I
tackle this problem?

With .NET 1.x you would use XmlValidatingReader
<http://samples.gotdotnet.com/quickstart/howto/doc/Xml/ValidationReadingXML.aspx>
with .NET 2.0 you would use the proper XmlReaderSettings to create an
XmlReader that validates
<http://www.asp.net/quickstart/howto/doc/Xml/ValidationReadingXML.aspx>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top