cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Werner Masik (JIRA)" <>
Subject [jira] Commented: (COCOON-1737) JXTemplate Generater: set var problem
Date Thu, 19 Jan 2006 13:48:42 GMT
    [ ] 

Werner Masik commented on COCOON-1737:

Sorry. I have to correct myself. The problem seems to be more complex than it looked like.
The bug cannot be reproduced with the example of my previous comment.
Further testing showed the following problems:

<jx:set var="gew_liste_id" value="Hello ${cocoon.request.get('liste_id')}" />
<liste_id path="${gew_liste_id}" />

leads to:
<liste_id path="Hello ${cocoon.request.get('liste_id')}">

instead of:
<liste_id path="Hello world">

(presuming that the request parameter liste_id contains the String 'world')
So the Jexl string ${cocoon.request.get('liste_id')} is not interpreted.

but without the Hello it works:
<jx:set var="gew_liste_id" value="${cocoon.request.get('liste_id')}" /> 

So maybe the documentation is wrong, or it's a bug. The workaround is to use the body:

<jx:set var="gew_liste_id">Hello ${cocoon.request.get('liste_id')}</jx:set>

The next problem is if you use a alias in another alias:

<jx:set var="gew_liste_id">Hello ${cocoon.request.get('liste_id')}</jx:set>
<jx:set var="testvar">the teststring is ${gew_liste_id}</jx:set>
<somexml myattr="${testvar}" />

leads to:
<somexml myattr="[Lorg.w3c.dom.Node;@1abcd5e" />

Once again it works if it is used in the body:


leads to:
<somexml>the teststring is Hello world</somexml>

That is what I actually tried to explain in my first comment. Sorry for the confusion.

> JXTemplate Generater: set var problem
> -------------------------------------
>          Key: COCOON-1737
>          URL:
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Templating
>     Versions: 2.1.9-dev (current SVN)
>     Reporter: Werner Masik
>     Priority: Minor

> It looks to me like something is wrong with <jx:set var="" > . AFAIK set var just
is a alias and can be used like any other variable in the template. But it is not possible
to use it in a attribute value.
> example:
> <jx:set var="testvar" value="hello" />
> <somexml    myattr="${testvar}" />
> leads to something like:
> <somexml    myattr="[Lorg.w3c.dom.Node;@1abcd5e" />
> Obviously not the content of the variable is returned, but the reference to the DOM-node.
It works normal if it is used within the body.
> This problem might be related to

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message