/**
* Attempts to parse the script from the given uri using the
* {@link #getResource} method then returns the compiled script.
*/
public Script compileScript(String uri) throws JellyException {
XMLParser parser = getXMLParser();
parser.setContext(this);
InputStream in = getResourceAsStream(uri);
if (in == null) {
throw new JellyException("Could not find Jelly script: " + uri);
}
Script script = null;
try {
script = parser.parse(in);
} catch (IOException e) {
throw new JellyException(JellyContext.BAD_PARSE, e);
} catch (SAXException e) {
throw new JellyException(JellyContext.BAD_PARSE, e);
}