On Tuesday, February 25, 2003, at 11:45 AM, James Strachan wrote:


[snip]

XMLOutput uses aggregation to work with any SAX ContentHandler or
LexicalHandler so no need to derive.

XMLParser is a ContentHandler and LexicalHandler. So you could do something
like this in pseudo code


public class EvalTag extends TagSupport {
    private String var;

    public void doTag(XMLOutput output) throws JellyTagException {
        XMLParser parser = new XMLParser();
        XMLOutput newOutput = new XMLOutput( parser );

        // invoke body, redirecting SAX events into the Jelly parser
        invokeBody( newOutput );
        Script script = parser.getScript();

        if (var != null) {
            context.setVariable(var, script);
        }
        else {
            // lets just execute the new script
            script.run(context, output);
        }
    }
}

James
-------
http://radio.weblogs.com/0112098/

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Pretty much exactly what I'd done with my previous message, though I'm still having an issue with variables set in the body's script not being visible to the parent script.

Ideas?

- Sean


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to