This will help U

<xsl:template match="gvsdb:list-people"> 
    <xsl:variable name="class"> 
     <xsl:choose>
         <xsl:when test="string(@class)">
            <util:include-expr> 
          <util:expr> 
                <xsp:expr> 
                          (XMLGenerator.toXML(<xsl:value-of
select="@class"/>Helper.getAll())).asXML() 
                </xsp:expr> 
                   </util:expr> 
           </util:include-expr> 
         </xsl:when>
        <xsl:otherwise>
            <util:include-expr> 
          <util:expr> 
                <xsp:expr> 
                          (XMLGenerator.toXML(<xsl:value-of
select="class"/>Helper.getAll())).asXML() 
                </xsp:expr> 
                   </util:expr> 
           </util:include-expr>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>



In the XSP File...

<gvsdb:list-people class="Singer"> for static

For dynamic 
<gvsdb:list-people>
        <class> <xsp-request:get-parameter name="class"/></class>
</gvsdb:list-people>
 

Note that the XSL handles both the cases
        <gvsdb:list-people class="Singer" >

and 
        <gvsdb:list-people>
                <class>Singer</class>


Hope this helps...

Regds,
Chiths

-----Original Message-----
From: Sreedhar Chintalapaty [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 04, 2002 3:05 PM
To: Cocoon Users
Subject: Tags: Passing dynamically generated values for parameters

I am stuck for the last two days, and having scourged the newsgroup
postings, I think a direct appeal is okay... 
 
My entire project revolves around being able to do something like this,
and my go-live date is nearing, so please, h-e-l-p.
 
The problem is this:
 
I have a custom logic sheet with a method called list-people. It takes
in a parameter called "class", and calls the appropriate helper class to
do its stuff. The tag code looks like this:
<xsl:template match="gvsdb:list-people"> 
    <xsl:variable name="class"/>
    <util:include-expr>
        <util:expr>
            <xsp:expr>
                (XMLGenerator.toXML(<xsl:value-of
select="@class"/>Helper.getAll())).asXML()
            </xsp:expr>
        </util:expr>
    </util:include-expr> 
</xsl:template>
In an xsp file called people.xml, I call this tag to populate a table,
like so:    
<gvsdb:list-people class="Singer"> 
This works fine.
 
Now I try (in vain) to make this dynamic by getting the value of "class"
from an identically named request parameter. I tried a bunch of options,
such as:
<xsp:element name="gvsdb:list-people">
    <xsp:attribute name="class">
        <xsp:expr>
            <xsp-request:get-parameter name="class"/>
        </xsp:expr>
    </xsp:attribute>
</xsp:element>
 
This one fails! Instead of executing the tag, it merely writes it out to
the output as
<gvsdb:list-people class="Singer"> 
How do I make this work and populate the table?
 
 
Best Regards, 

Sreedhar Chintalapaty 
_______________________________________
A computer is like an Old Testament god, with a lot of rules and no
mercy - Joseph Campbell
 


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

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

Reply via email to