diff --git a/xpointer.c b/xpointer.c
--- a/xpointer.c
+++ b/xpointer.c
@@ -1152,10 +1152,11 @@
     if (name == NULL)
 	XP_ERROR(XPATH_EXPR_ERROR);
     while (name != NULL) {
+	ctxt->error = XPATH_EXPRESSION_OK;
 	xmlXPtrEvalXPtrPart(ctxt, name);
 
 	/* in case of syntax error, break here */
-	if (ctxt->error != XPATH_EXPRESSION_OK)
+	if (ctxt->error != XPATH_EXPRESSION_OK && ctxt->error != XML_XPTR_UNKNOWN_SCHEME)
 	    return;
 
 	/*
