Code for Document Validation in XML.NET?
Answer / Shrishti
In .NET, you can use the XmlReaderSettings and XmlValidatingReader classes to validate an XML document. Here's a simple example:
```csharp
XmlReaderSettings settings = new XmlReaderSettings();
settings.ValidationType = ValidationType.Schema;
settings.Schemas.Add("", "YourXsdFile.xsd");
using (XmlReader reader = XmlReader.Create("YourXmlFile.xml", settings))
{
using (XmlValidatingReader validatingReader = new XmlValidatingReader(reader))
{
validatingReader.Read();
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Give coding for Implementing a Fixed GridView Header in ASP.NET?
How to get Dynamically Linked Comboboxes Set?
How to Create Scrollable Micro Windows?
Code for Using Keyboard Events?
working with fileUpload ?
what is software testing
Data Reader Vs DataSet
Code for Communicating over Sockets?
what is the value that reside in a hidden field when no value is assigned to it?how it can be used in a if statement??
How to send e-mail from an ASP.NET application?
16 Answers DataPoint, Infosys, Persistent, Radar, TCS, Wipro,
how to track links visited in google using iframes
how to upload an excel in c# ASP.Net?