Xmlvalidatingreader xsd c
I writing a WCF service to get a xml file as input and validate it against a schema. But I don't know how to write method in WCF service to get xml file as input.
Below i have given code i have written in WCF service.
Microsoft has created a language called XML Schema Definition (XSD) to help in validating an XML file against a schema. A schema-validator can be created to validate an XML file against a schema.
Assume the following XML document: The Xml Reader class is used to open the XML file and the XSD file.
Methods are called for the document, elements, attributes, and other types of nodes.
The top part of Figure 1 shows how the DOM parser produces a tree of nodes.
The Xml Validating Reader class is used to create a validating reader.
The Add() method of the Xml Schema Collection adds namespaces to the schema collection.
The middle part of Figure 1 illustrates the SAX approach to parsing.
The downside of this approach is that keeping track of the current context of an element or attribute in a complex document can be difficult.