How do you load XML document and perform validation of the
document?

Answer Posted / bilal hanbali

1- XmlTextReader:We will use it just to load the XML
Document we want to Validate using Class Constructor which
take the file name as parameter
XmlTextReader xReader = new XmlTextReader(string
url_or_FilePath);

2- XmlSchema Class:Contains the definition of a schema
XmlSchema xmlSchema = XmlSchema.Read(xReader,
new ValidationEventHandler(SchemaReadError));

3-XmlSchemaCollection:From its name, it is a Colletion of
Schemas that will be used to validate the XML Documents

4-XmlValidatingReader:Represents a reader that provides
DTD, XML-Data Reduced (XDR) schema, and XML Schema
definition language (XSD) schema validation.

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the information contained inside the xml file?

452


Can we use xml for database purpose in html?

454


Are xml tags case sensitive?

474


What is the best rss feed reader?

502


Can excel read xml?

462






What are xml technologies?

477


How are comments used in xml?

461


What are the main features of xml?

464


What is use of rss feed in website?

459


What is excel xml format?

452


Does xml support user-defined tags?

488


Can we generate xsd from xml?

477


Can xml use non-latin characters?

522


What do you understand by svg and smil? Give examples

487


How do I create an xml file from excel?

436