Contents Previous Next

mxmlLoadString()


Description

Load a string into an XML node tree. The nodes in the specified string are added to the specified top node. If no top node is provided, the XML string MUST be well-formed with a single parent node like <?xml> for the entire string. The callback function returns the value type that should be used for child nodes. If MXML_NO_CALLBACK is specified then all child nodes will be either MXML_ELEMENT or MXML_TEXT nodes. The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK, MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading child nodes of the specified type.

Syntax

mxml_node_t *
mxmlLoadString(
    mxml_node_t * top,
    const char * s,
    mxml_type_t (*cb)(mxml_node_t *node));

Arguments

NameDescription
topTop node
sString to load
(*cb)(mxml_node_t *node)Callback function or MXML_NO_CALLBACK

Returns

First node or NULL if the string has errors.


Contents Previous Next