Share via


getValueFromName Method

 

Finds the attribute by namespace name and returns the attribute's text value. For ambiguous names, this method returns the value from the first namespace.

Visual Basic Implementation Syntax

Function getValueFromName(ByVal strURI As String,_   
  ByVal strLocalName As String) As String  

Visual Basic Usage Syntax

StrVal = oIVBSAXAttributes.getValueFromName
(strURI,strLocalName)  

Parameters

strURI
The namespace URI or, if the name has no namespace URI, an empty string.

strLocalName
The local name of the attribute.

Return Values

If failed, raises a trappable error.

C/C++ Syntax

HRESULT getValueFromName(  
   [in] const wchar_t * pwchUri,   
   [in] int cchUri,   
   [in] const wchar_t * pwchLocalName,  
   [in] int cchLocalName,  
   [out] const wchar_t ** ppwchValue,  
   [out] int * pcchValue);  

Parameters

pwchUri[in]
The namespace URI or, if the namespace has no URI, an empty string.

cchUri[in]
The length of the URI string.

pwchLocalName[in]
The local name of the attribute.

cchLocalName[in]
The length of the local name string.

ppwchValue[out]
The string value of the attribute. ppwchValue should not be modified or deleted, because this can cause undefined behavior in the SAX parser. If you want to preserve the value that was returned in ppwchValue, you should make a deep copy.

pcchValue[out]
The length of the attribute's string value.

Return Values

S_OK
The value returned if the text value is returned successfully.

E_INVALIDARG
The value returned for an invalid index or if no matching attribute is reported.

E_FAIL
The value returned if an internal error occurs.

Versioning

Implemented in: MSXML 3.0 and later

Applies to

ISAXAttributes Interface

See Also

getLength Method (C-C++)
length Property (Visual Basic)