You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Vaduvoiu Tiberiu <va...@yahoo.com> on 2007/06/23 11:30:52 UTC

default value in dasl

I am trying to use dasl search in my site. I'm still trying to understand dasl by experimenting various things. I want to know if I can set a default value in dasl. what i am trying to do is:
in my dasl i have:
        <d:limit>
          <d:nresults>${cocoon.parameters.results}</d:nresults>
        </d:limit>

this way, I can limit the nr of result using a request parameter. so now when I write 
www.mysite.com?results=5, I have 5 results on the page. what I want (and don;t know how to achieve) is to tell dasl to ignore the condition if the parameter does not exists..so if I only have www.mysite.com, then it will display all results, if the parameter however is defined (?results=5) then it would display that number of results. I don;t know exactly how to do it. is there a way to put if conditions in dasl? 

P.S. for those that have experience in dasl. is there any documentation on dasl on the internet? I've searched a bunch on google and didn;t find much. 10x in advance





       
____________________________________________________________________________________
Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
http://new.toolbar.yahoo.com/toolbar/features/mail/index.php

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: default value in dasl

Posted by Jasha Joachimsthal <j....@hippo.nl>.
Vaduvoiu,

that depends on how you generate the query. I guess you're using jx, so you could do something like (did it by heart, could be an error in it):

<d:nresults>
<jx:choose>
<jx:when test="${cocoon.parameters.results.length &gt; 0}">${cocoon.parameters.results}</jx:when>
<jx:otherwise>5</jx:otherwise>
</jx:choose>
</d:nresults>

An other approach is to generate an empty file and create the query in XSL. There you can use xsl:choose etc...

Regards,

Jasha

-----Original Message-----
From:	Vaduvoiu Tiberiu [mailto:vaduvoiutibi@yahoo.com]
Sent:	Sat 6/23/2007 11:30 AM
To:	users@cocoon.apache.org
Cc:	
Subject:	default value in dasl

I am trying to use dasl search in my site. I'm still trying to understand dasl by experimenting various things. I want to know if I can set a default value in dasl. what i am trying to do is:
in my dasl i have:
        <d:limit>
          <d:nresults>${cocoon.parameters.results}</d:nresults>
        </d:limit>

this way, I can limit the nr of result using a request parameter. so now when I write 
www.mysite.com?results=5, I have 5 results on the page. what I want (and don;t know how to achieve) is to tell dasl to ignore the condition if the parameter does not exists..so if I only have www.mysite.com, then it will display all results, if the parameter however is defined (?results=5) then it would display that number of results. I don;t know exactly how to do it. is there a way to put if conditions in dasl? 

P.S. for those that have experience in dasl. is there any documentation on dasl on the internet? I've searched a bunch on google and didn;t find much. 10x in advance





       
____________________________________________________________________________________
Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
http://new.toolbar.yahoo.com/toolbar/features/mail/index.php

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org