Save an XML node tree to a string. This function returns the total number of bytes that would be required for the string but only copies (bufsize - 1) characters into the specified buffer. 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.
int mxmlSaveString( mxml_node_t * node, char * buffer, int bufsize, const char * (*cb)(mxml_node_t *node, int ws));
Name | Description |
---|---|
node | Node to write |
buffer | String buffer |
bufsize | Size of string buffer |
(*cb)(mxml_node_t *node, int ws) | Whitespace callback or MXML_NO_CALLBACK |
Size of string