Изменить

Поделиться через


XmlValidatingReader.ReadTypedValue Method

Definition

Gets the common language runtime type for the specified XML Schema definition language (XSD) type.

public:
 System::Object ^ ReadTypedValue();
public object? ReadTypedValue();
public object ReadTypedValue();
member this.ReadTypedValue : unit -> obj
Public Function ReadTypedValue () As Object

Returns

The common language runtime type for the specified XML 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.

For example, if the schema type is defined as xsd:int, the runtime type int32 is returned for the object. This can be tested using the GetType method and cast accordingly. The ReadTypedValue method always returns a type that is derived from the Object class. It never returns the Object type.

If the reader is positioned on an attribute, this method returns the runtime typed object, but does not change the position of the reader. If the reader is positioned on an element, ReadTypedValue reads any CDATA, text, white space, significant white space, and comment nodes, returns the runtime typed object and positions the reader on the end tag. Any types that do not have a direct mapping, for example NMTOKENS, are returned as strings.

Note

If ValidationType has been set to ValidationType.None, data type information is not provided from either schemas or document type definitions (DTDs).

Caution

After calling Close, ReadTypedValue will return null.

Applies to

See also