axl main logo
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
axlDoc * axl_doc_parse_from_file ( const char *  file_path,
axlError **  error 

Allows to parse an xml document from the given file path location.

This function works the same way like axl_doc_parse and axl_doc_parse_strings, but using as an input, the selected file provided by the path. In fact, all this function, use the same xml parse engine. The advantage of this function is that it is more efficient while reading huge xml files.

Here is an example:

1 axlDoc * doc = NULL;
2 axlError * error = NULL;
4 // parse the provide file
5 doc = axl_doc_parse_from_file ("test.xml", &error);
6 if (doc == NULL) {
7  // check error found
8  printf ("ERROR: (code: %d) %s\n",
9  axl_error_get_code (error),
10  axl_error_get (error));
11  axl_error_free (error);
12  return -1;
13 }
15 // do some stuff with the read document
17 // release it once no longer needed
18 axl_doc_free (doc);
file_pathThe file path to report.
errorThe axlError where errors found will be reported.