XmlValidatingReader.SchemaType Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a schema type object.
public:
property System::Object ^ SchemaType { System::Object ^ get(); };
public object? SchemaType { get; }
public object SchemaType { get; }
member this.SchemaType : obj
Public ReadOnly Property SchemaType As Object
Property Value
XmlSchemaDatatype, XmlSchemaSimpleType, or XmlSchemaComplexType depending whether the node value is a built in XML Schema definition language (XSD) type or a user defined simpleType or complexType; null
if the current node has no schema type.
Remarks
Note
The XmlValidatingReader class is obsolete in .NET Framework 2.0. You can create a validating XmlReader instance by using the XmlReaderSettings class and the Create method. For more information, see the Remarks section of the XmlReader reference page.
The user needs to test for the returned type.
If XML Schema validation is being performed, the XmlSchemaType
or XmlSchemaDatatype
corresponds to the current element being read. If document type definition (DTD validation) is being performed, this property returns null
.
XmlSchemaDatatype
is returned if the current element, or attribute, is a simple type that can specify special validation constraints on the simple types, like min and max.
XmlSchemaSimpleType
is returned if the current element, or attribute, is a user defined simpleType.
XmlSchemaComplexType
is returned if the current element is a user defined complexType. This type cannot be returned by attributes.
Note
If ValidationType has been set to ValidationType.None, no data type information is provided from either schemas or DTDs.
Caution
After calling Close, SchemaType will return Null.