Hi,

I am using JXPath in my Taglib implementation, description is in
http://www.mail-archive.com/cocoon-dev@xml.apache.org/msg16919.html

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). JXPathCocoonContexts.java 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?

Regards,

Volker







> From: Vadim Gritsenko [mailto:[EMAIL PROTECTED]]
> > From: Piroumian Konstantin [mailto:[EMAIL PROTECTED]]
> > > From: Vadim Gritsenko [mailto:[EMAIL PROTECTED]]
> ...
> > > 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
not).

>
>
> > 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 http://www.jcp.org/jsr/detail/52.jsp?
> 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.

KP

>
> Vadim
>
> > Konstantin
>
> ...
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>

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






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

Reply via email to