axlNode * axl_node_create_ref ( char *  name  ) 

Creates a new axlNode but using the memory passed in by the name reference.

This function works the same way like axl_node_create, but previous one makes a local copy for the name provided. This means that, if you have allocated the reference being passed, the previous function will allocate again memory for the name reference.

Obviously, for a few xml nodes this have none or little effect but, if your xml document have 100.000 nodes you save 100.000 extra memory allocations and deallocations. This have a great impact in the long term impact of your programm because memory fragmentation is kept as low as possible.

Keep in mind that this function should not be used for static names declared on the code. Example:

    // propery node creation 
    axlNode * node = axl_node_create ("test");
  
    // NOT PROPER node creation
    axlNode * node = axl_node_create_ref ("test");

Parameters:
name A reference to the node name that is hold by dinamically allocated memory from the user space code. The function doesn't check if the parameter received is null.
Returns:
A newly created axlNode reference that must be deallocated by axl_node_free.