Validating an XML file with a schema

  • Thread starter Thread starter Curious
  • Start date Start date
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
 
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>
 
Back
Top