XmlSchemaSet.Schemas メソッド

定義

XmlSchemaSet 内の XML スキーマ定義言語 (XSD) スキーマのコレクションを返します。

オーバーロード

Schemas()

XmlSchemaSet 内のすべての XML スキーマ定義言語 (XSD) スキーマのコレクションを返します。

Schemas(String)

指定された名前空間に属している XmlSchemaSet 内のすべての XML スキーマ定義言語 (XSD) スキーマのコレクションを返します。

Schemas()

Source:
XmlSchemaSet.cs
Source:
XmlSchemaSet.cs
Source:
XmlSchemaSet.cs

XmlSchemaSet 内のすべての XML スキーマ定義言語 (XSD) スキーマのコレクションを返します。

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

戻り値

ICollection に追加されたすべてのスキーマが格納された XmlSchemaSet オブジェクト。 XmlSchemaSet にスキーマが追加されていない場合は、空の ICollection オブジェクトが返されます。

次の例は、 内のすべてのスキーマを反復処理する方法を 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 返します。

注意

メソッドはSchemas、古い XmlSchemaCollectionGetEnumerator メソッドに相当します。

適用対象

Schemas(String)

Source:
XmlSchemaSet.cs
Source:
XmlSchemaSet.cs
Source:
XmlSchemaSet.cs

指定された名前空間に属している XmlSchemaSet 内のすべての XML スキーマ定義言語 (XSD) スキーマのコレクションを返します。

public:
 System::Collections::ICollection ^ Schemas(System::String ^ targetNamespace);
public System.Collections.ICollection Schemas (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

スキーマの targetNamespace プロパティ。

戻り値

指定された名前空間に属する ICollection に追加されたすべてのスキーマが格納された XmlSchemaSet オブジェクト。 XmlSchemaSet にスキーマが追加されていない場合は、空の ICollection オブジェクトが返されます。

次の例は、 内の 名前空間内のすべてのスキーマを反復処理する http://www.contoso.com/books 方法を 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);
}

注釈

パラメーターが または EmptytargetNamespace場合はnull、名前空間のないすべてのスキーマが返されます。

このメソッドは、インポートされたために に間接的に追加されたスキーマを XmlSchemaSet 返します。

注意

メソッドはSchemas、古い XmlSchemaCollectionItem[] メソッドに相当します。

適用対象