XmlSchemaSet.Compile Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Compiles the XML Schema definition language (XSD) schemas added to the XmlSchemaSet into one logical schema.
public:
void Compile();
public void Compile();
member this.Compile : unit -> unit
Public Sub Compile ()
An error occurred when validating and compiling the schemas in the XmlSchemaSet.
Dim schemaSet As XmlSchemaSet = New XmlSchemaSet()
schemaSet.Add("http://www.contoso.com/books", "http://www.contoso.com/books.xsd")
schemaSet.Compile()
XmlSchemaSet schemaSet = new XmlSchemaSet();
schemaSet.Add("http://www.contoso.com/books", "http://www.contoso.com/books.xsd");
schemaSet.Compile();
This method is called automatically when validation is needed and the XmlSchemaSet has not been previously compiled - for example, when an XmlSchemaSet is used as an input to create an XmlReader object in the Schemas property of an XmlReaderSettings object. If the XmlSchemaSet is already in the compiled state, this method will not recompile the schemas. If this method executes successfully, the IsCompiled property is set to true
.
Schemas that have been previously compiled by an XmlSchemaSet are not recompiled. However, schemas that were compiled using the Compile method of the XmlSchema will be recompiled.
Бележка
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.
Продукт | Версии |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Обратна връзка за .NET
.NET е проект с отворен код. Изберете връзка, за да предоставите обратна връзка: