You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Matthias Brunner <mb...@gmx.net> on 2003/03/08 14:23:25 UTC

XSL parameters

Hello,

how do I set XSL parameters in the sitemap?
This does not seem to be possible:

<map:transform src="my.xsl" type="xslt">
	<map:parameter name="noImgTags" value="true()"/>
</map:transform>

I do not want to activate "use-request-parameters" since the user 
should not be able to set parameters himself.


Best regards,
Matthias Brunner

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


Re: XSL parameters

Posted by Joerg Heinicke <jo...@gmx.de>.
Hello Matthias,

at 
http://xml.apache.org/cocoon/userdocs/transformers/xslt-transformer.html 
you can read, that your code is correct. i only don't know what happens 
when sending a boolean value. I think it's interpreted as normal text.

Furthermore in the stylesheet you need a global <xsl:param 
name="noImgTags" select="'defaultvalue'"/>. To see whether it works or 
not, you can add a <xsl:value-of select="$noImgTags"/> into one template.

The use-request-parameters is more bad because of caching instead of 
request parameters from the user, because a <xsl:param/> is always 
needed. But you're correct, of course it should be avoided where possible.

Regards,

Joerg

Matthias Brunner wrote:
> Hello,
> 
> how do I set XSL parameters in the sitemap?
> This does not seem to be possible:
> 
> <map:transform src="my.xsl" type="xslt">
> 	<map:parameter name="noImgTags" value="true()"/>
> </map:transform>
> 
> I do not want to activate "use-request-parameters" since the user 
> should not be able to set parameters himself.
> 
> 
> Best regards,
> Matthias Brunner


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


RE: XSL parameters

Posted by Conal Tuohy <co...@paradise.net.nz>.
> -----Original Message-----
> From: Matthias Brunner [mailto:mb03a@gmx.net]
> Sent: Sunday, 9 March 2003 02:23

> how do I set XSL parameters in the sitemap?
> This does not seem to be possible:
>
> <map:transform src="my.xsl" type="xslt">
> 	<map:parameter name="noImgTags" value="true()"/>
> </map:transform>

That should work. You will need to have the parameter declared in your xslt
as well, as a child of the style-sheet element:

<xsl:param name="noImgTags" select="false()"/>

What is the result? Do you get an error message? Or does $noImgTags =
false()?

BTW, though this isn't your problem, I would guess the parameter is passed
to your xslt as a string, which means that ANY non-null value would evaluate
as true() in your xslt:

http://www.w3.org/TR/xpath#function-boolean
In other words, in xpath, even 'false()'=true()

:-)

Cheers

Con


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