You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by nathan phillips <na...@hotmail.com> on 2003/11/10 17:26:52 UTC
Jelly Questions
I successfully used Jelly last year in a project and am looking to use it
once again in a new project. I was wondering what the status of Jelly as a
project is. Is it alive?
More importantly I have a question in regards to the API
JellyContext.runScript. I would like to dynamically create a Jelly script
that I can either pass in as a Document (dom4j or w3c) or a simple String to
the JellyContext to execute. From the runScript API it appears I can only
pass in a reference (File or URL) to a file located on disk. Is there
anyway to dynamically build up a script and have Jelly execute it without
writing one to disk? Thanks.
_________________________________________________________________
Send a QuickGreet with MSN Messenger
http://www.msnmessenger-download.com/tracking/cdp_games
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: Jelly Questions
Posted by Paul Libbrecht <pa...@ags.uni-sb.de>.
On Lundi, nove 10, 2003, at 17:26 Europe/Paris, nathan phillips wrote:
> I successfully used Jelly last year in a project and am looking to use
> it once again in a new project. I was wondering what the status of
> Jelly as a project is. Is it alive?
Yes, kind of...
> More importantly I have a question in regards to the API
> JellyContext.runScript. I would like to dynamically create a Jelly
> script that I can either pass in as a Document (dom4j or w3c) or a
> simple String to the JellyContext to execute. From the runScript API
> it appears I can only pass in a reference (File or URL) to a file
> located on disk. Is there anyway to dynamically build up a script and
> have Jelly execute it without writing one to disk? Thanks.
Well, you should always be able to pass-in an InputSource with a reader
in there that would read your string. The reason you need file or URL
is that you need (well, you MAT beed) a system-Id in order to resolver
relative references...
But exercuting jelly from a DOM4j (or just a jelly-output) would make
sense, it's not just not made yet. I am not clear yet wether it's so
easy...
Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: Jelly Questions
Posted by Daryl Stultz <da...@6degrees.com>.
"Jakarta Commons Users List" <co...@jakarta.apache.org> writes:
>> More importantly I have a question in regards to the API
>> JellyContext.runScript. I would like to dynamically create a Jelly
>script
>> that I can either pass in as a Document (dom4j or w3c) or a simple
>String to
>> the JellyContext to execute.
>
>None at the moment, but it is an often asked for, much desired feature.
Here's a method to do so that someone here helped me with:
public Script compileScriptFromString(JellyContext context, String
scriptString) throws Throwable {
XMLParser parser = new XMLParser();
parser.setContext(context);
Reader in = new java.io.StringReader(scriptString);
Script script = null;
try {
script = parser.parse(in);
} catch (IOException e) {
throw new JellyException("Could not parse Jelly script",e);
} catch (SAXException e) {
throw new JellyException("Could not parse Jelly script",e);
}
try {in.close();} catch (IOException ex) {}
return script.compile();
}
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:daryl@6degrees.com
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: Jelly Questions
Posted by di...@multitask.com.au.
Jelly is very much alive.
It doesn't get the TLC it deserves, but we're getting there.
"nathan phillips" <na...@hotmail.com> wrote on 11/11/2003 03:26:52 AM:
> I successfully used Jelly last year in a project and am looking to use
it
> once again in a new project. I was wondering what the status of Jelly
as a
> project is. Is it alive?
>
> More importantly I have a question in regards to the API
> JellyContext.runScript. I would like to dynamically create a Jelly
script
> that I can either pass in as a Document (dom4j or w3c) or a simple
String to
> the JellyContext to execute. From the runScript API it appears I can
only
> pass in a reference (File or URL) to a file located on disk. Is there
> anyway to dynamically build up a script and have Jelly execute it
without
> writing one to disk? Thanks.
None at the moment, but it is an often asked for, much desired feature.
I know Mike Bowler wanted it for HtmlUnit too.
If you've got a patch for JellyContext, I'd be happy to check it out and
apply it.
--
dIon Gillard, Multitask Consulting
Blog: http://blogs.codehaus.org/people/dion/
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org