addAttribute Method1


Adds an attribute to the end of the attribute collection.

Visual Basic Implementation Syntax

Sub addAttribute(ByVal strURI As String, _  
                 ByVal strLocalName As String, _   
                 ByVal strQName As String, _  
                 ByVal strType As String, _  
                 ByVal strValue As String)  

Visual Basic Usage Syntax

oIMXAttributes.addAttribute(strURI, _  
                            strLocalName, _  
                            strQName, _  
                            strType, _  

Adds an attribute to the end of the attribute collection.

C/C++ Syntax

HRESULT addAttribute(  
    [in] BSTR strURI,  
    [in] BSTR strLocalName,  
    [in] BSTR strQName,  
    [in] BSTR strType,  
    [in] BSTR strValue);  

Return Values

The value returned if no errors are reported.


The namespace Uniform Resource Identifier (URI) or, if the namespace has no URI, an empty string.

The local name of the attribute.

The XML 1.0 qualified name or, if the qualified name is not available, an empty string.

A string representing the attribute type.

A string representing the attribute's default value specified by "#IMPLIED", "#REQUIRED", or "#FIXED", or Null if none applies. This value string is represented by the attribute's default value, or empty if there is none.


To maximize efficiency, the addAttribute method does not check if the attribute is in the list. Therefore, the user application should check for the existence of an attribute before adding it to the bottom of the attribute list.


Implemented in: MSXML 3.0 and later

Applies to

IMXAttributes Interface