cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Van den Branden <ron.vandenbran...@kantl.be>
Subject aggregating duplicate parameters at sitemap level
Date Thu, 08 Feb 2007 14:01:12 GMT
Hi,

In my application, I have some HTML forms containing lists of checkbox 
inputs and multiple select boxes. This results in request URIs featuring 
duplicate parameter names:

e.g.: 
http://localhost:8888/myapp/processform.htm?par1=val1&par1=val2&par1=val3

If I pass these to my XSLT transformation using <map:parameter 
name="use-request-parameters" value="true"/>, only the first value (viz. 
"val1") ends up in my XSLT. This is a short sitemap.xmap snippet:

    <map:match pattern="processform.htm">
      <map:generate src="xml/{1}.xml"/>
      <map:transform src="stylesheets/xml2htm/{1}.xsl">
        <map:parameter name="use-request-parameters" value="true"/>
      </map:transform>
      <map:serialize type="xhtml"/>
    </map:match>

So far, I worked around this with client-side Javascript that would 
aggregate those values for the duplicate parameters into one string, so 
that only 1 "par1" parameter is passed through:

e.g.: http://localhost:8888/myapp/processform.htm?par1=val1%20val2%20val3

In revising my app (and bringing it closer to unobtrusive JS practice), 
however, I would like to free that vital part of its fuctionality (form 
submission) from this client-side Javascript dependency.

My question is: is there a way of aggregating duplicate parameters into 
one parameter at sitemap level? The scarce posts I came across on this 
list suggest that it *can* be done (e.g. 
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=113474098814411&w=2), 
but not exactly how... At least, I can't see a solution with my current 
cocoon knowledge (not much beyond simple pipeline concepts, ie. no 
flowscript, actions, XSP...).

I recognize this is not strictly a Cocoon problem (and apologize for 
off-topicality), but hope there may be a Cocoon solution?

Thanks for any reaction!

Ron Van den Branden


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


Mime
View raw message