setAttribute Method

MSXML 5.0 SDK

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

setAttribute Method

Sets an attribute in the list.

[Visual Basic]

Implementation Syntax

Sub setAttribute(ByVal nIndex As Long, _
                 ByVal strURI As String, _
                 ByVal strLocalName As String, _
                 ByVal strQName As String, _
                 ByVal strType As String, _
                 ByVal strValue As String)

Usage Syntax

oIMXAttributes.setAttribute(nIndex, _
                            strURI, _
                            strLocalName, _
                            strQName, _
                            strType, _
                            strValue)

Parameters

nIndex
The attribute's index value (zero-based).
strURI
The namespace Uniform Resource Identifier (URI) or, if the namespace has no URI, an empty string.
strLocalName
The local name or, if namespace processing is not being performed, an empty string.
strQName
The XML 1.0 qualified name or, if the qualified name is not available, an empty string.
strType
A string representing the attribute type.
strValue
The attribute value.
[C/C++]

Syntax

HRESULT setAttribute(
   [in] int nIndex,
   [in] BSTR strURI,
   [in] BSTR strLocalName,
   [in] BSTR strQName,
   [in] BSTR strType,
   [in] BSTR strValue);

Parameters

nIndex
The attribute's index value (zero-based).
strURI
The namespace Uniform Resource Identifier (URI) or, if the namespace has no URI, an empty string.
strLocalName
The local name or, if namespace processing is not being performed, an empty string.
strQName
The XML 1.0 qualified name or, if the qualified name is not available, an empty string.
strType
A string representing the attribute type.
strValue
The attribute value.

Return Values

S_OK
The value returned if no errors are reported.
E_FAIL
There is only one specific fatal error for this IMXAttributes implementation: incorrect index (E_INVALIDARG). It may return a generic failure code, such as out-of-memory.

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

See Also

Applies to: IMXAttributes Interface