My previous answer was lacking in several respects.  Here is a better one:
you are expecting your query to end up with "id = 5", but that won't happen
because your logicsheet is applied *before* the XSP is even turned into
Java code.  So there is no possible way that your logicsheet could obtain
the value "5" from the java variable and do the substitution as you are
expecting.  Here is better code that will behave dynamically, and follows
the "best practices" for ESQL:

<xsl:template match="section:edit">
      ...
            <esql:query>
                  select * from section
                  where id=
                        <esql:parameter type="int">
                              <xsl:copy-of select="section:id/*"/>
                        </esql:parameter>
            </esql:query>
      ...
</xsl:template>

-Christopher



|---------+---------------------------->
|         |           Otmar Vobejda    |
|         |           <[EMAIL PROTECTED]>|
|         |                            |
|         |           11/09/2003 08:11 |
|         |           PM               |
|         |           Please respond to|
|         |           users            |
|         |                            |
|---------+---------------------------->
  
>--------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                          |
  |       To:       [EMAIL PROTECTED]                                                  
                    |
  |       cc:                                                                          
                          |
  |       Subject:  Dynamic parameter for logicsheet                                   
                          |
  
>--------------------------------------------------------------------------------------------------------------|




Hi people, I don't understand one thing:

in XSP file I have this piece of code:

<xsp:logic>
    String sectionId = 5;

    <section:edit>
        <section:id><xsp:expr>sectionId</xsp:expr></section:id>
    </section:edit>

</xsp:logic>

this "calls" template "section:edit" in logicsheet, which is defined:

    <xsl:template match="section:edit">
...
                    <esql:query>select * from section where
id=<xsl:value-of select="section:id"/></esql:query>
...
    </xsl:template>

It should send to SQL server query 'select * from section where id=5',
But to ESQL it sends query 'select * from section where id=sectionId'.

WHY??? And why to do it correctly?

Thanx!

osup


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





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

Reply via email to