XPathNavigator.ValueAs(Type, IXmlNamespaceResolver) Método
Definição
Obtém o valor do nó atual como o Type especificado, usando o objeto IXmlNamespaceResolver especificado para resolver prefixos de namespace.Gets the current node's value as the Type specified, using the IXmlNamespaceResolver object specified to resolve namespace prefixes.
public:
override System::Object ^ ValueAs(Type ^ returnType, System::Xml::IXmlNamespaceResolver ^ nsResolver);
public override object ValueAs (Type returnType, System.Xml.IXmlNamespaceResolver? nsResolver);
public override object ValueAs (Type returnType, System.Xml.IXmlNamespaceResolver nsResolver);
override this.ValueAs : Type * System.Xml.IXmlNamespaceResolver -> obj
Public Overrides Function ValueAs (returnType As Type, nsResolver As IXmlNamespaceResolver) As Object
Parâmetros
- returnType
- Type
O Type para retornar como o valor do nó atual.The Type to return the current node's value as.
- nsResolver
- IXmlNamespaceResolver
O objeto IXmlNamespaceResolver usado para resolver prefixos de namespace.The IXmlNamespaceResolver object used to resolve namespace prefixes.
Retornos
O valor do nó atual como o Type solicitado.The value of the current node as the Type requested.
Exceções
O valor do nó atual não está no formato correto para o tipo de destino.The current node's value is not in the correct format for the target type.
A tentativa de conversão não é válida.The attempted cast is not valid.
Comentários
O ValueAs método tenta converter o valor do nó atual para o tipo .net, especificado de acordo com as regras XPath 2,0 para a conversão do tipo do nó atual.The ValueAs method attempts to convert the value of the current node to the .NET type, specified according to the XPath 2.0 rules for casting the current node's type.
O IXmlNamespaceResolver objeto é usado para resolver prefixos de namespace relacionados a conversões de tipo.The IXmlNamespaceResolver object is used to resolve namespace prefixes related to type conversions. Por exemplo, ao converter um xs:QName para um xs:string .For example, when converting an xs:QName to an xs:string.