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

On Sun, Mar 17, 2002 at 11:54:57AM -0800, Horst wrote:
Perhaps this is not even possible, but I'm wondering how to get the
string result from an XPATH expression in my C code.

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

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

  Hum ...  you're strcat'ing empty nodesets... it's
           xmlXPathEvalExpression("strcat('THIS','THAT')", ctxt);

Is there a problem with my expression?

  yes it's #1 XPath pittrap.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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