}
private boolean docAvailable(String href, XPathContext context) throws URISyntaxException {
try {
String documentKey = Document.computeDocumentKey(href, expressionBaseURI, context);
DocumentPool pool = context.getController().getDocumentPool();
if (pool.isMarkedUnavailable(documentKey)) {
return false;
}
DocumentInfo doc = pool.find(documentKey);
if (doc != null) {
return true;
}
Item item = Document.makeDoc(href, expressionBaseURI, context, this);
if (item != null) {
return true;
} else {
// The document does not exist; ensure that this remains the case
pool.markUnavailable(documentKey);
return false;
}
} catch (Exception err) {
try {
new URI(href);