Maybe stupid question, but how to insert ESQL tags inside <xsp:logic> block? Next example is absolutly wrong:

<xsp:page ...>

<xsp:logic>

public void testMethod() {

       <esql:connection>
           <esql:pool>diplpool</esql:pool>
           <esql:execute-query>
               <esql:query>select id, name from test</esql:query>
               <esql:results>
                   <esql:row-results>
                       <esql:get-string column="id"/>
                       <esql:get-string column="name"/>
                   </esql:row-results>
               </esql:results>
               <esql:no-results>Empty</esql:no-results>
               <esql:error-results>Error!</esql:error-results>
           </esql:execute-query>
       </esql:connection>

}

</xsp:logic>
<page></page>
</xsp:page>



Christopher Painter-Wakefield wrote:




No, your functions must be defined within an xsp:logic block, which will
protect them from being the top user element in xsp:page.  The output won't
occur until you call the function, which will be within your top user
element.  So you should be able to get the output you are expecting.

I have had problems in the past doing output from user functions, due to
some xspAttr variable or some such not being available.  It seems to me
that it was easy enough to fix, by passing the missing variable into the
function call.  If that won't work, you can always fall back on building a
list in Java via recursion, and returning that from your function.  Loop on
the list in your main body to output.  But you should be able to do output
from your functions, with a little work.

-Christopher



Otmar Vobejda <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] cc: 11/05/2003 03:48 Subject: Re: Recursive reading from database PM Please respond to users




Thanx for your answer. I'm using mysql now and there is no similar feature as you said, I think.



ESQL elements don't have to be inside the top user element, at least


in...

Yes, it is maybe possible, that it can be outside the top user element, but
if ESQL elements are generating some XML output, the top element of this
output is taken as top user element and that's not good. If I want to use
it recursively, it will generate uncorrect data. What i want to generate,
can be something like this:

<elements>
            <element>blabla</element>
            <element>- bleble</element>
            <element>- - blibli</element>
            <element>- blublu</element>
            <element>blabla2</element>
</elements>

And what to do now... ? :)

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