XPathAtomicValue.ValueAs Method (Type, IXmlNamespaceResolver)XPathAtomicValue.ValueAs Method (Type, IXmlNamespaceResolver)XPathAtomicValue::ValueAs Method (Type^, IXmlNamespaceResolver^)

Returns the item's value as the type specified using the IXmlNamespaceResolverIXmlNamespaceResolverIXmlNamespaceResolver object specified to resolve namespace prefixes.

Syntax

Public Overrides Function ValueAs( _
    returnType As Type, _
    nsResolver As System.Xml.IXmlNamespaceResolver _
) As Object
public override object ValueAs(
    Type returnType,
    System.Xml.IXmlNamespaceResolver nsResolver
)
public:
virtual object^ ValueAs(
    Type^ returnType, 
    System.Xml::IXmlNamespaceResolver^ nsResolver
) override
 

Return Value

Type: System.ObjectSystem.ObjectSystem::Object^

The value of the item as the type requested.

Exceptions

ExceptionCondition
FormatExceptionFormatExceptionFormatException The item's value is not in the correct format for the target type.
InvalidCastExceptionInvalidCastExceptionInvalidCastException The attempted cast is not valid.
OverflowExceptionOverflowExceptionOverflowException The attempted cast resulted in an overflow.