Load a file descriptor into an XML node tree. The nodes in the specified file are added to the specified top node. If no top node is provided, the XML file MUST be well-formed with a single parent node like <?xml> for the entire file. 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.
mxml_node_t * mxmlLoadFd( mxml_node_t * top, int fd, mxml_type_t (*cb)(mxml_node_t *node));
Name | Description |
---|---|
top | Top node |
fd | File descriptor to read from |
(*cb)(mxml_node_t *node) | Callback function or MXML_NO_CALLBACK |
First node or NULL if the file could not be read.