Contents Previous Next

mxmlSaveString()


Description

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.

Syntax

int
mxmlSaveString(
    mxml_node_t * node,
    char * buffer,
    int bufsize,
    const char * (*cb)(mxml_node_t *node, int ws));

Arguments

NameDescription
nodeNode to write
bufferString buffer
bufsizeSize of string buffer
(*cb)(mxml_node_t *node, int ws)Whitespace callback or MXML_NO_CALLBACK

Returns

Size of string


Contents Previous Next