cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "OD" ...@feersumendjinns.com>
Subject Re: [C1.8.1-dev] esql.xsl
Date Thu, 28 Sep 2000 19:40:59 GMT
I have to admit to not understanding what you mean, I've looked at W3C's
namespace docs and I've reread the cocoon docs.
Maybe my question was ambigious.

Given xml like:

<page-setup snipped="yes"/>

<page>

<esql:execute-query>
<esql:db-connection snipped="yes"/>
<esql:max-rows>10</esql:max-rows>

<esql:query>select id, name, surname from people order by
surname</esql:query>

<esql:results>
 <person>
  <id><esql:get-string column="id"/></id>
  <name><esql:get-string column="name"/></name>
  <surname><esql:get-string column="surname"/></surname>
 </person>
</esql:results>

<esql:errors-and-noresults snipped="yes"/>

</esql:execute-query>
</page>

After been passed through the esql.xsl logicsheet we would end up with xml
like

<person>
 <id>1</id>
 <name>Fred</name>
 <surname>Bloggs</surname>
</person>
<etc/>

This is easily transformable into a nice html table with rows for every
database row upto <esql:max-rows>
If <esql:query> matches 839 records from the database and I've limited the
xml to 10 rows.
How would my taglib know how many records in total were returned and display
that information?
How would my taglib know where we are in the resultset and display that
information?
How would my taglib be able to navigate backwards and forwards through the
entire resultset?
At the end of the day I wanted a html a little like this

--------------------------------------------------
Found 839 records, displaying records 151 - 160|
--------------------------------------------------
Row1
--------------------------------------------------|
Row2
--------------------------------------------------|
Etc...
--------------------------------------------------|
Prev                                                           Next |

With Next taking me to records 161 through 170 and Prev going to 141 - 150

I didn't give this much thought it *seemed* obvious that all I had to do was
add
<!--All of the tags are optional.!-->

<esql:results-gui>
 <gui>
  <count><esql:get-total-record-count/></count>
  <display><esql:get-displayed-records/></display>
  <next><esql:generate-next-link url="esql.xml" parameter="esqlSkip"></next>
  <prev><esql:generate-prev-link url="esql.xml" parameter="esqlSkip"></prev>
 </gui>
</esql:results-gui>

Giving me xml like
<gui>
 <count>839</count>
 <display>151 - 160</display>
 <next>esql.xml?esqlSkip=160</next>
 <prev>esql.xml?esqlSkip=140</next>
</gui>
<person>
 <id>1</id>
 <name>Fred</name>
 <surname>Bloggs</surname>
</person>

Apologies for been long winded, is there a better and/or easier way to
achieve this?

Corey O'Donovan

----- Original Message -----
From: Donald Ball <balld@webslingerZ.com>
To: <cocoon-dev@xml.apache.org>
Sent: Thursday, September 28, 2000 7:21 PM
Subject: Re: [C1.8.1-dev] esql.xsl


> On Thu, 28 Sep 2000, OD wrote:
>
> > Any interest in some new tags for the esql.xsl logicsheet that
> > automatically generate parts of a GUI?
>
> why would you need _new_ elements in the esql logicsheet? why can't you
> just intersperse tags in your GUI namespace and tags in the esql namespace
> underneath esql:results?
>
> - donald


Mime
View raw message