[xml] Obtaining a string result from an XPATH function?



Hi, 
Perhaps this is not even possible, but I'm wondering how to get the
string result from an XPATH expression in my C code.
  xmlXPathInit();

  doc = xmlParseFile("foo.xml");
  if (doc == NULL) 
    return -1;

  ctxt = xmlXPathNewContext(doc);       
  obj  = xmlXPathEvalExpression("strcat(THIS,THAT)", ctxt); 

unfortunately this -
  printf ("String:%s user:%s user2 %s\n", 
   obj->stringval,
   obj->user,  
   obj->user2);
doesn't print anything

and this
  xmlShellPrintXPathResult(obj);
and this
  xmlXPathDebugDumpObject(stdout, obj, 0);
print that the object is a  string but do not print the value.

Is there a problem with my expression?  What happens to the string value?

Thanks,
Horst



Get your own FREE E-mail address at http://www.linuxfreemail.com
Linux FREE Mail is 100% FREE, 100% Linux, 100% better, and 100% yours!





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]