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 schemalocation in xml?

462


Aren't xml, sgml, and html all the same thing?

596


What is the format of xml file?

452


What are the various advantages of xsl?

511


What is difference between xml and xhtml?

449






What does smil stand for and what is it used for?

493


How do I use xml namespaces with dom level 2?

465


How to use element in XSLT?

568


Explain the used of the xml prolog section.

486


Are you ready to relocate? : xslt

466


State and explain about xml encoding errors?

512


Write syntax to serialize class using XML Serializer?

510


What is xml dtd?

458


What is the function of smon?

523


How do I undeclare an xml namespace prefix?

521