XmlSchemaCollection.Contains 메서드

정의

지정된 네임스페이스를 가진 스키마가 컬렉션에 있는지를 나타내는 값을 가져옵니다.

오버로드

Contains(String)

지정된 네임스페이스를 가진 스키마가 컬렉션에 있는지를 나타내는 값을 가져옵니다.

Contains(XmlSchema)

지정된 XmlSchematargetNamespace가 컬렉션에 있는지 여부를 나타내는 값을 가져옵니다.

설명

중요

클래스는 XmlSchemaCollection .NET Framework 버전 2.0에서 사용되지 않으며 클래스로 XmlSchemaSet 대체되었습니다.

Contains(String)

지정된 네임스페이스를 가진 스키마가 컬렉션에 있는지를 나타내는 값을 가져옵니다.

public:
 bool Contains(System::String ^ ns);
public bool Contains (string? ns);
public bool Contains (string ns);
member this.Contains : string -> bool
Public Function Contains (ns As String) As Boolean

매개 변수

ns
String

스키마에 연결된 네임스페이스 URI입니다. XML 스키마의 경우 일반적으로 대상 네임스페이스입니다.

반환

Boolean

지정된 네임스페이스가 컬렉션에 있으면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 스키마가 컬렉션에 있는지 확인합니다. 이 경우 스키마가 표시됩니다.

if ( xsc->Contains( "urn:bookstore-schema" ) )
{
   XmlSchema^ schema = xsc[ "urn:bookstore-schema" ];
   StringWriter^ sw = gcnew StringWriter;
   XmlTextWriter^ xmlWriter = gcnew XmlTextWriter( sw );
   xmlWriter->Formatting = Formatting::Indented;
   xmlWriter->Indentation = 2;
   schema->Write( xmlWriter );
   Console::WriteLine( sw );
}
if (xsc.Contains("urn:bookstore-schema"))
{
  XmlSchema schema = xsc["urn:bookstore-schema"];
  StringWriter sw = new StringWriter();
  XmlTextWriter xmlWriter = new XmlTextWriter(sw);
  xmlWriter.Formatting = Formatting.Indented;
  xmlWriter.Indentation = 2;
  schema.Write(xmlWriter);
  Console.WriteLine(sw.ToString());
}
If xsc.Contains("urn:bookstore-schema") Then
    Dim schema As XmlSchema = xsc("urn:bookstore-schema")
    Dim sw As New StringWriter()
    Dim xmlWriter As New XmlTextWriter(sw)
    xmlWriter.Formatting = Formatting.Indented
    xmlWriter.Indentation = 2
    schema.Write(xmlWriter)
    Console.WriteLine(sw.ToString())
End If

설명

중요

클래스는 XmlSchemaCollection .NET Framework 버전 2.0에서 사용되지 않으며 클래스로 XmlSchemaSet 대체되었습니다.

적용 대상

Contains(XmlSchema)

지정된 XmlSchematargetNamespace가 컬렉션에 있는지 여부를 나타내는 값을 가져옵니다.

public:
 bool Contains(System::Xml::Schema::XmlSchema ^ schema);
public bool Contains (System.Xml.Schema.XmlSchema schema);
member this.Contains : System.Xml.Schema.XmlSchema -> bool
Public Function Contains (schema As XmlSchema) As Boolean

매개 변수

schema
XmlSchema

XmlSchema 개체

반환

Boolean

동일한 true를 가진 스키마가 컬렉션에 있으면 targetNamespace이고, 그렇지 않으면 false입니다.

설명

중요

클래스는 XmlSchemaCollection .NET Framework 버전 2.0에서 사용되지 않으며 클래스로 XmlSchemaSet 대체되었습니다.

적용 대상