You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Luca Morandini <l....@tin.it> on 2001/10/18 22:20:35 UTC
Request Generator examples
Folks,
has any of you been able to use Request Generator ?
I tried hard to extract parameters (say, the host name) from a request
generator's result via XSL... to no avail: has anyone had more luck (or
expertise) ?
Best regards,
---------------------------------------------
Luca Morandini
GIS Consultant
lmorandini@ieee.org
+39 0744 598 51 Office
+39 335 681 02 12 Mobile
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------
---------------------------------------------------------------------
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: Request Generator examples
Posted by Luca Morandini <l....@tin.it>.
Lajos,
thanks for you reply.
Actually, my error was not putting the namespace tag "request:" in front of
my XPatch elements. Since I've put it into the stylesheet header I, wrongly,
supposed it ot be redundant.
Hence, I've transformed:
<xsl:template name="get-request-parameter">
<xsl:param name="name"/>
<xsl:value-of
select="/page/all-parameters/request/requestParameters/parameter[@name=$name
]/value"/>
</xsl:template>
which didn't work, to:
<xsl:template name="get-request-parameter">
<xsl:param name="name"/>
<xsl:value-of
select="/page/all-parameters/request:request/request:requestParameters/reque
st:parameter[@name=$name]/request:value"/>
</xsl:template>
which works :)
Thanks again,
---------------------------------------------
Luca Morandini
GIS Consultant
lmorandini@ieee.org
+39 0744 598 51 Office
+39 335 681 02 12 Mobile
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------
> -----Original Message-----
> From: Lajos Moczar [mailto:lmocz@galatea.com]
> Sent: Friday, October 19, 2001 3:37 PM
> To: cocoon-users@xml.apache.org
> Subject: Re: Request Generator examples
>
>
> Hi Luca:
>
> I did something like this in my sitemap:
>
> <map:match pattern="request">
> <map:generate type="request"/>
> <map:transform src="stylesheets/request.xsl"/>
> <map:serialize/>
> </map:match>
>
>
> My request.xsl looks like this:
>
> <?xml version="1.0"?>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:request="http://xml.apache.org/cocoon/requestgenerator/2.0">
>
> <xsl:template match="/">
> <html>
> <head>
> <title>Request Test</title>
> </head>
> <body bgcolor="#ffffff">
> <h1>Request Test</h1>
> <xsl:apply-templates/>
> </body>
> </html>
> </xsl:template>
>
> <xsl:template match="request:requestHeaders">
> <h3>Request Headers</h3>
> <ul>
> <xsl:apply-templates/>
> </ul>
> <br/>
> </xsl:template>
>
> <xsl:template match="request:requestParameters">
> <h3>Request Parameters</h3>
> <ul>
> <xsl:apply-templates/>
> </ul>
> <br/>
> </xsl:template>
>
> <xsl:template match="request:configurationParameters">
> <h3>Configuration Parameters</h3>
> <ul>
> <xsl:apply-templates/>
> </ul>
> <br/>
> </xsl:template>
>
> <xsl:template match="request:header">
> <li><xsl:value-of select="@name"/> = <xsl:apply-templates/></li>
> </xsl:template>
>
> <xsl:template match="request:parameter">
> <li><xsl:value-of select="@name"/> = <xsl:apply-templates/></li>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
>
> Hope it helps.
>
> Lajos
> galatea.com
>
> Luca Morandini wrote:
>
> > Folks,
> >
> > has any of you been able to use Request Generator ?
> >
> > I tried hard to extract parameters (say, the host name)
> from a request
> > generator's result via XSL... to no avail: has anyone had more luck (or
> > expertise) ?
> >
> >
> > Best regards,
> >
> > ---------------------------------------------
> > Luca Morandini
> > GIS Consultant
> > lmorandini@ieee.org
> > +39 0744 598 51 Office
> > +39 335 681 02 12 Mobile
> > http://utenti.tripod.it/lmorandini/index.html
> > ---------------------------------------------
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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>
>
---------------------------------------------------------------------
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: Deploying xml pages/resources
Posted by Lajos Moczar <lm...@galatea.com>.
Hi Allan:
I'm not sure what you are trying to do. If it is simply to process XML
files using your old XSLs, look at the examples in the cocoon
sitemap.xmap (like the hello.html one). All you have to do is add a
similar entry for your own stuff. Then put your files under the cocoon
webapp (according to the locations you specified in the sitemap entry)
and start testing. If you want to use Cocoon2 in another web
application, you'd essentially have to replicate the bulk of what's in
your cocoon web app. I'm putting an entry in my Cocoon2 Tips & Tricks
Flashguide (http://www.galatea.com/flashguides/cocoon-tips-2.xml)
describing how I've done this. Check back early next week if you are
interested.
If I've missed the intent of your question, let me know.
Lajos
galatea.com
Allan Kamau wrote:
> I've installed C2 successfully now I'd like to know
> how I can be able to have cocoon serve my xml pages.
>
> In C1.x we could instruct TC3 to forward all .xml (and
> so on) to cocoon.jar. How is it done in C2, does it
> involve use of site map?
> Perhaps Lajos Moczar you could help..
>
> Thank you.
> Allan.
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.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>
Deploying xml pages/resources
Posted by Allan Kamau <hu...@yahoo.com>.
I've installed C2 successfully now I'd like to know
how I can be able to have cocoon serve my xml pages.
In C1.x we could instruct TC3 to forward all .xml (and
so on) to cocoon.jar. How is it done in C2, does it
involve use of site map?
Perhaps Lajos Moczar you could help..
Thank you.
Allan.
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.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: Request Generator examples
Posted by Lajos Moczar <lm...@galatea.com>.
Hi Luca:
I did something like this in my sitemap:
<map:match pattern="request">
<map:generate type="request"/>
<map:transform src="stylesheets/request.xsl"/>
<map:serialize/>
</map:match>
My request.xsl looks like this:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:request="http://xml.apache.org/cocoon/requestgenerator/2.0">
<xsl:template match="/">
<html>
<head>
<title>Request Test</title>
</head>
<body bgcolor="#ffffff">
<h1>Request Test</h1>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="request:requestHeaders">
<h3>Request Headers</h3>
<ul>
<xsl:apply-templates/>
</ul>
<br/>
</xsl:template>
<xsl:template match="request:requestParameters">
<h3>Request Parameters</h3>
<ul>
<xsl:apply-templates/>
</ul>
<br/>
</xsl:template>
<xsl:template match="request:configurationParameters">
<h3>Configuration Parameters</h3>
<ul>
<xsl:apply-templates/>
</ul>
<br/>
</xsl:template>
<xsl:template match="request:header">
<li><xsl:value-of select="@name"/> = <xsl:apply-templates/></li>
</xsl:template>
<xsl:template match="request:parameter">
<li><xsl:value-of select="@name"/> = <xsl:apply-templates/></li>
</xsl:template>
</xsl:stylesheet>
Hope it helps.
Lajos
galatea.com
Luca Morandini wrote:
> Folks,
>
> has any of you been able to use Request Generator ?
>
> I tried hard to extract parameters (say, the host name) from a request
> generator's result via XSL... to no avail: has anyone had more luck (or
> expertise) ?
>
>
> Best regards,
>
> ---------------------------------------------
> Luca Morandini
> GIS Consultant
> lmorandini@ieee.org
> +39 0744 598 51 Office
> +39 335 681 02 12 Mobile
> http://utenti.tripod.it/lmorandini/index.html
> ---------------------------------------------
>
>
>
> ---------------------------------------------------------------------
> 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>