System.Xml.Schema.XmlSchema.Compile Method

Compiles the XML Schema Object Model (SOM) into schema information for validation. Used to check the syntactic and semantic structure of the programmatically built SOM. Semantic validation checking is performed during compilation.

Syntax

[System.Obsolete("Use XmlSchemaSet.Compile() instead.")]
public void Compile (ValidationEventHandler validationEventHandler, System.Xml.XmlResolver resolver)

Parameters

validationEventHandler
The validation event handler that receives information about the XML Schema validation errors.
resolver
The XmlResolver used to resolve namespaces referenced in include and import elements.

Remarks

If the SOM references other namespaces through the import or include elements, the XmlResolver is used to resolve these references. If the resolver is set to null, this indicates that the user does not care about resolving import or include elements. In this case, the references are not resolved. The resolver is not cached after the Compile method completes.

Note:

The XmlSchema.Compile(ValidationEventHandler, System.Xml.XmlResolver) method is obsolete in the Microsoft .NET Framework version 2.0 and has been replaced by the XmlSchemaSet.Compile method.

Note:

The XmlSchema.Compile(ValidationEventHandler, System.Xml.XmlResolver) method uses the System.Xml.XmlUrlResolver class to resolve external schemas referenced in include, import, or redefine elements by default. You can disable resolution of external schemas by passing null as the System.Xml.XmlResolver parameter.

Requirements

Namespace: System.Xml.Schema
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0