public final VariableReference bindVariable(StructuredQName qName) throws XPathException {
// bindVariable is called at compile time, but the JAXP variable resolver
// is designed to be called at run time. So we need to create a variable now,
// which will call the variableResolver when called upon to return the run-time value
if (variableResolver != null) {
return new VariableReference(new JAXPVariable(qName, variableResolver));
} else {
throw new XPathException(
"Variable is used in XPath expression, but no JAXP VariableResolver is available");
}
}