cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: RE: [Q] XScript...
Date Thu, 25 Jul 2002 19:58:51 GMT


I am using JXPath in my Taglib implementation, description is in

I have written a out Tag which can be used to get/set variables in
request/session or context like
<jxpath:out var="$session/name" value="$request/person/name" />
The first step is selection of the person attribute on the request, if person is
a Object the getName Method is called and the result is stored as a session
attribute. It is also possible that the person attribute is a DOM-Node, then the
content of the name Element is selected.
If you write:
<jxpath:out value="$request/person/name" />
The value is written to the SAX-Pipeline instead of putting it to a variable.
Look at org.apache.cocoon.taglib.jxpath.core.OutTag.

session,request and application are predefined variables. The Implementation of
the variable management is already part of the scratchpad
(org.apache.cocoon.jxpath). is a
RequestLifecycleComponent which manages the different variable context. This
Component can be used independant of the taglib implementation.

In September (after my vacation in August) I plan to implement a
"ExpressionFactory" to make it posible to plugin different Expression languages
to Cocoon like JSTL, JXPath or Jexl (commons-sandbox). In my current Tag
implementation the variable management is impl. in the
org.apache.cocoon.taglib.VarTagSupport class, which itself uses
JXPathCocoonContexts. I plan to implement this functionality as a generic Avalon
Component, so everyone and of course my taglib, can use it to access variables
from session/request/applicationcontext .... using diffent expression languages.

What do you think?



> From: Vadim Gritsenko []
> > From: Piroumian Konstantin []
> > > From: Vadim Gritsenko []
> ...
> > > 3. Move to DOM for variable storage. This will allow adding xpath
> > > functionality to the logicsheet without extra re-parsing.
> >
> > Are going to use JXPath as XPath engine?
> I will use whatever xpath engine is configured in your cocoon.xconf.

XPath engine works only with DOM, but JXPath works either with DOM and
JavaBeans. (But haven't look at the syntax, if it's the same for both or

> > This will allow to store variables
> > either as DOM or JavaBeans. I don't know much about the Xscript, but
> your
> It is similar to whatever we have in webapps.session package (aka
> sunShine context). It allows creating named XML variables in different
> scopes, allows transforming one variable using stylesheet from another
> variable, and allows outputting these variables to the pipeline. See
> xscript demos for syntax.

Wow! ;)

> > proposal looks like the same thing from JSTL (Java Standart Tag
> Library).
> Java Standard Tag Library from
> Never seen it before... Yes, it is somewhat similar, but main
> difference
> is that XScript is XML oriented (at least ATM).
> I will think about re-using syntax defined in the JSR.

Note, that they have separate tags for XML variables and JavaBeans.

> > Adding an expression language to all the logicsheets that require
> access to
> > data in page, request, session or app contexts would be an excellent
> > enhancement.
> >
> > Does this make sense in context of XScript?
> Elaborate what you mean.

I just don't know anything about XScript and not sure that my proposal is
applicable to XScript.


> Vadim
> > Konstantin
> ...
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, email:

To unsubscribe, e-mail:
For additional commands, email:

To unsubscribe, e-mail:
For additional commands, email:

View raw message