public Source resolve(String href, String base) throws TransformerException { if (log.isDebugEnabled() ) { log.debug( "base: " + base + " href: " + href ); } // pass if we don't have a systemId if (null == href) return null; // @todo // #### this is a pretty simplistic implementation. // #### we should really handle this better such that if // #### base is specified as an absolute URL // #### we trim the end off it and append href return new StreamSource(context.getResourceAsStream(href)); } };
if (sourceObj instanceof String) { String uri = (String) sourceObj; xmlInputSource = new InputSource(context.getResourceAsStream(uri)); xmlInputSource = new InputSource(context.getResourceAsStream(uri)); xmlInputSource = new InputSource(context.getResourceAsStream(uri));
/** * 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); } return script.compile(); }
/** * 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+" : "+uri, e); } catch (SAXException e) { throw new JellyException(JellyContext.BAD_PARSE+" : "+uri, e); } return script.compile(); }
/** * 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+" : "+uri, e); } catch (SAXException e) { throw new JellyException(JellyContext.BAD_PARSE+" : "+uri, e); } return script.compile(); }
/** * 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+" : "+uri, e); } catch (SAXException e) { throw new JellyException(JellyContext.BAD_PARSE+" : "+uri, e); } return script.compile(); }