getType Method1


Finds an attribute by index and returns the attribute's type, as declared in the document type definition (DTD) or schema. If there is no DTD or schema or the schema does not map directly to a DTD attribute type, the return value is "CDATA". For ambiguous names, the type from the first namespace is returned.

Visual Basic Implementation Syntax

Function getType(ByVal nIndex As Long) As String  

Visual Basic Usage Syntax

StrVal = oIVBSAXAttributes.getType


The attribute's index value.

Return Values

If the type is unknown, returns "CDATA".

If failed, raises a trappable error.

C/C++ Syntax

HRESULT getType(  
   [in] int nIndex,   
   [out] const wchar_t ** ppwchType  
   [out] int * pcchType);  


The attribute's index value.

The returned type of the attribute. ppwchType should not be modified or deleted, because this can cause undefined behavior in the SAX parser. If you want to preserve the value that was returned in ppwchType, you should make a deep copy.

The length of the returned type attribute string.

Return Values

The value returned if the attribute type is returned successfully.

The value returned for an invalid index or if no matching attribute is found.

The value returned if an internal error occurs.


The returned attribute type can be (but is not limited to) one of the following: CDATA, ID, IDREF, IDREFS, NMTOKEN, NMTOKENS, ENTITY, ENTITIES.


Implemented in: MSXML 3.0 and later

Applies to

ISAXAttributes Interface

See Also

getTypeFromName Method
getTypeFromQName Method