attributeDecl Method

MSXML 5.0 SDK

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

attributeDecl Method

Receives/reports an attribute type declaration. Only the first declaration for an attribute is reported.

[Visual Basic]

The attribute type is one of these three choices:

  • One of the following strings: "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", or "ENTITIES".
  • A parenthesized token group with the separator "|" and all white space removed.
  • The word "NOTATION", followed by a space, followed by a parenthesized token group with all white space removed.

Any parameter entities in the attribute value are expanded. General entities are not expanded.

Implementation Syntax

Sub attributeDecl(strElementName As String, strAttributeName As String,_ 
strType As String, strValueDefault As String, strValue As String)

Parameters

strElementName
The name of the associated element.
strAttributeName
The name of the attribute.
strType
A string representing the attribute type.
strValueDefault
A string representing the attribute default ("#IMPLIED", "#REQUIRED", or "#FIXED"), or Null (if none of these applies).
strValue
A string representing the default value of the attribute, or Null (if there is none).

Return Values

If failed, the DeclHandler raises a trappable error.

[C/C++]

The attribute type is one of these two choices:

  • One of the following strings: "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", or "NOTATION".
  • A parenthesized token group with the separator "|" and all white space removed.

Syntax

HRESULT attributeDecl(
   [in] const wchar_t * pwchElementName,
   [in] int cchElementName,
   [in] const wchar_t * pwchAttributeName,
   [in] int cchAttributeName,
   [in] const wchar_t * pwchType,
   [in] int cchType,
   [in] const wchar_t * pwchValueDefault,
   [in] int cchValueDefault,
   [in] const wchar_t * pwchValue,
   [in] int cchValue);

Parameters

pwchElementName [in]
The name of the associated element.
cchElementName [in]
The length of the element name string.
pwchAttributeName [in]
The name of the attribute.
cchAttributeName [in]
The length of the attribute name string.
pwchType [in]
A string representing the attribute type.
cchType [in]
The length of the attribute type string.
pwchValueDefault [in]
A string representing the attribute default ("#IMPLIED", "#REQUIRED" or "#FIXED"), or Null (if none of these apply).
cchValueDefault [in]
The length of the default string of the attribute.
pwchValue [in]
A string representing the default value of the attribute, or Null (if there is none).
cchValue [in]
The length of the default value string of the attribute.

Return Values

S_OK
The value returned if no errors are reported.
E_FAIL
The value returned if the parse operation should be aborted.

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

See Also

Applies to: ISAXDeclHandler/IVBSAXDeclHandler Interface