Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 14437 invoked from network); 12 Nov 2003 13:44:32 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 12 Nov 2003 13:44:32 -0000 Received: (qmail 14392 invoked by uid 500); 12 Nov 2003 13:44:24 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 14348 invoked by uid 500); 12 Nov 2003 13:44:24 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 14304 invoked from network); 12 Nov 2003 13:44:23 -0000 Received: from unknown (HELO mail.6degrees.com) (64.51.116.5) by daedalus.apache.org with SMTP; 12 Nov 2003 13:44:23 -0000 Message-id: Date: Wed, 12 Nov 2003 08:47:34 -0500 Subject: Re: Jelly Questions To: "Jakarta Commons Users List" From: "Daryl Stultz" References: In-Reply-To: MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N "Jakarta Commons Users List" 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