Actually I use the esql.xsl coming with the Cocoon-2.0b2,
1.4.2.5 2001/07/24 11:37:57
but I inserted at line 532 the else brunch which you have posted.
Maybe the lines 521-523 are the problem because
"esql:no-resluts" will be called after each last row.

>From line 504 it looks like this:
      if (_esql_query.results) {
        do {
          _esql_query.resultset = _esql_query.statement.getResultSet();
          _esql_query.resultset_metadata =
_esql_query.resultset.getMetaData();
          _esql_query.position = 0;
          if (_esql_connection.use_limit_clause == 0 &&
_esql_query.skip_rows > 0) {
            while (_esql_query.resultset.next()) {
              _esql_query.position++;
              if (_esql_query.position == _esql_query.skip_rows) {
                break;
              }
            }
          }
 
          if (_esql_query.resultset.next()) {
            <xsl:apply-templates select="esql:results"/>
          }
          else {
            <xsl:apply-templates select="esql:no-results"/>
          }
 
          _esql_query.resultset.close();
        } while(_esql_query.statement.getMoreResults());
      } else {
        _esql_query.position = _esql_query.statement.getUpdateCount();
        if (_esql_query.position &gt;= 0) {
          <xsl:apply-templates select="esql:update-results/*"/>
        }
        else{
          <xsl:apply-templates select="esql:no-results"/>
        }
      }
      _esql_query.statement.close();

By the way is line 504 correct?
if(_esql_query.results)
Because this is a ResultSet and not a boolean, don't should it
compare against null? Or is this not pure java?

Regards,
Michael


Torsten Curdt wrote:
> 
> > Hi Thorsten,
> > I followed the discussion about esql:no-results
> > In the beta1 release it was ok, if no rows
> > the no-results content was in the tree, otherwise not.
> > But now it is inverted.
> > With beta2 also after applying your patch to esql.xsl
> > I get the content of no-results if the query returns results
> > and the no-results content is not in the tree in case of
> > really no results.
> >
> > There is one other point confusing me: in esql.xsd I find:
> > <element name="esql:no-results" minOccurs="0" maxOccurs="1">
> >  <annotation>
> >   <documentation>This element's children are instantiated in the result
> > tree for each row in the resultset</documentation>
> >  </annotation>
> > </element>
> >
> > For each row?
> > Did I misunderstand the meaning of no-results?
> 
> No, you did not. (a bug in the docuentation ;)
> Maybe could tell me which revision of esql.xsl you
> have? Works everything fine here...
> 
> regards
> --
> Torsten

---------------------------------------------------------------------
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