1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-07-29 15:41:13 +03:00

Remove case labels with XPointer location types

This commit is contained in:
Nick Wellnhofer
2022-04-21 04:53:46 +02:00
parent 02c6ce836c
commit 36bbe5ab3c
2 changed files with 9 additions and 30 deletions

View File

@ -187,36 +187,18 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
xmlXPathFreeContext(xptrctxt); xmlXPathFreeContext(xptrctxt);
#endif /* LIBXML_XPTR_ENABLED */ #endif /* LIBXML_XPTR_ENABLED */
if (resObj == NULL) if ((resObj != NULL) && (resObj->type != XPATH_NODESET)) {
goto out_fragment; xsltTransformError(tctxt, NULL, NULL,
"document() : XPointer does not select a node set: #%s\n",
switch (resObj->type) { fragment);
case XPATH_NODESET: xmlXPathFreeObject(resObj);
break; resObj = NULL;
case XPATH_UNDEFINED:
case XPATH_BOOLEAN:
case XPATH_NUMBER:
case XPATH_STRING:
case XPATH_POINT:
case XPATH_USERS:
case XPATH_XSLT_TREE:
case XPATH_RANGE:
case XPATH_LOCATIONSET:
xsltTransformError(tctxt, NULL, NULL,
"document() : XPointer does not select a node set: #%s\n",
fragment);
goto out_object;
} }
valuePush(ctxt, resObj);
xmlFree(fragment);
return;
out_object:
xmlXPathFreeObject(resObj);
out_fragment: out_fragment:
valuePush(ctxt, xmlXPathNewNodeSet(NULL)); if (resObj == NULL)
resObj = xmlXPathNewNodeSet(NULL);
valuePush(ctxt, resObj);
xmlFree(fragment); xmlFree(fragment);
} }

View File

@ -491,9 +491,6 @@ libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
case XPATH_STRING: case XPATH_STRING:
ret = PY_IMPORT_STRING((char *) obj->stringval); ret = PY_IMPORT_STRING((char *) obj->stringval);
break; break;
case XPATH_POINT:
case XPATH_RANGE:
case XPATH_LOCATIONSET:
default: default:
#ifdef DEBUG #ifdef DEBUG
printf("Unable to convert XPath object type %d\n", obj->type); printf("Unable to convert XPath object type %d\n", obj->type);