cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Bounds" <richard.bou...@riskgovernance.com>
Subject Passing parameters to a logicsheet using xsp:param
Date Fri, 03 Jan 2003 11:59:08 GMT
I'm trying to write a logicsheet that accepts dynamic parameters from the
XSP page (e.g. maybe request parameters, or session attributes), and uses
them to request data from our application. I'd like the xsp code to look
something like this:



	<xsp:logic>
   		String sortParameter = request.getParameter("sort");
	</xsp:logic>

	<data>
	   <parameters:categories>
	   		<xsp:param name="sortBy">
				<xsp:expr>sortParameter</xsp:expr>								</xsp:param>
	   </parameters:categories>
   	</data>



What do I need to put in my logicsheet code to pick up the "sortParameter"
value? At the moment I've got the following:



<xsl:template match="parameters:categories">

  <xsl:variable name="sortBy">
  <xsl:choose>
      <xsl:when test="sortBy">
        <xsl:call-template name="get-nested-content">
          <xsl:with-param name="content" select="parameters:sortBy"/>
        </xsl:call-template>
      </xsl:when>
    </xsl:choose>
  </xsl:variable>

	<xsp:logic>
		   System.out.println("Got value: " + "<xsl:copy-of select="$sortBy" />");
	</xsp:logic>

</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>



Sorry if this is a stupid question, but I've been unable to find any
documentation that  describes this. I'd be very grateful for any help!

Richard


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message