Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit c04d9b1

Browse files
committed
xinclude: Don't raise error on empty nodeset
xmlXPtrEval returning NULL means an empty nodeset if no error code is set. See #733.
1 parent aa90cb0 commit c04d9b1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

xinclude.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,7 @@ xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
14711471
#endif
14721472
}
14731473
xptr = xmlXPtrEval(fragment, ctxt->xpctxt);
1474-
if (xptr == NULL) {
1474+
if (ctxt->xpctxt->lastError.code != XML_ERR_OK) {
14751475
if (ctxt->xpctxt->lastError.code == XML_ERR_NO_MEMORY)
14761476
xmlXIncludeErrMemory(ctxt);
14771477
else
@@ -1480,6 +1480,8 @@ xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
14801480
fragment);
14811481
goto error;
14821482
}
1483+
if (xptr == NULL)
1484+
goto done;
14831485
switch (xptr->type) {
14841486
case XPATH_UNDEFINED:
14851487
case XPATH_BOOLEAN:
@@ -1559,6 +1561,7 @@ xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
15591561
}
15601562
#endif
15611563

1564+
done:
15621565
ret = 0;
15631566

15641567
error:

0 commit comments

Comments
 (0)