다음을 통해 공유


XmlSchemaSet.Remove(XmlSchema) 메서드

정의

지정된 XSD(XML 스키마 정의 언어) 스키마를 XmlSchemaSet제거합니다.

public:
 System::Xml::Schema::XmlSchema ^ Remove(System::Xml::Schema::XmlSchema ^ schema);
public System.Xml.Schema.XmlSchema? Remove(System.Xml.Schema.XmlSchema schema);
public System.Xml.Schema.XmlSchema Remove(System.Xml.Schema.XmlSchema schema);
member this.Remove : System.Xml.Schema.XmlSchema -> System.Xml.Schema.XmlSchema
Public Function Remove (schema As XmlSchema) As XmlSchema

매개 변수

schema
XmlSchema

XmlSchema 에서 제거할 개체입니다XmlSchemaSet.

반품

XmlSchema 에서 제거된 XmlSchemaSet 개체이거나 null 스키마를 찾을 수 XmlSchemaSet없는 경우

예외

스키마가 유효한 스키마가 아닙니다.

XmlSchema 매개 변수로 전달된 값은 .입니다null.

예제

다음 예제에서는 여러 스키마를 추가한 XmlSchemaSet다음 메서드를 사용하여 Remove 스키마 중 하나를 제거하는 방법을 보여 줍니다.

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
        schemaSet.Remove(schema)
    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")
    {
        schemaSet.Remove(schema);
    }
}

설명

속성false에서 스키마를 XmlSchemaSetIsCompiled 제거합니다.

적용 대상