XmlSchemaSet.Schemas XmlSchemaSet.Schemas XmlSchemaSet.Schemas XmlSchemaSet.Schemas Method

定义

返回 XmlSchemaSet 中 XML 架构定义语言 (XSD) 架构的集合。Returns a collection of XML Schema definition language (XSD) schemas in the XmlSchemaSet.

重载

Schemas() Schemas() Schemas() Schemas()

返回 XmlSchemaSet 中所有 XML 架构定义语言 (XSD) 架构的集合。Returns a collection of all the XML Schema definition language (XSD) schemas in the XmlSchemaSet.

Schemas(String) Schemas(String) Schemas(String) Schemas(String)

返回 XmlSchemaSet 中属于给定命名空间的所有 XML 架构定义语言 (XSD) 架构的集合。Returns a collection of all the XML Schema definition language (XSD) schemas in the XmlSchemaSet that belong to the given namespace.

Schemas() Schemas() Schemas() Schemas()

返回 XmlSchemaSet 中所有 XML 架构定义语言 (XSD) 架构的集合。Returns a collection of all the XML Schema definition language (XSD) schemas in the XmlSchemaSet.

public:
 System::Collections::ICollection ^ Schemas();
public System.Collections.ICollection Schemas ();
member this.Schemas : unit -> System.Collections.ICollection
Public Function Schemas () As ICollection

返回

ICollection 对象,它包含已添加到 XmlSchemaSet 中的所有架构。An ICollection object containing all the schemas that have been added to the XmlSchemaSet. 如果没有架构添加到 XmlSchemaSet,则返回空的 ICollection 对象。If no schemas have been added to the XmlSchemaSet, an empty ICollection object is returned.

示例

下面的示例演示如何循环访问中的所有架构XmlSchemaSetThe following example illustrates how to iterate over all the schemas in the XmlSchemaSet.

Dim schemaSet As XmlSchemaSet = New XmlSchemaSet  
schemaSet.Add("http://www.contoso.com/books", "http://www.contoso.com/books.xsd")  

Dim schema As XmlSchema  

For Each schema In schemaSet.Schemas()  

    schema.Write(Console.Out)  

Next  
XmlSchemaSet schemaSet = new XmlSchemaSet();  
schemaSet.Add("http://www.contoso.com/books", "http://www.contoso.com/books.xsd");  

foreach (XmlSchema schema in schemaSet.Schemas())  
{  
    schema.Write(Console.Out);  
}  

注解

此方法返回的间接添加到架构XmlSchemaSet因为它们已导入。This method returns schemas that were added indirectly to the XmlSchemaSet because they were imported.

备注

Schemas方法等效于GetEnumerator方法的已过时XmlSchemaCollectionThe Schemas method is the equivalent of the GetEnumerator method of the obsolete XmlSchemaCollection.

Schemas(String) Schemas(String) Schemas(String) Schemas(String)

返回 XmlSchemaSet 中属于给定命名空间的所有 XML 架构定义语言 (XSD) 架构的集合。Returns a collection of all the XML Schema definition language (XSD) schemas in the XmlSchemaSet that belong to the given namespace.

public:
 System::Collections::ICollection ^ Schemas(System::String ^ targetNamespace);
public System.Collections.ICollection Schemas (string targetNamespace);
member this.Schemas : string -> System.Collections.ICollection
Public Function Schemas (targetNamespace As String) As ICollection

参数

targetNamespace
String String String String

架构 targetNamespace 属性。The schema targetNamespace property.

返回

ICollection 对象,它包含已添加到 XmlSchemaSet 的中的属于给定命名空间的所有架构。An ICollection object containing all the schemas that have been added to the XmlSchemaSet that belong to the given namespace. 如果没有架构添加到 XmlSchemaSet,则返回空的 ICollection 对象。If no schemas have been added to the XmlSchemaSet, an empty ICollection object is returned.

示例

下面的示例演示如何循环访问中的所有架构http://www.contoso.com/books命名空间中的XmlSchemaSetThe following example illustrates how to iterate over all the schemas in the http://www.contoso.com/books namespace in the XmlSchemaSet.

Dim schemaSet As XmlSchemaSet = New XmlSchemaSet  
schemaSet.Add("http://www.contoso.com/books", "http://www.contoso.com/books.xsd")  

Dim schema As XmlSchema  

For Each schema In schemaSet.Schemas("http://www.contoso.com/books")  

    schema.Write(Console.Out)  

Next  
XmlSchemaSet schemaSet = new XmlSchemaSet();  
schemaSet.Add("http://www.contoso.com/books", "http://www.contoso.com/books.xsd");  

foreach (XmlSchema schema in schemaSet.Schemas("http://www.contoso.com/books"))  
{  
    schema.Write(Console.Out);  
}  

注解

如果targetNamespace参数是nullEmpty,则返回所有没有命名空间的架构。If the targetNamespace parameter is null or Empty, then all schemas without a namespace are returned.

此方法返回的间接添加到架构XmlSchemaSet因为它们已导入。This method returns schemas that were added indirectly to the XmlSchemaSet because they were imported.

备注

Schemas方法等效于Item[String]方法的已过时XmlSchemaCollectionThe Schemas method is the equivalent of the Item[String] method of the obsolete XmlSchemaCollection.

适用于