[xml] XPointer with libxml 2.5.10 on win32
- From: Jerome Martin <jerome martin alma fr>
- To: "'xml gnome org '" <xml gnome org>
- Subject: [xml] XPointer with libxml 2.5.10 on win32
- Date: Wed, 27 Aug 2003 14:12:23 +0200
Title: Message
Hi,
I have the following
simplified XML tree
<document>
<installation id='121'>
<customer name='foo'/>
</installation>
<installation id='25'>
<customer name='bar'/>
</installation>
</document>
I have a function
which manage an 'installation' node and I'm trying to get customer name with
XPointer with the following code:
void
ManageInstallation (xmlDocPtr doc, xmlNodePtr
pnode)
{
xmlXPathContextPtr context;
xmlXPathObjectPtr
result;
context =
xmlXPtrNewContext(doc, pnode, NULL);
if (!context)
return;
xmlChar *_expression_ = BAD_CAST "customer name";
result =
xmlXPtrEval(_expression_, context);
if (!result)
return;
xmlChar * resultString =
xmlXPathCastToString(result);
if (resultString)
{
printf("%s\n", resultString); /* utf8 */
}
xmlXPathFreeObject(result);
xmlXPathFreeContext(context);
}
the problem is that
result is NULL even if I call xmlXPtrNewContext(doc, NULL,
NULL)
Jérôme
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]