getName Method (C-C++)

 

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

Note

In MSXML 6.0 do 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 Value

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 MSXML 3.0, 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. In MSXML 6.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.

Note

ppwchUri, ppwchLocalName, and ppwchQName should not be modified or deleted, because this can cause undefined behavior in the SAXp. If you want to preserve the value that was returned in on of the listed parameters, you should make a deep copy.

Applies to

ISAXAttributes Interface

See Also

getLength Method (C-C++)
getURI Method
getLocalName Method
getQName Method