[Axl] Printing contents of a node?

Francis Brosnan Blazquez francis at aspl.es
Mon Sep 10 08:46:37 CEST 2007


Hi Steven,

I think your code looks good. Maybe you can provide the xml file you are
using, the result you are expecting and what you are finding...

Cheers!

> 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
> _______________________________________________
> Axl mailing list
> Axl at lists.aspl.es
> http://lists.aspl.es/cgi-bin/mailman/listinfo/axl
-- 
Francis Brosnan Blazquez <francis at aspl.es>
Advanced Software Production Line, S.L.




More information about the Axl mailing list