cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Stimmel <jon-li...@stimmel.net>
Subject Re: Dynamic arguments to a Logicsheet?
Date Wed, 05 Jul 2000 22:41:04 GMT
On Wed, Jul 05, 2000 at 11:58:52AM -0700, Jonathan Stimmel wrote:

> One thing I can't see how to do is to pass dynamic data to a custom
> tag. I can do:
>   <ns:myTag param="value"/>
> but not:
>   <ns:myTag>
>     <xsp:attribute name="param">
>       <request:get-parameter name="param"/>
>     </xsp:attribute>
>   </ns:myTag>

Ok, I've almost got this working, thanks to some documentation in the
cocoon2 source branch. The catch is that you must use child nodes
to pass dynamic data:
  <ns:myTag>
    <ns:param><request:get-parameter name="param"/></ns:param>
  </ns:myTag>
However, I now have the following ugly code in my logicsheet:
  <sql:query>
    <xsl:text>SELECT * FROM Table</xsl:text>
    <xsl:text> WHERE Column=" +</xsl:text>
    <xsl:call-template name="get-nested-string">
      <xsl:with-param name="content" select="dir:category"/>
    </xsl:call-template>
    <xsl:text>+ "</xsl:text>
  </sql:query>
I borrowed get-nested-string from the sql logicsheet. Note the '" +'
and '+ "' I had to add to get the generated code correct. The <xsl:text>
nodes are also rather annoying; without them, I had to place the entire
query on a single line.

Mime
View raw message