Re: [xml] libxml2, xpath, accessing attribute value



On Fri, Feb 25, 2011 at 07:24:30PM -0500, Henry E. wrote:
Hello,

I'm been experimenting with the xpath1.c program.  How does a person
access the value of an attribute?  I tried a few things that did not work and I
also read the man but that did not clarify the issue.

I know I'm trying to access an attribute because the last item of my xpath
is a '@example'.

  You will get back a node set pointer structure, and then assuming it's
not empty you can look at the values for this (those) node(s) as usual.
alternatively you van ask string(     example) and you will get back
a XPath object containing a string.

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



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