You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Chris Newland <ch...@yahoo.co.uk> on 2000/05/18 12:11:39 UTC

Passing XSP parameter inside a tag

Hi,

I'm having trouble accessing a java parameter I've
defined in my xsp:logic section from within a tag in
my xsp page:

<xsp:logic>

String foo="HelloWorld";

</xsp:logic>

<my_template message="{@foo}"/>

The literal {@foo} is used instead of the variable
substitution.

I guess there's a pretty obvious solution to this one
but I haven't been able to find it yet.

As always, any help would be greatly appreciated.

Thanks,

Chris


____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

Re: Passing XSP parameter inside a tag

Posted by Ricardo Rocha <ri...@apache.org>.
On Thu, 18 May 2000, Chris Newland wrote:
> I'm having trouble accessing a java parameter I've
> defined in my xsp:logic section from within a tag in
> my xsp page:
>   <xsp:logic>
>     String foo="HelloWorld";
>   </xsp:logic>
> 
> <my_template message="{@foo}"/>
> 
> The literal {@foo} is used instead of the variable
> substitution.

Try:

    <foo><xsp:expr>
      "Hello world"
    </xsp:expr></foo>

in your XSP page and then:

  <xsl:template match="xyz">
    . . .
    <xsl:value-of select="foo"/>
    . . .
  </xsl:template>

in your stylesheet.

In general, whenever you need to make a Java
expression available to your XSLT stylesheet,
enclose the expression in a tag you can later
reference in the stylesheet.