You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Michael Bierenfeld <mi...@atmiralis.de> on 2000/06/06 10:44:32 UTC

Re: TagLib to set a variable?

Jeremy Quinn wrote:
> 
> Hi,
> 
> I am trying to set an XSL Variable to the value of a TagLib, it is not
> working, can anyone help me sort out why?
> 
>         <xsl:variable name="query"><request:get-query-string/></xsl:variable>
> 
>         always returns empty, regardless of the query string
> 
> Simplified example .....
> 
> <?xml version="1.0"?>
> <xsl:stylesheet  version="1.0"
>  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>  xmlns:request="http://www.apache.org/1999/XSP/Request"
>  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >
> 
>  <xsl:template match="slides">
>   <xsl:processing-instruction
> name="cocoon-process">type="xsp"</xsl:processing-instruction>
>   <xsl:processing-instruction
> name="cocoon-format">type="text/xml"</xsl:processing-instruction>
> 
>   <xsp:page
>    language="java"
>    xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>    xmlns:request="http://www.apache.org/1999/XSP/Request"
>   >
>    <slides>
>     <xsl:variable name="query"><request:get-query-string/></xsl:variable>
>     <xsl:variable name="next">
>      <xsl:choose>
>       <xsl:when
> test="$query=''"><xsl:text>slides-smil.xsl</xsl:text></xsl:when>
>       <xsl:otherwise><xsl:text>slides-qtmov.xsl</xsl:text></xsl:otherwise>
>      </xsl:choose>
>     </xsl:variable>
> 
>     <xsp:pi target="xml-stylesheet">href="<xsl:value-of select="$next"/>"
> type="text/xsl"</xsp:pi>
>     <section><xsl:value-of select="$query"/></section>
>     <xsl:apply-templates/>
>    </slides>
>   </xsp:page>
>  </xsl:template>
> 
> </xsl:stylesheet>
> 
> thanks for any help
> 
> regards Jeremy
> --
>    ___________________________________________________________________
> 
>    Jeremy Quinn                                           Karma Divers
>                                                        webSpace Design
>                                             HyperMedia Research Centre
> 
>    <ma...@mac.com>                    <http://www.media.demon.co.uk>
>     <phone:+44.[0].20.7737.6831>        <pa...@sms.genie.co.uk>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


I have made the experience, that it is impossible
to set <xsl:variables> with JAVA-Content. It is
imho somewhat related to the base concept of xsp.
XSL:parameter and xsl:variable tags are somewhat
static. If you would use :

	<xsl:variable
name="useMe"><xsp:expr>request.getParameter
("Hello")</xsp:expr>
	</xsl:variable>

your content of useMe would be
"request.getParameter ("Hello") as a String. I
haven't looked into detail whats the reason for
it. But I think this is related to xml-content,
xsp compilation issues.

Regards

Michael

Re: TagLib to set a variable?

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 10:44 +0200 06/06/00, Michael Bierenfeld wrote:

Micheal,

Thanks for your reply.

>Jeremy Quinn wrote:
>>
>> Hi,
>>
>> I am trying to set an XSL Variable to the value of a TagLib, it is not
>> working, can anyone help me sort out why?
>>
>>   <xsl:variable name="query"><request:get-query-string/></xsl:variable>
>>
>>   always returns empty, regardless of the query string

>I have made the experience, that it is impossible
>to set <xsl:variables> with JAVA-Content. It is
>imho somewhat related to the base concept of xsp.
>XSL:parameter and xsl:variable tags are somewhat
>static. If you would use :

Bad news.

Richardo, could we get confirmation of this?

In an XSL which is also an XSP the following works:

	<qs><request:get-query-string/></qs>

but this does not:

	<xsl:variable name="qs"><request:get-query-string/></xsl:variable>

Should it work?
Could it work?

Thanks

Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <ma...@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pa...@sms.genie.co.uk>