Re: [xml] Xpath Question
- From: Martin Trappel <0xCDCDCDCD gmx at>
- To: xml gnome org
- Subject: Re: [xml] Xpath Question
- Date: Tue, 21 Oct 2008 14:46:12 +0200
Alistair Leslie-Hughes wrote:
Hi,
I have the following XML
<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<string>C4TJXQFL</string>
and using msxml I can do "selectSingleNode("string")" to select the root
node.
Is there an xmlXPath or equivalent function? (assume that I cannot
change the "string" parameter)
xmlDocPtr doc;
...
xpctxt = xmlXPathNewContext(doc);
xpobj = xmlXPathEvalExpression("/string", xpctxt);
if(xpobj->nodesetval->nodeNr)
xmlNodePtr string_root_node = nodeSet->nodeTab[0];
...
(error checks and freeing stuff omitted.)
br,
Martin
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]