[LIBXML2] Update to version 2.9.9. CORE-15854

This commit is contained in:
Thomas Faber 2019-03-12 10:19:35 +01:00
parent 743951eccf
commit 1fe58c4058
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
22 changed files with 291 additions and 461 deletions

View file

@ -2071,51 +2071,52 @@ static void doXPathDump(xmlXPathObjectPtr cur) {
int i;
xmlNodePtr node;
#ifdef LIBXML_OUTPUT_ENABLED
xmlSaveCtxtPtr ctxt;
xmlOutputBufferPtr buf;
if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr <= 0)) {
fprintf(stderr, "XPath set is empty\n");
progresult = XMLLINT_ERR_XPATH;
break;
}
ctxt = xmlSaveToFd(1, NULL, 0);
if (ctxt == NULL) {
buf = xmlOutputBufferCreateFile(stdout, NULL);
if (buf == NULL) {
fprintf(stderr, "Out of memory for XPath\n");
progresult = XMLLINT_ERR_MEM;
return;
}
for (i = 0;i < cur->nodesetval->nodeNr;i++) {
node = cur->nodesetval->nodeTab[i];
xmlSaveTree(ctxt, node);
xmlNodeDumpOutput(buf, node->doc, node, 0, 0, NULL);
xmlOutputBufferWrite(buf, 1, "\n");
}
xmlSaveClose(ctxt);
xmlOutputBufferClose(buf);
#else
printf("xpath returned %d nodes\n", cur->nodesetval->nodeNr);
#endif
break;
}
case XPATH_BOOLEAN:
if (cur->boolval) printf("true");
else printf("false");
if (cur->boolval) printf("true\n");
else printf("false\n");
break;
case XPATH_NUMBER:
switch (xmlXPathIsInf(cur->floatval)) {
case 1:
printf("Infinity");
printf("Infinity\n");
break;
case -1:
printf("-Infinity");
printf("-Infinity\n");
break;
default:
if (xmlXPathIsNaN(cur->floatval)) {
printf("NaN");
printf("NaN\n");
} else {
printf("%0g", cur->floatval);
printf("%0g\n", cur->floatval);
}
}
break;
case XPATH_STRING:
printf("%s", (const char *) cur->stringval);
printf("%s\n", (const char *) cur->stringval);
break;
case XPATH_UNDEFINED:
fprintf(stderr, "XPath Object is uninitialized\n");