axl main logo
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
axlDoc * axl_doc_parse_strings ( axlError **  error,
  ... 
)

Allows to parse an xml document that is provided as a set of strings ended by a NULL reference.

This function works the same way like axl_doc_parse function, but allowing to provide a set of strings. Here is an example:

1 // a document reference
2 axlDoc * doc;
3 
4 // note that the error is optional, and, if provided, it is not
5 // required to initialize it.
6 axlError * error;
7 
8 // parse the following set of strings
9 doc = axl_doc_parse_strings (&error,
10  "<?xml version='1.0' standalone='yes' ?>",
11  "<complex>",
12  " <data>",
13  " <row>",
14  " <td>",
15  " <value attr='10'/>
16  " </td>",
17  " </row>",
18  " </data>",
19  "</complex>",
20  NULL); // last null reference
21 // check for an error
22 if (doc == NULL) {
23  printf ("There was an error while parsing the document: (code: %d) %s\n",
24  axl_error_get_code (error), axl_error_get (error));
25  axl_error_free (error);
26 }
Parameters
errorAn optional axlError reference where a textual diagnostic will be provided.
Returns
A newly created axlDoc reference that must be deallocated by using axl_doc_free when no longer needed.

References axl_doc_parse(), axl_free(), AXL_LEVEL_DEBUG, axl_return_val_if_fail, and axl_stream_concat().