if (doc != null && (templates == null || doc.getLastModified() > lastModified))
if (doc != null && (templates == null || doc.getMetadata().getLastModified() > lastModified))
		public Templates getTemplates() throws TransformerConfigurationException, IOException, XPathException {			if (uri.startsWith("xmldb:exist://")) {				String docPath = uri.substring("xmldb:exist://".length());				DocumentImpl doc = null;				try {					doc = context.getBroker().openDocument(docPath, Lock.READ_LOCK);					if (doc != null && (templates == null || doc.getLastModified() > lastModified))						templates = getSource(factory, doc);					lastModified = doc.getLastModified();				} catch (PermissionDeniedException e) {					throw new XPathException("Permission denied to read stylesheet: " + uri);				} finally {					doc.getUpdateLock().release(Lock.READ_LOCK);				}			} else {				URL url = new URL(uri);				URLConnection connection = url.openConnection();				long modified = connection.getLastModified();				if(templates == null || modified > lastModified || modified == 0) {					LOG.debug("compiling stylesheet " + url.toString());					templates = factory.newTemplates(new StreamSource(connection.getInputStream()));				}				lastModified = modified;			}			return templates;		}