You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Cenk Uysal <ce...@yahoo.com> on 2002/05/08 10:24:05 UTC

Parameter passing with Cocoon

Hi,

In today's general methods we write the parameters for a web page
after the address of it like:
http://www.foo.com/foo.php?x=xyz

Because of this, people that are responsible for content providing
must be able to know all the necessary parameter passings when he/she
creates a link to a page. But I want to seperate jobs of these two
groups. I try to improve a method where content provider doesn't need
to worry about parameters. 

What is the solution of Cocoon for this problem? Sitemap parameters?
Or something else?

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

---------------------------------------------------------------------
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: Parameter passing with Cocoon

Posted by Alex McLintock <al...@OWAL.co.uk>.
At 13:33 14/05/2002, you wrote:
>Change that to http://www.foo.com/x/y/z/index.html and you can use a 
>pipeline matcher like this:
>
><map:match pattern="/*/*/*/*.html">
>   <map:generate src="/docs/{4}.xml"/>
>   <map:transform src="/styles/yourtransfomer.xsl">
>     <map:parameter name="x" value="{1}"/>
>     <map:parameter name="y" value="{2}"/>
>     <map:parameter name="z" value="{3}"/>
>   </map:transform>
>   <map:serialize/>
></map:match>


I try to do this already but since I am generating the hyperlinks from 
other Cocoon pages generated through XSLT I am having trouble with 
parameters which have funny characters in them. (spaces, slashes, plus 
sign, etc). I assume I need to do URL encoding of the parameter before 
putting it into the URL, but I can't see how to do this with XSLT. Can 
anyone point me to an explanation?

Thanks

Alex





Openweb Analysts Ltd, London: Software For Complex Websites 
http://www.OWAL.co.uk/
Free Consultancy for London Companies thinking of Open Source Software.


---------------------------------------------------------------------
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: Parameter passing with Cocoon

Posted by Bert Van Kets <be...@vankets.com>.
Change that to http://www.foo.com/x/y/z/index.html and you can use a 
pipeline matcher like this:

<map:match pattern="/*/*/*/*.html">
   <map:generate src="/docs/{4}.xml"/>
   <map:transform src="/styles/yourtransfomer.xsl">
     <map:parameter name="x" value="{1}"/>
     <map:parameter name="y" value="{2}"/>
     <map:parameter name="z" value="{3}"/>
   </map:transform>
   <map:serialize/>
</map:match>

This will call the index.xml file and send the x, y and z parameters to the 
stylesheet.

If you define the x, y and z parameters in your stylesheet, you can simply 
call them the regular xslt way.

HTH,
Bert

At 03:17 14/05/2002 -0700, you wrote:
>Your second method
>
>http://www.foo.com/index-xyz.html
>
>still forces the designer to know parameters when he/she creates a
>link. But I think first method is useful.
>
>http://www.foo.com/xyz/index.html
>
>May you give me a tip about how to parse these parameters to use in
>XSL stylesheets? Can Cocoon do this for me or do I have to write
>codes for parsing parameters in my XSL?
>
>__________________________________________________
>Do You Yahoo!?
>LAUNCH - Your Yahoo! Music Experience
>http://launch.yahoo.com
>
>---------------------------------------------------------------------
>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>


---------------------------------------------------------------------
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: Parameter passing with Cocoon

Posted by Cenk Uysal <ce...@yahoo.com>.
Your second method 

http://www.foo.com/index-xyz.html

still forces the designer to know parameters when he/she creates a
link. But I think first method is useful. 

http://www.foo.com/xyz/index.html

May you give me a tip about how to parse these parameters to use in
XSL stylesheets? Can Cocoon do this for me or do I have to write
codes for parsing parameters in my XSL?

__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

---------------------------------------------------------------------
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: Parameter passing with Cocoon

Posted by Bert Van Kets <be...@vankets.com>.
I use http://www.foo.com/xyz/foo.html and http://www.foo.com/foo-xyz.html
It's *very* easy to get that parameter using cocoon matchers.  Passing them 
to transformers and generators is documented or can be found in the mail 
archives.
Bert

At 01:24 8/05/2002 -0700, you wrote:
>Hi,
>
>In today's general methods we write the parameters for a web page
>after the address of it like:
>http://www.foo.com/foo.php?x=xyz
>
>Because of this, people that are responsible for content providing
>must be able to know all the necessary parameter passings when he/she
>creates a link to a page. But I want to seperate jobs of these two
>groups. I try to improve a method where content provider doesn't need
>to worry about parameters.
>
>What is the solution of Cocoon for this problem? Sitemap parameters?
>Or something else?
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Health - your guide to health and wellness
>http://health.yahoo.com
>
>---------------------------------------------------------------------
>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>


---------------------------------------------------------------------
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>