getIndexFromName Method

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - SAX2 Reference

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

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.

To view reference information for Visual Basic or C/C++ only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

getIndexFromQName Method | getLength Method (C/C++) | length Property (Visual Basic)

Applies to: ISAXAttributes/IVBSAXAttributes Interface