You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by gogliostro <jo...@aql.fr> on 2007/09/03 17:58:27 UTC

[Cocoon2.2] Problem by using the use-request-parameters

Hi everyone,

I'm using Cocoon 2.2 and I try to access my http request parameters in my
xslt stylesheet.

The request  :
   http://localhost:8888/myapp/testImport?provider=provider1

The sitemap :

    <map:match pattern="testImport">
        <map:generate src="myFile.xml" />
        <map:transform type="xslt" src="transform/test.xslt">
            <map:parameter name="use-request-parameters" value="true" />
        </map:transform>
        <map:serialize type="xml"/>
    </map:match>

The stylesheet :

   <?xml version="1.0" encoding="UTF-8"?>
   <xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"  
xmlns:fn="http://www.w3.org/2005/xpath-functions">
       <xsl:template match="/">
       <providerName>
           <xsl:value-of select="$provider" />
       </providerName>
       </xsl:template>
   </xsl:stylesheet>

When I execute the pipeline I got a pretty 
javax.xml.transform.TransformerException: Impossible de trouver la variable
portant le nom provider.
It's in french (because I'm ;-)) and it can be translated with: "Cannot find
the variable named provider"

Has anyone some clues?

Thank You

Joël Defante
-- 
View this message in context: http://www.nabble.com/-Cocoon2.2--Problem-by-using-the-use-request-parameters-tf4372904.html#a12464000
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


RE: [Cocoon2.2] Problem by using the use-request-parameters

Posted by gogliostro <jo...@aql.fr>.
Thanks a lot for your answer.
Little tip for those who encountered the same problem, the <xsl:param ...>
element must be written just under the <xsl:stylesheet...> tag, like this:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions">

	<xsl:param name="provider" />

	<xsl:template match="/">
		<yeap>
			<xsl:value-of select="$provider" />
		</yeap>
	</xsl:template>
</xsl:stylesheet>

and not like that :

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions">
	<xsl:template match="/">

                <xsl:param name="provider" />

		<yeap>
			<xsl:value-of select="$provider" />
		</yeap>
	</xsl:template>
</xsl:stylesheet>

Joël


Jasha Joachimsthal wrote:
> 
> 
> Shouldn't you define an <xsl:param name="provider"/> in the XSL?
> Btw if you only need that request parameter the use-request-parameters is
> a very bad practice for caching. Use <map:parameter name="provider"
> value="{request-param:provider}/> in your sitemap.
> 
> Jasha
> 
> -----Original Message-----
> From:	gogliostro [mailto:joel.defante@aql.fr]
> Sent:	Mon 9/3/2007 5:58 PM
> To:	users@cocoon.apache.org
> Cc:	
> Subject:	[Cocoon2.2] Problem by using the use-request-parameters
> 
> 
> Hi everyone,
> 
> I'm using Cocoon 2.2 and I try to access my http request parameters in my
> xslt stylesheet.
> 
> The request  :
>    http://localhost:8888/myapp/testImport?provider=provider1
> 
> The sitemap :
> 
>     <map:match pattern="testImport">
>         <map:generate src="myFile.xml" />
>         <map:transform type="xslt" src="transform/test.xslt">
>             <map:parameter name="use-request-parameters" value="true" />
>         </map:transform>
>         <map:serialize type="xml"/>
>     </map:match>
> 
> The stylesheet :
> 
>    <?xml version="1.0" encoding="UTF-8"?>
>    <xsl:stylesheet version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"  
> xmlns:fn="http://www.w3.org/2005/xpath-functions">
>        <xsl:template match="/">
>        <providerName>
>            <xsl:value-of select="$provider" />
>        </providerName>
>        </xsl:template>
>    </xsl:stylesheet>
> 
> When I execute the pipeline I got a pretty 
> javax.xml.transform.TransformerException: Impossible de trouver la
> variable
> portant le nom provider.
> It's in french (because I'm ;-)) and it can be translated with: "Cannot
> find
> the variable named provider"
> 
> Has anyone some clues?
> 
> Thank You
> 
> Joël Defante
> -- 
> View this message in context:
> http://www.nabble.com/-Cocoon2.2--Problem-by-using-the-use-request-parameters-tf4372904.html#a12464000
> Sent from the Cocoon - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 
> 
> 
>  
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

-- 
View this message in context: http://www.nabble.com/-Cocoon2.2--Problem-by-using-the-use-request-parameters-tf4372904.html#a12474686
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


RE: [Cocoon2.2] Problem by using the use-request-parameters

Posted by Jasha Joachimsthal <j....@hippo.nl>.
Shouldn't you define an <xsl:param name="provider"/> in the XSL?
Btw if you only need that request parameter the use-request-parameters is a very bad practice for caching. Use <map:parameter name="provider" value="{request-param:provider}/> in your sitemap.

Jasha

-----Original Message-----
From:	gogliostro [mailto:joel.defante@aql.fr]
Sent:	Mon 9/3/2007 5:58 PM
To:	users@cocoon.apache.org
Cc:	
Subject:	[Cocoon2.2] Problem by using the use-request-parameters


Hi everyone,

I'm using Cocoon 2.2 and I try to access my http request parameters in my
xslt stylesheet.

The request  :
   http://localhost:8888/myapp/testImport?provider=provider1

The sitemap :

    <map:match pattern="testImport">
        <map:generate src="myFile.xml" />
        <map:transform type="xslt" src="transform/test.xslt">
            <map:parameter name="use-request-parameters" value="true" />
        </map:transform>
        <map:serialize type="xml"/>
    </map:match>

The stylesheet :

   <?xml version="1.0" encoding="UTF-8"?>
   <xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"  
xmlns:fn="http://www.w3.org/2005/xpath-functions">
       <xsl:template match="/">
       <providerName>
           <xsl:value-of select="$provider" />
       </providerName>
       </xsl:template>
   </xsl:stylesheet>

When I execute the pipeline I got a pretty 
javax.xml.transform.TransformerException: Impossible de trouver la variable
portant le nom provider.
It's in french (because I'm ;-)) and it can be translated with: "Cannot find
the variable named provider"

Has anyone some clues?

Thank You

Joël Defante
-- 
View this message in context: http://www.nabble.com/-Cocoon2.2--Problem-by-using-the-use-request-parameters-tf4372904.html#a12464000
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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