Sets the value of a node specified by a full path.

Syntax

XML_Node *XML_SetNodeValueByPath(
  XML_HANDLE hXml,
  const char *nodePath,
  const char *value,
  int *ErrCode
);

Parameters

hXml
[in] XML handle
nodePath
[in] A pointer to a string that specifies the full path.
value
[in] A pointer to a string of the value to set on a node.
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 node for which you set the value, otherwise NULL.

Remarks

Finds a node according to the specified full path.

If a node is found, sets the specified value to the node and returns a pointer to the XML_Node structure of that node.

If all higher intermediate nodes other than the last node in the full path are found and can be uniquely identified, but only the last node is not found, adds a new node with the name of the last node, sets the specified value to the node and returns a pointer to XML_Node structure of the node.

If multiple nodes are found, the function fails and returns XML_NOT_UNIQUE_NODE in ErrCode.

If the node found is an intermediate node, the function fails and returns XML_NO_VALUE_IN_INTERMEDIATE_NODE in ErrCode.

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_NOT_FOUNDThe node with the specified name was not found.
XML_NOT_UNIQUE_INTERMEDIATE_NODEMultiple nodes with the specified name were found in the middle of the node path.
XML_NOT_UNIQUE_NODEThere are multiple nodes with the same name.
XML_NO_VALUE_IN_INTERMEDIATE_NODEIntermediate nodes are not allowed to have a value.

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