Just to help out others here is the complete code that works.<br><br> #include <axl.h><br> #include <stdio.h><br><br>/*How to compile this code.*/<br>/* gcc parser.c -o parser -I/usr/include/axl -laxl -lm */<br>
<br> int main (int argc, char *argv[])<br> {<br> axlError **error;<br><br> // top level definitions<br> axlDoc *doc = NULL;<br> axlNode *node = NULL;<br> char *value;<br> <br> // initialize axl library
<br> if (! axl_init ()) {<br> printf ("Unable to initialize Axl library\n");<br> return -1;<br> }<br><br> // get current doc reference<br> doc = axl_doc_parse_from_file ("test.xml
", error);<br> if (doc == NULL) {<br> axl_error_free (*error);<br> return false;<br> }<br> <br> node = axl_doc_get_root(doc);<br> axl_node_dump(node, &value, NULL);<br> printf("%s \n", value);
<br> <br> // release the document<br> axl_doc_free (doc);<br> axl_free (value);<br><br> // cleanup axl library<br> axl_end ();<br><br> return true;<br> }<br><br><br>Here is the xml file "test.xml"
<br><br><?xml version="1.0" encoding="ISO-8859-1"?><br><br><metadata><br> <name>axl</name><br></metadata><br><br><br>Here is what the output looks like.<br><br>bash-3.2#
./parser<br><metadata><name>axl</name></metadata> <br><br>And A Thank You To Francis For They Help :)<br>