XmlSchemaDatatype::ParseValue Method (String, XmlNameTable, XmlNamespaceManager)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

When overridden in a derived class, validates the specified string against a built-in or user-defined simple type.

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

public:
virtual Object^ ParseValue(
	String^ s, 
	XmlNameTable^ nameTable, 
	XmlNamespaceManager^ nsmgr
) abstract

Parameters

s
Type: System::String
The string to validate against the simple type.
nameTable
Type: System.Xml::XmlNameTable
The XmlNameTable to use for atomization while parsing the string if this XmlSchemaDatatype object represents the xs:NCName type.
nsmgr
Type: System.Xml::XmlNamespaceManager
The XmlNamespaceManager object to use while parsing the string if this XmlSchemaDatatype object represents the xs:QName type.

Return Value

Type: System::Object
An Object that can be safely cast to the type that is returned by the ValueType property.

ExceptionCondition
XmlSchemaValidationException

The input value is not a valid instance of this W3C XML Schema type.

ArgumentNullException

The value to parse cannot be nullptr.

The ParseValue method validates the specified string against a built-in or user-defined simple type. For example, if this XmlSchemaDatatype represents the type xs:date, then an instance of DateTime is returned.

The following are the steps performed during the ParseValue method's validation process.

  1. Convert the specified string to its corresponding Common Language Runtime (CLR) type.

  2. Verify that the value does not violate any facets that are defined for the simple type.

The converted value is then returned as an Object and can be cast safely to the type that is returned by the ValueType property.

When the XmlSchemaDatatype object represents a list type, the input string value is converted to a list of one or more objects. When the XmlSchemaDatatype object represents a list type, an attempt is made to parse the input value as a member type of the union. If the parse attempt fails, then the conversion is attempted with the next member of the union until the parse is successful or there are no other member types to parse. If the parse is unsuccessful, an exception is thrown.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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

.NET Framework

Supported in: 1.1, 1.0
Show: