This documentation is archived and is not being maintained.

XmlSchemaType.IsDerivedFrom Method

Returns a value indicating if the derived schema type specified is derived from the base schema type specified

Namespace:  System.Xml.Schema
Assembly:  System.Xml (in System.Xml.dll)

public static bool IsDerivedFrom(
	XmlSchemaType derivedType,
	XmlSchemaType baseType,
	XmlSchemaDerivationMethod except
)

Parameters

derivedType
Type: System.Xml.Schema.XmlSchemaType
The derived XmlSchemaType to test.
baseType
Type: System.Xml.Schema.XmlSchemaType
The base XmlSchemaType to test the derived XmlSchemaType against.
except
Type: System.Xml.Schema.XmlSchemaDerivationMethod
One of the XmlSchemaDerivationMethod values representing a type derivation method to exclude from testing.

Return Value

Type: System.Boolean
true if the derived type is derived from the base type; otherwise, false.

The following is an example of the IsDerivedFrom method.

XmlSchemaType xsdInteger = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Integer);
XmlSchemaType xsdPositiveInteger = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.PositiveInteger);

// true
Console.WriteLine(XmlSchemaType.IsDerivedFrom(xsdPositiveInteger, xsdInteger, XmlSchemaDerivationMethod.None));

// false
Console.WriteLine(XmlSchemaType.IsDerivedFrom(xsdPositiveInteger, xsdInteger, XmlSchemaDerivationMethod.Restriction));

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: