You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by oceatoon <t....@systheo.com> on 2004/11/19 13:27:17 UTC

JXTemplate jx:set variable problem ??

Hi everyone 
I have an odd behavior or I just can't see what I'm doing wrong, maybe
someone will have an inlightened eye tot is:

*******************************
if I do this in my html.jx file:
<jx:set var="keywords"><meta name="keywords" content="klgjgjkh"/></jx:set>
${keywords}

This works fine. the result is correctly : 
<meta name="keywords" content="klgjgjkh"/>
********************************

but now I need to do this:
<jx:set var="keywords">fssgffdgfdg sdfqfqs qfsdqq</jx:set>
<meta name="keywords" content="${keywords}"/>


and I get :
<meta content="[Lorg.w3c.dom.Node;@d4c191" name="keywords" />

[Lorg.w3c.dom.Node;@d4c191 seems to be my object, so I tried to
getValueNode() on this but it gets worse 
i get:
<meta content="" name="keywords" />

the same happens with XPath calls
I don't really understand

all thoughts are greatly appreciated
Thanks
Tibor


Re: JXTemplate jx:set variable problem ??

Posted by oceatoon <t....@systheo.com>.
Yes Sorry, my mistake for wanting to go to fast  
Tibor
Jorg Heymans wrote:

> 
> 
> oceatoon wrote:
>>>>[Lorg.w3c.dom.Node;@d4c191 seems to be my object, so I tried to
>>>>getValueNode() on this but it gets worse
> ^^^^^^^^^^^^^^^^
> In any case, this should be getNodeValue().
> 
> 
> Jorg



Re: JXTemplate jx:set variable problem ??

Posted by Jorg Heymans <jh...@domek.be>.

oceatoon wrote:
>>>[Lorg.w3c.dom.Node;@d4c191 seems to be my object, so I tried to
>>>getValueNode() on this but it gets worse
^^^^^^^^^^^^^^^^
In any case, this should be getNodeValue().


Jorg


Re: JXTemplate jx:set variable problem ??

Posted by oceatoon <t....@systheo.com>.
Yes that works perfectly
I need to have it but I will be putting tags in my content so I can't put it
in the value attribute like this 

<jx:set var="keywords"><i18n:text key="cococo">Cococo</i18n:text></jx:set>
<meta name="keywords" content="${keywords}"/>



Jorg Heymans wrote:

> I'm no jx expert, but wouldn't the following also work :
> 
> <jx:set var="keyword" value="akljfasdlkjf"/> ?
> 
> 
> Regards
> Jorg
> 
> oceatoon wrote:
>> Hi everyone
>> I have an odd behavior or I just can't see what I'm doing wrong, maybe
>> someone will have an inlightened eye tot is:
>> 
>> *******************************
>> if I do this in my html.jx file:
>> <jx:set var="keywords"><meta name="keywords"
>> content="klgjgjkh"/></jx:set> ${keywords}
>> 
>> This works fine. the result is correctly :
>> <meta name="keywords" content="klgjgjkh"/>
>> ********************************
>> 
>> but now I need to do this:
>> <jx:set var="keywords">fssgffdgfdg sdfqfqs qfsdqq</jx:set>
>> <meta name="keywords" content="${keywords}"/>
>> 
>> 
>> and I get :
>> <meta content="[Lorg.w3c.dom.Node;@d4c191" name="keywords" />
>> 
>> [Lorg.w3c.dom.Node;@d4c191 seems to be my object, so I tried to
>> getValueNode() on this but it gets worse
>> i get:
>> <meta content="" name="keywords" />
>> 
>> the same happens with XPath calls
>> I don't really understand
>> 
>> all thoughts are greatly appreciated
>> Thanks
>> Tibor
>> 
>>



Re: JXTemplate jx:set variable problem ??

Posted by oceatoon <t....@systheo.com>.
Well my final goal is to put <i18n:text> tags inside the jx:set variable so
I won't be able to use the value attribute.. :(


> I'm no jx expert, but wouldn't the following also work :
> 
> <jx:set var="keyword" value="akljfasdlkjf"/> ?
> 
> 
> Regards
> Jorg
> 
> oceatoon wrote:
>> Hi everyone
>> I have an odd behavior or I just can't see what I'm doing wrong, maybe
>> someone will have an inlightened eye tot is:
>> 
>> *******************************
>> if I do this in my html.jx file:
>> <jx:set var="keywords"><meta name="keywords"
>> content="klgjgjkh"/></jx:set> ${keywords}
>> 
>> This works fine. the result is correctly :
>> <meta name="keywords" content="klgjgjkh"/>
>> ********************************
>> 
>> but now I need to do this:
>> <jx:set var="keywords">fssgffdgfdg sdfqfqs qfsdqq</jx:set>
>> <meta name="keywords" content="${keywords}"/>
>> 
>> 
>> and I get :
>> <meta content="[Lorg.w3c.dom.Node;@d4c191" name="keywords" />
>> 
>> [Lorg.w3c.dom.Node;@d4c191 seems to be my object, so I tried to
>> getValueNode() on this but it gets worse
>> i get:
>> <meta content="" name="keywords" />
>> 
>> the same happens with XPath calls
>> I don't really understand
>> 
>> all thoughts are greatly appreciated
>> Thanks
>> Tibor
>> 
>>



Re: JXTemplate jx:set variable problem ??

Posted by Jorg Heymans <jh...@domek.be>.
I'm no jx expert, but wouldn't the following also work :

<jx:set var="keyword" value="akljfasdlkjf"/> ?


Regards
Jorg

oceatoon wrote:
> Hi everyone 
> I have an odd behavior or I just can't see what I'm doing wrong, maybe
> someone will have an inlightened eye tot is:
> 
> *******************************
> if I do this in my html.jx file:
> <jx:set var="keywords"><meta name="keywords" content="klgjgjkh"/></jx:set>
> ${keywords}
> 
> This works fine. the result is correctly : 
> <meta name="keywords" content="klgjgjkh"/>
> ********************************
> 
> but now I need to do this:
> <jx:set var="keywords">fssgffdgfdg sdfqfqs qfsdqq</jx:set>
> <meta name="keywords" content="${keywords}"/>
> 
> 
> and I get :
> <meta content="[Lorg.w3c.dom.Node;@d4c191" name="keywords" />
> 
> [Lorg.w3c.dom.Node;@d4c191 seems to be my object, so I tried to
> getValueNode() on this but it gets worse 
> i get:
> <meta content="" name="keywords" />
> 
> the same happens with XPath calls
> I don't really understand
> 
> all thoughts are greatly appreciated
> Thanks
> Tibor
> 
> 


Re: JXTemplate jx:set variable problem ??

Posted by oceatoon <t....@systheo.com>.
Hi Leszek
> I had the same behaviour once. I do not think that is a bug - rather a
> design choice.
Are you sure coz this doesn't seem very clean to be left this way as a
design decision don't you think?




Re: JXTemplate jx:set variable problem ??

Posted by Leszek Gawron <lg...@mobilebox.pl>.
oceatoon wrote:
> Hi everyone 
> I have an odd behavior or I just can't see what I'm doing wrong, maybe
> someone will have an inlightened eye tot is:
> 
> *******************************
> if I do this in my html.jx file:
> <jx:set var="keywords"><meta name="keywords" content="klgjgjkh"/></jx:set>
> ${keywords}
> 
> This works fine. the result is correctly : 
> <meta name="keywords" content="klgjgjkh"/>
> ********************************
> 
> but now I need to do this:
> <jx:set var="keywords">fssgffdgfdg sdfqfqs qfsdqq</jx:set>
> <meta name="keywords" content="${keywords}"/>
> 
> 
> and I get :
> <meta content="[Lorg.w3c.dom.Node;@d4c191" name="keywords" />
> 
> [Lorg.w3c.dom.Node;@d4c191 seems to be my object, so I tried to
> getValueNode() on this but it gets worse 
> i get:
> <meta content="" name="keywords" />
> 
> the same happens with XPath calls
> I don't really understand
I had the same behaviour once. I do not think that is a bug - rather a 
design choice.

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
Project Manager                                    MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65