ValueAs()

XmlAtomicValue::ValueAs(const TypeInfo&, SharedPtr<IXmlNamespaceResolver>) method

Returns the validated XML element or attribute’s value as the type specified using the IXmlNamespaceResolver object specified to resolve namespace prefixes.

SharedPtr<Object> System::Xml::Schema::XmlAtomicValue::ValueAs(const TypeInfo &type, SharedPtr<IXmlNamespaceResolver> nsResolver) override

Arguments

ParameterTypeDescription
typeconst TypeInfo&The type to return the validated XML element or attribute’s value as.
nsResolverSharedPtr<IXmlNamespaceResolver>The IXmlNamespaceResolver object used to resolve namespace prefixes.

Return Value

The value of the validated XML element or attribute as the type requested.

Exceptions

ExceptionDescription
FormatExceptionThe validated XML element or attribute’s value is not in the correct format for the target type.
InvalidCastExceptionThe attempted cast is not valid.
OverflowExceptionThe attempted cast resulted in an overflow.

See Also