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

getName Method (C/C++)

Returns all information related to the name of an attribute at a given index.

Note   MSXML 4.0 and later does not check for Null values in pointers used as output parameters with this method. For more information, see Remarks, below.

Syntax

HRESULT getName(
   [in] int nIndex, 
   [out] const wchar_t ** ppwchUri, 
   [out] int * pcchUri)
   [out] const wchar_t ** ppwchLocalName,
   [out] int * pcchLocalName,
   [out] const wchar_t ** ppwchQName,
   [out] int * pcchQName);

Parameters

nIndex [in]
The attribute's index value.
ppwchUri [out]
The attribute's URI.
pcchUri [out]
The length of the URI string.
ppwchLocalName [out]
The attribute's local name.
pcchLocalName [out]
The length of the local name string.
ppwchQName [out]
The qualified prefixed name of the attribute.
pcchQName [out]
The length of the qualified name string.

Return Values

S_OK
The value returned if successful. Returns the results as a combination of getURI, getLocalName, and getQName, with the appropriate parameters either filled in or empty.
E_FAIL
The value returned if an internal error occurs.
E_INVALIDARG
The value returned if an invalid index is provided.

Remarks

In previous versions of MSXML, a pointer used in an output parameter could have a value of Null. In some cases, this allowed you to limit or scope the output to return only a particular output parameter when other output parameters were not of interest. Beginning with MSXML 4.0, pointers to output parameters used with this method are no longer checked for Null values, and you must always get all three output parameter values (i.e., the URI, local name, and QName).

With the current design, a value of Null is treated the same as any other pointer value, which might be incorrect (for example, in the case of a pointer to address 1). It is now left to the individual application to ensure that any pointer used as an output parameter is correct. When writing your application code, ensure that any pointer passed as an output parameter is not Null.

See Also

getLength Method (C/C++) | getURI Method | getLocalName Method | getQName Method

Applies to: ISAXAttributes Interface