for (String prefix : nsBindings.keySet()) {
xcomp.declareNamespace(prefix, nsBindings.get(prefix));
}
XPathExecutable xexec = null;
try {
xexec = xcomp.compile(xpath);
} catch (SaxonApiException sae) {
Throwable t = sae.getCause();
if (t instanceof XPathException) {
XPathException xe = (XPathException) t;
if (xe.getMessage().contains("Undeclared (or unbound?) variable")) {