----- Original Message -----
From: "Shawn Bayern" <[EMAIL PROTECTED]>
> It seems that there are really two separate issues:  you're discussing (a)
> a JSP preprocessor (as you later described) and (b) an XSLT engine aware
> of the PageContext.  The idea of a preprocessor is somewhat general but
> probably not needed by too many people.  However, the latter idea is
> something that I've had in the back of my mind; it might be appropriate in
> a future version of JSTL to allow the XPath variables that make up the
> XPath evaluative context in JSTL tags to apply also to XSLT
> transformations conducted through <x:transform>.  At least, it's probably
> worth exploring.

Agreed - I've had this thought too. The only real issue is the current JAXP
API for XSLT requires that all variables be pushed into XSLT - XSLT is not
capable of pulling the variables depending on the contents of the
stylesheet. So the only way, until JAXP changes, is via

<x:transform...>
    <x:param name="foo" value="${something."/>
</x:tranform>

If JAXP introduced some kind of VariableScope interface that could be set on
a Transformer to resolve variables, it'd be easy to expose JSP scopes into
an XSLT engine without unecessary manual plumbing like the above use of
<x:param/>. Stylesheets could just pull in variables as and when they are
needed..

public interface VariableContext {
    public Object getVariableValue( String uri, String localName );
}

The above is pretty much what VariableContext looks like in Jaxen

http://jaxen.org/
http://jaxen.org/apidocs/org/jaxen/VariableContext.html


I've submitted the above proposal to the JAXP EG but as usual, when you're
not on an EG you never hear anything more about it ;-)

James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

Reply via email to