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

How do I view xml data?

543


What is the purpose of xml namespaces?

595


What are xml attributes?

520


What are advantages of xml?

526


What is the difference between xml and http?

510






Explain about the dtd features?

595


What is the difference between xsl and xsd?

524


What are the types of XML Parsers?

627


What is xml dtd?

526


Write a code for xml attribute and element.

533


What is the difference between versions 1.0 and 1.1 of the xml namspaces recommendation?

561


What is rss subscription?

525


How xml makes your data more available?

521


Why is my rss feed not working?

520


If I replace my Sqlserver with XML files and how about handling the same ?

1838