XmlSchemaSet.RemoveRecursive メソッド
アセンブリ: System.Xml (system.xml.dll 内)

Dim instance As XmlSchemaSet Dim schemaToRemove As XmlSchema Dim returnValue As Boolean returnValue = instance.RemoveRecursive(schemaToRemove)
戻り値
XmlSchema オブジェクトとそれがインポートしたすべてのスキーマが正常に削除された場合は true を返します。それ以外の場合は false を返します。


指定されたスキーマおよびそれがインポートした各スキーマに依存関係がない場合、これらがすべて XmlSchemaSet から削除されます。XmlSchemaSet内のスキーマまたはそれがインポートしたスキーマに依存関係がある場合、何も削除しないで RemoveRecursive が false を返します。false が返され、ValidationEventHandler が定義されている場合、依存関係を示す警告がイベント ハンドラに送信されます。

1 つの XmlSchemaSet に複数のスキーマを追加し、RemoveRecursive メソッドを使用して、スキーマの 1 つとそれがインポートしたすべてのスキーマを削除するコード例を次に示します。
Dim schemaSet As XmlSchemaSet = New XmlSchemaSet() schemaSet.Add("http://www.contoso.com/retail", "http://www.contoso.com/retail.xsd") schemaSet.Add("http://www.contoso.com/books", "http://www.contoso.com/books.xsd") schemaSet.Add("http://www.contoso.com/music", "http://www.contoso.com/music.xsd") Dim schema As XmlSchema For Each schema In schemaSet.Schemas() If schema.TargetNamespace = "http://www.contoso.com/music" Then <b>schemaSet.RemoveRecursive(schema)</b> End If Next
XmlSchemaSet schemaSet = new XmlSchemaSet(); schemaSet.Add("http://www.contoso.com/retail", "http://www.contoso.com/retail.xsd"); schemaSet.Add("http://www.contoso.com/books", "http://www.contoso.com/books.xsd"); schemaSet.Add("http://www.contoso.com/music", "http://www.contoso.com/music.xsd"); foreach (XmlSchema schema in schemaSet.Schemas()) { if (schema.TargetNamespace == "http://www.contoso.com/music") { <b>schemaSet.RemoveRecursive(schema);</b> } }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- XmlSchemaSet.RemoveRecursive メソッドのページへのリンク