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);
#endif /* LIBXML_XPTR_ENABLED */
if (resObj == NULL)
goto out_fragment;
switch (resObj->type) {
case XPATH_NODESET:
break;
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:
if ((resObj != NULL) && (resObj->type != XPATH_NODESET)) {
xsltTransformError(tctxt, NULL, NULL,
"document() : XPointer does not select a node set: #%s\n",
fragment);
goto out_object;
xmlXPathFreeObject(resObj);
resObj = NULL;
}
valuePush(ctxt, resObj);
xmlFree(fragment);
return;
out_object:
xmlXPathFreeObject(resObj);
out_fragment:
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
if (resObj == NULL)
resObj = xmlXPathNewNodeSet(NULL);
valuePush(ctxt, resObj);
xmlFree(fragment);
}

View File

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