You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Tapan Nanawati <ta...@yahoo.com> on 2001/02/20 06:25:56 UTC

Data input with a FORM via XSL and search on the basis of that...

Dear friends
We have been working around for quite some time now in finding out how to
take the form input from XSL stylesheets  and send it to XSP logic.
<xsl:value-of> is used to get value from the XML document but how to do the
reverse : how to get an input from the user and base the search query on the
basis of that!
Say for example : the xsp returns five (random) search results and I need to
run an input form for
five times in xsl. how do I do this. Please help.
does xsl have a logic like "count"?

Tapan Nanawati
Globe Communication
NIL/26, Malviya Nagar
New Delhi - INDIA
email -
tapan_nanawati@yahoo.com (official)
tapan.nanawati@lycos.com (friends)
phone -
91-11-6685274 (o)
91-98112-98982 (mobile)
------------------------------
God is real, unless declared integer.


Re: Data input with a FORM via XSL and search on the basis of that...

Posted by "Piroumian, Konstantin" <KP...@flagship.ru>.
Hi!

> Say for example : the xsp returns five (random) search results and I need
to
> run an input form for
> five times in xsl. how do I do this. Please help.
> does xsl have a logic like "count"?

I think, that the XPath count(nodeset) won't help you. It can only give you
an integer value, but you cannot iterate using that function thru the nodes.

The do something N times in XSL you have to use named templates with params
and recusrion call.
You can search archives for an example. Similar thing had been discussed
here.

Regards,
    Konstantin Piroumian.

>
> Tapan Nanawati
> Globe Communication
> NIL/26, Malviya Nagar
> New Delhi - INDIA
> email -
> tapan_nanawati@yahoo.com (official)
> tapan.nanawati@lycos.com (friends)
> phone -
> 91-11-6685274 (o)
> 91-98112-98982 (mobile)
> ------------------------------
> God is real, unless declared integer.
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>

Re: Data input with a FORM via XSL and search on the basis of that...

Posted by Matthew Cordes <mc...@maine.edu>.
Is your question just about html forms?  
If so, here is an example:

XSL:
<form action="my_xsp_page.xml">

	<input type="text" name="value"/>
	<input type="submit"/>
</form>

Cocoon XML:
<request:get-parameter name="value" default="some_sane_default"/>

Feel free to ask more, possibly being more specific if this is 
not what you meant.

-matt


On Tue, Feb 20, 2001 at 10:55:56AM +0530, Tapan Nanawati wrote:
> Dear friends
> We have been working around for quite some time now in finding out how to
> take the form input from XSL stylesheets  and send it to XSP logic.
> <xsl:value-of> is used to get value from the XML document but how to do the
> reverse : how to get an input from the user and base the search query on the
> basis of that!
> Say for example : the xsp returns five (random) search results and I need to
> run an input form for
> five times in xsl. how do I do this. Please help.
> does xsl have a logic like "count"?
> 
> Tapan Nanawati
> Globe Communication
> NIL/26, Malviya Nagar
> New Delhi - INDIA
> email -
> tapan_nanawati@yahoo.com (official)
> tapan.nanawati@lycos.com (friends)
> phone -
> 91-11-6685274 (o)
> 91-98112-98982 (mobile)
> ------------------------------
> God is real, unless declared integer.
> 
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
> 

Re: Data input with a FORM via XSL and search on the basis of that...

Posted by Donald Ball <ba...@webslingerZ.com>.
On Tue, 20 Feb 2001, Tapan Nanawati wrote:

> Dear friends
> We have been working around for quite some time now in finding out how to
> take the form input from XSL stylesheets  and send it to XSP logic.
> <xsl:value-of> is used to get value from the XML document but how to do the
> reverse : how to get an input from the user and base the search query on the
> basis of that!

you're asking to be able to write this:

<param>foo</param>

or

<param><request:get-parameter name="foo"/></param>

? then read up on xsp logicsheets, check out the examples. you'll probably
want to use the get-nested-string template from esql.xsl among others.

> Say for example : the xsp returns five (random) search results and I need to
> run an input form for
> five times in xsl. how do I do this. Please help.

this doesn't make any sense to me.

> does xsl have a logic like "count"?

yes, looks like you need to read up on xslt and xpath.

- donald