Schema Set. Reprocess(XmlSchema) Method
Reprocesses an XML Schema definition language (XSD) schema that already exists in the XmlSchemaSet.
public: System::Xml::Schema::XmlSchema ^ Reprocess(System::Xml::Schema::XmlSchema ^ schema);
public System.Xml.Schema.XmlSchema Reprocess (System.Xml.Schema.XmlSchema schema);
member this.Reprocess : System.Xml.Schema.XmlSchema -> System.Xml.Schema.XmlSchema
Public Function Reprocess (schema As XmlSchema) As XmlSchema
The schema to reprocess.
An XmlSchema object if the schema is a valid schema. If the schema is not valid and a ValidationEventHandler is specified,
null is returned and the appropriate validation event is raised. Otherwise, an XmlSchemaException is thrown.
The schema is not valid.
The following example illustrates reprocessing a schema added to the XmlSchemaSet. After the XmlSchemaSet is compiled using the Compile method, and the schema added to the XmlSchemaSet is modified, the IsCompiled property will be set to
true, even though a schema in the XmlSchemaSet has been modified. Calling the Reprocess method performs all the preprocessing performed by the Add method and sets the IsCompiled property to
Dim schemaSet As XmlSchemaSet = New XmlSchemaSet() Dim schema As XmlSchema = schemaSet.Add("http://www.contoso.com/books", "http://www.contoso.com/books.xsd") schemaSet.Compile() Dim element As XmlSchemaElement = New XmlSchemaElement() schema.Items.Add(element) element.Name = "book" element.SchemaTypeName = New XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema") schemaSet.Reprocess(schema)
XmlSchemaSet schemaSet = new XmlSchemaSet(); XmlSchema schema = schemaSet.Add("http://www.contoso.com/books", "http://www.contoso.com/books.xsd"); schemaSet.Compile(); XmlSchemaElement element = new XmlSchemaElement(); schema.Items.Add(element); element.Name = "book"; element.SchemaTypeName = new XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema"); schemaSet.Reprocess(schema);
You need to call the Reprocess method if you have changed a schema (or one of its includes/imports) after adding it to the XmlSchemaSet. The Reprocess method will check the schema for structural validity according to the rules of W3C XML Schema. However, it will not perform a full validation check. It will also resolve references to internal and external schema components. Any imported or included schemas that are successfully retrieved are also added to the XmlSchemaSet. Imported schemas are added as separate XmlSchema objects while included schemas are made part of the including XmlSchema. If the call to reprocess is successful, the IsCompiled property is set to false.