XmlSchema.Compile 方法  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将 XML 架构对象模型 (SOM) 编译为架构信息供验证使用。 用于检查以编程方式生成的 SOM 的语法和语义结构。 语义验证检查在编译期间执行。
重载
| Compile(ValidationEventHandler) | 
							 
		已过时.
	 
	
		已过时.
	 
	
		已过时.
	 
将 XML 架构对象模型 (SOM) 编译为架构信息供验证使用。 用于检查以编程方式生成的 SOM 的语法和语义结构。 语义验证检查在编译期间执行。  | 
        	
| Compile(ValidationEventHandler, XmlResolver) | 
							 
		已过时.
	 
	
		已过时.
	 
	
		已过时.
	 
将 XML 架构对象模型 (SOM) 编译为架构信息供验证使用。 用于检查以编程方式生成的 SOM 的语法和语义结构。 语义验证检查在编译期间执行。  | 
        	
注解
重要
方法Compile在 Microsoft .NET Framework 2.0 版中已过时,已被 方法替换XmlSchemaSet.Compile。
Compile(ValidationEventHandler)
- Source:
 - XmlSchema.cs
 
- Source:
 - XmlSchema.cs
 
- Source:
 - XmlSchema.cs
 
注意
Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. https://go.microsoft.com/fwlink/?linkid=14202
注意
XmlSchema.Compile has been deprecated. Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation.
注意
Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. http://go.microsoft.com/fwlink/?linkid=14202
将 XML 架构对象模型 (SOM) 编译为架构信息供验证使用。 用于检查以编程方式生成的 SOM 的语法和语义结构。 语义验证检查在编译期间执行。
public:
 void Compile(System::Xml::Schema::ValidationEventHandler ^ validationEventHandler);
	[System.Obsolete("Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. https://go.microsoft.com/fwlink/?linkid=14202")]
public void Compile(System.Xml.Schema.ValidationEventHandler? validationEventHandler);
	[System.Obsolete("XmlSchema.Compile has been deprecated. Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation.")]
public void Compile(System.Xml.Schema.ValidationEventHandler? validationEventHandler);
	[System.Obsolete("Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. http://go.microsoft.com/fwlink/?linkid=14202")]
public void Compile(System.Xml.Schema.ValidationEventHandler validationEventHandler);
	[System.Obsolete("Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. https://go.microsoft.com/fwlink/?linkid=14202")]
public void Compile(System.Xml.Schema.ValidationEventHandler validationEventHandler);
	public void Compile(System.Xml.Schema.ValidationEventHandler validationEventHandler);
	[<System.Obsolete("Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. https://go.microsoft.com/fwlink/?linkid=14202")>]
member this.Compile : System.Xml.Schema.ValidationEventHandler -> unit
	[<System.Obsolete("XmlSchema.Compile has been deprecated. Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation.")>]
member this.Compile : System.Xml.Schema.ValidationEventHandler -> unit
	[<System.Obsolete("Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. http://go.microsoft.com/fwlink/?linkid=14202")>]
member this.Compile : System.Xml.Schema.ValidationEventHandler -> unit
	member this.Compile : System.Xml.Schema.ValidationEventHandler -> unit
	Public Sub Compile (validationEventHandler As ValidationEventHandler)
	参数
- validationEventHandler
 - ValidationEventHandler
 
验证事件处理程序,它接收 XML 架构验证错误的相关信息。
- 属性
 
注解
重要
方法Compile在 Microsoft .NET Framework 2.0 版中已过时,已被 方法替换XmlSchemaSet.Compile。
适用于
Compile(ValidationEventHandler, XmlResolver)
- Source:
 - XmlSchema.cs
 
- Source:
 - XmlSchema.cs
 
- Source:
 - XmlSchema.cs
 
注意
Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. https://go.microsoft.com/fwlink/?linkid=14202
注意
XmlSchema.Compile has been deprecated. Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation.
注意
Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. http://go.microsoft.com/fwlink/?linkid=14202
将 XML 架构对象模型 (SOM) 编译为架构信息供验证使用。 用于检查以编程方式生成的 SOM 的语法和语义结构。 语义验证检查在编译期间执行。
public:
 void Compile(System::Xml::Schema::ValidationEventHandler ^ validationEventHandler, System::Xml::XmlResolver ^ resolver);
	[System.Obsolete("Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. https://go.microsoft.com/fwlink/?linkid=14202")]
public void Compile(System.Xml.Schema.ValidationEventHandler? validationEventHandler, System.Xml.XmlResolver? resolver);
	[System.Obsolete("XmlSchema.Compile has been deprecated. Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation.")]
public void Compile(System.Xml.Schema.ValidationEventHandler? validationEventHandler, System.Xml.XmlResolver? resolver);
	[System.Obsolete("Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. http://go.microsoft.com/fwlink/?linkid=14202")]
public void Compile(System.Xml.Schema.ValidationEventHandler validationEventHandler, System.Xml.XmlResolver resolver);
	[System.Obsolete("Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. https://go.microsoft.com/fwlink/?linkid=14202")]
public void Compile(System.Xml.Schema.ValidationEventHandler validationEventHandler, System.Xml.XmlResolver resolver);
	public void Compile(System.Xml.Schema.ValidationEventHandler validationEventHandler, System.Xml.XmlResolver resolver);
	[<System.Obsolete("Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. https://go.microsoft.com/fwlink/?linkid=14202")>]
member this.Compile : System.Xml.Schema.ValidationEventHandler * System.Xml.XmlResolver -> unit
	[<System.Obsolete("XmlSchema.Compile has been deprecated. Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation.")>]
member this.Compile : System.Xml.Schema.ValidationEventHandler * System.Xml.XmlResolver -> unit
	[<System.Obsolete("Use System.Xml.Schema.XmlSchemaSet for schema compilation and validation. http://go.microsoft.com/fwlink/?linkid=14202")>]
member this.Compile : System.Xml.Schema.ValidationEventHandler * System.Xml.XmlResolver -> unit
	member this.Compile : System.Xml.Schema.ValidationEventHandler * System.Xml.XmlResolver -> unit
	Public Sub Compile (validationEventHandler As ValidationEventHandler, resolver As XmlResolver)
	参数
- validationEventHandler
 - ValidationEventHandler
 
验证事件处理程序,它接收有关 XML 架构验证错误的信息。
- resolver
 - XmlResolver
 
用于解析 include 和 import 元素中引用的命名空间的 XmlResolver。
- 属性
 
注解
如果 SOM 通过 import 或 include 元素引用其他命名空间, XmlResolver 则 用于解析这些引用。 如果解析程序设置为 null,则表示用户不关心解析 import 或 include 元素。 在这种情况下,不会解析引用。 方法完成后,解析程序不会缓存 Compile 。
重要
方法Compile在 Microsoft .NET Framework 2.0 版中已过时,已被 方法替换XmlSchemaSet.Compile。
重要
方法 Compile 使用 XmlUrlResolver 类来解析默认包含、导入或重新定义元素中引用的外部架构。 可以通过将 null 作为 参数传递来禁用外部架构的 XmlResolver 解析。