char * axl_node_content_copy_and_escape ( const char *  content,
int  content_size,
int  additional_size 
)

Allows to perform a copy for the content provided, doing an xml character escaping for non allowed values (&, <, >, ' and ").

This function must be used with axl_node_has_invalid_chars to check if the content has escapable chars an to get the additional content that must be allocated by this function.

Here is an example:

 char * content = "Some content with invalid chars & < >";
 int    additional_size;
 char * new_content

 if (axl_node_has_invalid_chars (content, strlen (content), &additional_size)) {
      // found that the string has invalid chars, escape them
      new_content = axl_node_content_copy_and_escape (content, strlen (content), additional_size);
 } 

Parameters:
content The content to be escaped. If this parameter is null, the function returns NULL.
content_size The content size for the first parameter.
additional_size The additional size calculated from axl_node_has_invalid_chars.
Returns:
A newly allocated string with all characters escaped. Use axl_free to dealloc the result.