Share via


getValue Method1

 

Returns the text value of the attribute. If the index is out of range, this method returns a trappable error.

Visual Basic Implementation Syntax

Function getValue(ByVal nIndex As Long) As String  

Visual Basic Usage Syntax

StrVal = oIVBSAXAttributes.getValue
(nIndex)  

Parameters

nIndex
The attribute index (zero-based).

Return Values

In Visual Basic, this method raises a trappable error if the index is out of range.

C/C++ Syntax

HRESULT getValue(  
   [in] int nIndex,   
   [out] const wchar_t ** ppwchValue,   
   [out] int * pcchValue);  

Parameters

nIndex[in]
The attribute index (zero-based).

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 string.

Return Values

In C++, this method returns a Null value if the index is out of range.

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

E_INVALIDARG
The value returned if an invalid index or 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)