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

XmlSchema에서 제거된 XmlSchemaSet 개체이거나, 해당 스키마가 XmlSchemaSet에 없는 경우 null입니다.

예외

올바른 스키마가 아닌 경우

매개 변수로 전달된 XmlSchemanull인 경우

예제

다음 예제에서는 여러 스키마를 추가한 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);  
    }  
}  

설명

설정에서 스키마를 XmlSchemaSet 제거하면 속성이 IsCompiled .로 설정됩니다 false.

적용 대상