Allows to configure a child node to the given parent. This is a fundamental function while building xml document inside memory. The way the xml nodes are linked to conform the xml document structure relay on this function. The idea is that every call to this function makes the child xml node to be placed at the end of the current item child set, that represents current child list for the provided parent. One important question while using this function is that you must not reuse the same xml node reference, adding it several time to the same parent (or different parents). You must create a new xml node reference (axl_node_create) for every call you do to this function. So, to build the following structure: <document> <child1 /> <child2 /> </document> You must perform the following operations: axlNode * parent; axlNode * child; // create the parent node parent = axl_node_create ("document"); // create the first child child = axl_node_create ("child1"); // set it to the parent axl_node_set_child (parent, child); // create the second child child = axl_node_create ("child2"); // set it to the parent axl_node_set_child (parent, child); See also axl_node_set_child_after which could help you adding new nodes not using a parent node as a reference but a brother node.
|