getIndexFromName Method

 

Finds an attribute by name and returns the (zero-based) index for the attribute. For ambiguous names, this method returns the name from the first namespace.

Visual Basic Implementation Syntax

Function getIndexFromName(ByVal strURI As String, ByVal strLocalName As _   
String) As Long  

Visual Basic Usage Syntax

StrVal = oIVBSAXAttributes.getIndexFromName(strURI, strLocalName)  

Parameters

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

strLocalName
The attribute's local name.

Return Values

If failed, raises a trappable error.

C/C++ Syntax

HRESULT getIndexFromName(  
   [in] const wchar_t * pwchUri,   
   [in] int cchUri,   
   [in] const wchar_t * pwchLocalName,   
   [in] int cchLocalName  
   [out, retval] int * pnIndex);  

Parameters

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

cchUri[in]
The length of the namespace URI string.

pwchLocalName[in]
The attribute's local name.

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

pnIndex[out, retval]
The returned index value.

Return Values

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

E_INVALIDARG
The value returned if no matching attribute is found.

E_FAIL
The value returned if an internal error occurs.

Versioning

Implemented in: MSXML 3.0 and later

Applies to

ISAXAttributes Interface

See Also

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