cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas Toper" <nto...@jouve.fr>
Subject RE: Recursive reading from database
Date Wed, 05 Nov 2003 09:58:43 GMT
Why don't you use the SQL Transformer combined with the FilterTransformer?
It might be easier?

-----Message d'origine-----
De : Otmar Vobejda [mailto:otmar@hcwerk.cz]
Envoyé : mercredi 5 novembre 2003 10:47
A : users@cocoon.apache.org
Objet : Recursive reading from database


Hi, i'm a beginner in the Cocoon domain and first problem, what I'd like
to solve, is recursive reading from database. For example you have a
table test(id int, parent int, name varchar), where parent attribute
points to id attribute of parent rows and you need to read all the rows
to the tree.

for example something like this (excuse the syntax :):

// recursive function
public void readData (int parent) {
  select id, name from test where parent= $parent;
  for each result {
      print ($name);
      readData($id);
  }

// start recursion:
readData(null);

But how to write in XSP, when methods need to be in root <xsp:page>
element and esql tags must be inside top user element (or how it is
termed).

Thank a lot for each your outline!

osup



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message