Hi!

I am trying to use <xsp-request:get-parameter name="..."/> as a
parameter to a template defined in my own logicsheet.

I have looked at the mailing list archives, the documentation and
actually found info on how it is supposed ot be done, but it seems
that the above parameter does not get passed on. I must be missing
something. Please help, cause I'm getting desperate.

In the code bellow, the custom <mobi:fmd-request> tag correctly writes
out the second DEBUG: line, but in the first DEBUG: line, the
variable $dowhat seems to be empty. If instead of supplying
a dynamic parameter to mobi:fmd-request, I supply an attribute
'dowhat', the code works as expected. If I supply a literal
string instead of <xsp-request:get-parameter name="dothething"/>,
the string does get passed on to the template as expected.

I am using Cocoon 2.0.4, with tomcat 4.1.18 and Java 1.4 from Sun.

feri.

------------------------------------------------------

I tried the following in my XSP:

<mobi:fmd-request>
   <mobi:param name="dowhat"><xsp-request:get-parameter
               name="dothething"/></mobi:param>
</mobi:fmd-request>

And in the logischeet:

<xsl:template match="mobi:fmd-request">
  <xsl:variable name="dowhat">
    <xsl:call-template name="get-parameter">
     <xsl:with-param name="name">dowhat</xsl:with-param>
    </xsl:call-template>
  </xsl:variable>

<xsl:text>DEBUG: dowhat: </xsl:text><xsl:value-of select="$dowhat"/><br/>
<xsl:text>DEBUG: dowhat: </xsl:text><xsp-request:get-parameter name="dothething"/><br/>


...........................

</xsl:template>


<xsl:template name="get-parameter"> <xsl:param name="name"/> <xsl:param name="default"/> <xsl:param name="required">false</xsl:param>

<xsl:variable name="qname">
  <xsl:value-of select="concat('mobi', ':param')"/>
</xsl:variable>

<xsl:choose>
  <xsl:when test="@*[name(.) = $name]">
    <xsl:value-of select="@*[name(.) = $name]"/>
  </xsl:when>
  <xsl:when test="(*[name(.) = $qname])[EMAIL PROTECTED] = $name]">
    <xsl:call-template name="get-nested-content">
      <xsl:with-param name="content"
        select="(*[name(.) = $qname])[EMAIL PROTECTED] = $name]"/>
    </xsl:call-template>
  </xsl:when>
  <xsl:otherwise>... handle default and error ...</xsl:otherwise>
</xsl:choose>
</xsl:template>


<xsl:template name="get-nested-content"> <xsl:param name="content"/> <xsl:choose> <xsl:when test="$content/*"> <xsl:apply-templates select="$content/*"/> </xsl:when> <xsl:otherwise>"<xsl:value-of select="$content"/>"</xsl:otherwise> </xsl:choose> </xsl:template>


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to