Contents Previous Next

mxmlSaveAllocString()


Description

Save an XML node tree to an allocated string. This function returns a pointer to a string containing the textual representation of the XML node tree. The string should be freed using the free() function when you are done with it. NULL is returned if the node would produce an empty string or if the string cannot be allocated. The callback argument specifies a function that returns a whitespace string or NULL before and after each element. If MXML_NO_CALLBACK is specified, whitespace will only be added before MXML_TEXT nodes with leading whitespace and before attribute names inside opening element tags.

Syntax

char *
mxmlSaveAllocString(
    mxml_node_t * node,
    const char * (*cb)(mxml_node_t *node, int ws));

Arguments

NameDescription
nodeNode to write
(*cb)(mxml_node_t *node, int ws)Whitespace callback or MXML_NO_CALLBACK

Returns

Allocated string or NULL


Contents Previous Next