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 dom? What is it used for?

639


How is xml structured?

606


What is an rss subscription?

619


What are the components of xml?

620


Can we use xml for database purpose in html?

606


What is the difference between XML Serialization and Binary Serialization?

660


What are the elements of xml?

638


How to use element in XSLT?

731


What is xsd used for?

632


Explain the classes in System.XML Namespace?

686


What is XSLT data model?

716


What is the format of xml file?

627


How to perform XML transformation in Java?

676


Why not just carry on extending html?

682


How do I run an xml file in notepad?

614