XmlSchemaSet.Contains Method

Definition

Indicates whether an XML Schema definition language (XSD) schema is in the XmlSchemaSet.

Overloads

Contains(String)

Indicates whether an XML Schema definition language (XSD) schema with the specified target namespace URI is in the XmlSchemaSet.

Contains(XmlSchema)

Indicates whether the specified XML Schema definition language (XSD) XmlSchema object is in the XmlSchemaSet.

Contains(String)

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

Indicates whether an XML Schema definition language (XSD) schema with the specified target namespace URI is in the XmlSchemaSet.

C#
public bool Contains (string? targetNamespace);
C#
public bool Contains (string targetNamespace);

Parameters

targetNamespace
String

The schema targetNamespace property.

Returns

true if a schema with the specified target namespace URI is in the XmlSchemaSet; otherwise, false.

Remarks

Schemas that are indirectly added to the XmlSchemaSet are detected by the Contains method; for example, imported schemas. As a result, if a schema for the http://www.contoso.com/retail namespace which imports a schema for the http://www.contoso.com/books namespace is added to the XmlSchemaSet, calling Contains with http://www.contoso.com/books as a parameter, it returns true.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

Contains(XmlSchema)

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

Indicates whether the specified XML Schema definition language (XSD) XmlSchema object is in the XmlSchemaSet.

C#
public bool Contains (System.Xml.Schema.XmlSchema schema);

Parameters

schema
XmlSchema

The XmlSchema object.

Returns

true if the XmlSchema object is in the XmlSchemaSet; otherwise, false.

Exceptions

The XmlSchemaSet passed as a parameter is null.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1