Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 19545 invoked from network); 30 Dec 2000 20:48:39 -0000 Received: from mail.ursus.ru (HELO ursus.ru) (195.96.66.197) by h29.sny.collab.net with SMTP; 30 Dec 2000 20:48:39 -0000 Received: from [195.42.70.4] (HELO anthony) by ursus.ru (Stalker SMTP Server 1.7) with SMTP id S.0000188647; Sat, 30 Dec 2000 23:47:36 +0400 From: "Tagunov Anthony" To: "cocoon-dev@xml.apache.org" , "cocoon-users@xml.apache.org" Date: Sat, 30 Dec 2000 23:51:15 +0300 Reply-To: "Tagunov Anthony" Priority: Normal X-Mailer: PMMail 2000 Professional (2.10.2010) For Windows NT (4.0.1381;6) In-Reply-To: <20001229121312.A1438@plan9ws1.uct.usm.maine.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Subject: Re: esql Bug? joint to question Message-Id: X-Spam-Rating: h29.sny.collab.net 1.6.2 0/1000/N Hello, Matthew Cordes! There's esql schema available at http://xml.apache.org/websrc/index.cgi/xml-cocoon/samples/sql/esql.xsd BTW it clearly showes that should still be sibling. I also noticed that I couldn't get it instantinated with the latest version of esql.xsl (from http://xml.apache.org/websrc/index.cgi/xml-cocoon/src/org/apache/cocoon/processor/xsp/library/sql/esql.xsl) Maybe it is just a bug? There's an instruction for instantiating but none for . >Hello all, > >My patch to esql before may have been too hasty. > >I am trying to get the block to >be done when there are no results. My initial confusion >was that from my experience with the older esql I assumed > was a sibling of e.g. > > > > > > > > > > > >but this does not work, after a little research I discovered >that having as a child of >seemed to work, e.g. > > > > > > > > > > > > > > >this is due to line 318 in esql.xsl >> >> >> > >but the problem here is when is set to 1 >there is a problem at line 342 in esql.xsl > >> >> >> while (_esql_query.resultset.next()) { >> >> if (_esql_query.max_rows != -1 && _esql_query.position - _esql_query.skip_rows == _esql_query.max_rows-1) { >> break; >> } >> _esql_query.position++; >> } >> >> > >Note the if statement, if _esql_query.max_rows == 1 and >_esql_query.skip_rows = 0 and _esql_query.position = 0 ( we're >on the first row returned ) that line reads: > >>if ( 1 != -1 && 0 - 0 == 0 ) > >thus the line: >> _esql_query.position++; > >is not incremented although it should be and inside >the check for no-results at line 326 >> >> >> if (_esql_query.position == _esql_query.skip_rows) { >> >> } >> >> > >that if reads >> if ( 0 == 0 ) >, thus we have applied templates for kids >and now for kids. > >This is an easy fix by making that block at 324 read: > > > while (_esql_query.resultset.next()) { > > _esql_query.position++; > > if (_esql_query.max_rows != -1 && _esql_query.position - _esql_query.skip_rows == _esql_query.max_rows) { > break; > } > } > > > >Note the increment and if are inverted above and the last compare >is with _esql_query.max_rows not _esql_query.max_rows-1. > >Also I recall hearing discussion about esql's schema. Is that >available? It would make deciphering the logicsheet a little easier. > >Please excuse me if I have misunderstood the syntax of esql. > >-matt In addition to that, I've got an almost desperate call to esql develpers (Donald Ball and Robin Green): We should get instantiated when a rowset with zero lines has been retrived.. (or maybe also when when max-rows and skip-rows parameters are set in such a way that no rows are availabel for instantiating ?).. PLEASE: CAN WE HAVE INSTANTIATED ONLY OTHERWISE? (FOR NEVER TO HAVE BOTH and both instantiated?) I see three variants: 1) we instantiate when and only when there are lines in the Resultset (and and select positive number of rows) we instantiate (if any) otherwise 2) we instantiate when and only when there are lines in the Resultset (and and select positive number of rows) OR WHEN NO has been given we instantiate otherwise 3) we instantiate always. we instantiate when it is present and the number of rows in the resultset chosen by and equals to zero PLEASE, can we have 1) or 2) ? PLEASE, can we not have 3)? Robin and Donald? I personally thing that it is sensible to put some framing around (incapsulate 'em in a paremnt element) that should be generated ONLY IF THERE ARE ANY instantiated). In we could want totally different tags (this will simplify the xsl that gets applied after xsp+esql.xsl). My best regards, Tagunov Anthony NNT Telecom Russia