Syntax
XML_Node *XML_AddChildNode(
  XML_HANDLE hXml,
  XML_Node *node,
  const char *name,
  const char *value,
  int *ErrCode
);
Parameters
- hXml
- [in] XML handle
- node
- [in] A pointer to the XML_Node structure of the node.
- name
- [in] A pointer to a string that specifies the name of the child node to add.
- value
- [in] A pointer to a string that specifies the value of the child node to add. Specify NULL to add an empty node that has no value.
- ErrCode
- [out] A pointer to a variable that returns an error code. Specify NULL when no error code is required.
Return value
If the function succeeds, it returns a pointer to the XML_Node structure of the added node, otherwise NULL.Remarks
Adds a child node with the specified name and value to the specified node and returns a pointer to the XML_Node structure of the added node.
A child node cannot be added if the specified node has a value. In this case, the function will fail and return XML_CHILD_NODE_DISALLOWED_ERROR in ErrCode.
If the function fails, it returns NULL and ErrCode returns the following error code:
| Error code | Description | 
|---|---|
| XML_INVALID_PARAMETER_ERROR | Parameter error | 
| XML_MEMORY_ALLOCATION_ERROR | Memory allocation error | 
| XML_INVALID_XML_OBJECT_ERROR | Invalid XML handle | 
| XML_INVALID_NODE_OBJECT_ERROR | Invalid node is specified. | 
| XML_UNICODE_CONVERSION_ERROR | Local code characters that cannot be converted to Unicode have been detected. | 
| XML_CHILD_NODE_DISALLOWED_ERROR | The child node could not be added because the node has a value. | 
Requirements
Header file:
XML.hLibrary file:
CodeConversion.h : ver. 1.1.1 or later.
libXML.a
libCodeConversion.a : ver.1.1.1 or later
libSTARTUPOPH5000.a
See also
Last updated: 2021/10/21