Validating xml data with xmlreader dating globes

The value in the last element will be used in a report of errors in the xml. Add(null, tr); Xml Reader Settings settings = new Xml Reader Settings(); settings. private bool Validate With Schema(ref Stream xsd, ref Stream xml) { try { Xml Text Reader tr = new Xml Text Reader(xsd); Xml Schema Set schema = new Xml Schema Set(); schema. Validation Event Handler += new Validation Event Handler(this. Create(xml, settings); // Validate XML data while (reader. Close(); return true; } catch { return false; } finally { xml. Close(); } } private void Error Handler(object sender, Validation Event Args args) { XMLSchema Violations obj Violations = new XMLSchema Violations(); Type obj Ex Type = typeof(Xml Schema Exception); Field Info finfo Element = obj Ex Type.

validating xml data with xmlreader-6

Suppose an element nested within the master element doesnot conform with the schema.

This project element will again contain a sequence of elements, where two of these elements are again complex element(they will contain some custom more elements within them).

Lets say that my data from the excel file contains a root element, a sequence of elements named project.

This xml text that I read from the excel file has to undergo a validation process against a schema.

Exception); } okay, I have to read data from an excel file and the data is sent to the db as an xml text.

Last modified 18-Nov-2015 08:47