cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Chang <schav_2...@yahoo.com>
Subject Re: how to pass request param into taglib parameter?
Date Fri, 05 Jan 2001 23:33:47 GMT
Actually, I want to put the VALUE of the variables as
parameters into my taglib request. If I leave out the
<xsp:expr> around my variable names, the actual NAMES
of the variables are passed to my taglib definition,
which is not what i want...I need the value of the
variables to be passed to the taglib definition.

If put the <xsp:expr>value1</xsp:expr> anywhere else
in the code it evaluates correctly; only when i put it
in as parameters to my tablib call does it fail.

Any ideas?

Thanks!


--- Ovidiu Predescu <ovidiu@cup.hp.com> wrote:
> On Fri, 5 Jan 2001 10:25:52 -0800 (PST), Stephen
> Chang <schav_2000@yahoo.com> 
> wrote:
> 
> > hello all,
> > 
> > thanks for all the help so far from everyone. it's
> > been very helpful!
> > 
> > anyways, i am making use of my own tag library in
> an
> > XSP page. This taglib call requires input
> parameters
> > in the form of XML elements like:
> > 
> > <mylib:mytag>
> > <param1><xsp:expr>value1</xsp:expr></param1>
> > <param2><xsp:expr>value2</xsp:expr></param2>
> > </mylib:mytag>
> > 
> > The way i am using it, my "value1" and "value2"
> are
> > varibles read in the beginning in an <xsp:logic/>
> > block like:
> > <xsp:logic>
> > String value1 = request.getParameter("v1");
> > String value2 = request.getParameter("v2");
> > </xsp:logic>
> > 
> > My taglib logicsheet never receives the values of
> > value1 and value2. Instead they have blank values
> so
> > nothing is passed to my taglib logic. I looked at
> the
> > generated file and saw that empty parameters were
> > being passed into my taglib logic. What's going
> on?
> > 
> > Does this have anything to do with the order of
> XSP
> > processing on the page, as I have an <xsp:expr>
> inside
> > a user-defined taglib which also is expanded by
> the
> > XSP processor?
> 
> The taglib is expanded by the XSLT processor. If you
> want to put the name of
> the variables value1 and value2 in the code
> generated by your taglib, don't use
> <xsp:expr>, use the name of the variable. Something
> like this:
> 
> <mylib:mytag>
>   <param1>value1</param1>
>   <param2>value2</param2>
> </mylib:mytag>
> 
> The template for mylib:mytag will look like this
> then:
> 
> <xsl:template match="mylib:mytag">
>   {
>     String arg1 = <xsl:value-of select="param1">;
>     String arg2 = <xsl:value-of select="param2">;
>     ...
>     // do something with arg1 and arg2
>   }
> </xsl:template>
> 
> Keep in mind that the stylesheet for your taglib
> should generate code, and that
> you don't have to make any assumptions on what is
> generated in previous
> transformation steps.
> 
> Regards,
> -- 
> Ovidiu Predescu <ovidiu@cup.hp.com>
> http://orion.nsr.hp.com/ (inside HP's firewall only)
> http://www.geocities.com/SiliconValley/Monitor/7464/
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> cocoon-users-help@xml.apache.org
> 
> .
> l.apache.org
> For additional commands, e-mail:
> cocoon-users-help@xml.apache.org
> 
> .
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/

Mime
View raw message