Gets attributes of the node.

Syntax

XML_Attribute *XML_GetAttribute(
  XML_HANDLE hXml,
  XML_Node *node,
  int *ErrCode
);

Parameters

hXml
[in] XML handle
node
[in] A pointer to the XML_Node structure of the node.
ErrCode
[out] A pointer to a variable that returns an error code. Specify NULL when no error code is required.

Return value

Returns a pointer to the XML_Attribute structure if the specified node has attributes, or NULL otherwise.

Remarks

Returns a pointer to the XML_Attribute structure of the first attribute of the specified node. The second and subsequent attributes are obtained with the XML_NextAttribute function.

The name and value of an attribute are taken from the name and value members of the XML_Attribute structure.

If the function fails, it returns NULL and ErrCode returns the following error code:

Error codeDescription
XML_INVALID_PARAMETER_ERRORParameter error
XML_MEMORY_ALLOCATION_ERRORMemory allocation error
XML_INVALID_XML_OBJECT_ERRORInvalid XML handle
XML_INVALID_NODE_OBJECT_ERRORInvalid node is specified.
XML_NOT_FOUNDThe attribute was not found.

Requirements

Header file:
XML.h
CodeConversion.h : ver. 1.1.1 or later.
Library file:
libXML.a
libCodeConversion.a : ver.1.1.1 or later
libSTARTUPOPH5000.a

See also

Last updated: 2021/10/21