Nothing.
If you could post a short but complete example of your XML, it would
help us help you. It's hard to troubleshoot otherwise.
Ed
Ok, you are right.
I use this code with libxml on linux.
If I set query = "//book/price/text()*10" it doesn't find results and
size is == 0, but with query = "//book/price/text()" it returns
correctly all price.
what's wrong? Thank you very very much.
char* filename = "test.xml";
/* libxml */
xmlDocPtr doc;
xmlXPathContextPtr xpathCtx;
xmlXPathObjectPtr xpathObj;
doc = xmlParseFile(filename);
/* Create xpath evaluation context */
xpathCtx = xmlXPathNewContext(doc);
/* Evaluate xpath expression */
xpathObj = xmlXPathEvalExpression((xmlChar*)query, xpathCtx);
/* Print results */
xmlNodeSetPtr nodes = xpathObj->nodesetval;
xmlNodePtr cur;
int size = (nodes) ? nodes->nodeNr : 0;
for(int i = 0; i < size; ++i) {
if(nodes->nodeTab
->type == XML_NAMESPACE_DECL) {
xmlNsPtr ns;
ns = (xmlNsPtr)nodes->nodeTab;
cur = (xmlNodePtr)ns->next;
if(cur->ns) {
printf( "1= namespace \"%s\"=\"%s\" for node %s:%s\n",
ns->prefix, ns->href, cur->ns->href, cur->name);
} else {
printf( "2= namespace \"%s\"=\"%s\" for node %s\n",
ns->prefix, ns->href, cur->name);
}
} else if(nodes->nodeTab->type == XML_ELEMENT_NODE) {
cur = nodes->nodeTab;
if(cur->ns) {
printf( "3= element node \"%s:%s\"\n", cur->ns->href, cur->name);
xmlChar *key = xmlNodeListGetString(doc, cur, 1); [cut]
} else {
printf( "4= element node \"%s\"\n", cur->name); xmlChar *key =
xmlNodeListGetString(doc, cur, 1);
}
} else {
cur = nodes->nodeTab;
printf( "5= node \"name %s\": type %d\n", cur->name, cur->type);
xmlChar *key = xmlNodeGetContent(cur);
xmlFree(key);
}
}