Export (0) Print
Expand All

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


Type: System.Xml.Schema.XmlSchemaType

The derived XmlSchemaType to test.

Type: System.Xml.Schema.XmlSchemaType

The base XmlSchemaType to test the derived XmlSchemaType against.

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.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

© 2014 Microsoft