[Axl] Printing contents of a node?

Steven Starr comtuxaps at gmail.com
Sat Sep 8 08:59:33 CEST 2007


Hello i was wondering if anyone could point out what i am doing wrong what i
am trying to do is just print out the contents of a node i have read most of
the api but i just need a little bit more help.


 #include <axl.h>
 #include <stdio.h>

 int main (int argc, char **argv)
 {
    axlError **error;

    // top level definitions
    axlDoc *doc = NULL;
    axlNode *node = NULL;
    const   char  * value;

    // initialize axl library
    if (! axl_init ()) {
        printf ("Unable to initialize Axl library\n");
          return -1;
    }

    // get current doc reference
    doc = axl_doc_parse_from_file ("test.xml", error);
    if (doc == NULL) {
        axl_error_free (*error);
        return false;
    }

    node = axl_doc_get_root(doc);
    value = axl_node_get_content(node, NULL);
    printf("%s \n", value);

    // release the document
    axl_doc_free (doc);

    // cleanup axl library
    axl_end ();

    return true;
 }

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.aspl.es/pipermail/axl/attachments/20070908/ca18da34/attachment.htm 


More information about the Axl mailing list