[xml] help: how to get content of an element via XPath in libxml2
- From: andy glew amd com
- To: xml gnome org
- Subject: [xml] help: how to get content of an element via XPath in libxml2
- Date: Wed, 23 Apr 2003 16:49:09 -0700
help: how to get content of an element via XPath in libxml2
Stupid question, but...
I am using libxml2, 2.5.6
I want to be able to use XPath syntax to get the textual content
of a field of a record. E.g. for something like:
after having parsed the above, I want to be able to do something like
== " value\n <baz\>\n "
ok, I wrote the above in a C++ style syntax
- in C it might look like
0 == strcmp( xmlGetContent(xmlXPathEvalExpression(document,"/record/field")))
(with a memory leak... yeah, yeah...)
I must be stupid, or, at least, lacking a good browser,
but I can't figure out how to go from xmlXPathEvalExpression
to any of the xmlNodeGetContent or similar functions.
] [Thread Prev