You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Anjul Srivastava <an...@anjul.com> on 2001/03/20 00:25:53 UTC

esql Transitive closure (recursive queries) cocoon2

1. Is there any elegant way to construct an XML document built from recursive queries using esql? (see example (5.))
2. Are there any plans to support such functionality in esql?
3. Is it possible to support such functionality in cocoon? I can't see any straightforward way. Ideally one would want to use the "template" mechanism of stylesheets to do the recursion for me.
4. How about cocoon2? Does it alleviate this problem or make it more difficult?
5. Example:

Table:

items (child int, parent int)
1 0
2 1
3 1
4 2
5 2
6 3
7 3
8 4
9 4

Desired XML output:

<item>
 1
  <item>
   2
    <item>
     4
      <item>
       8
      </item>
      <item>
       9
      </item>
    </item>
    <item>
     5
    </item>
  </item>
  <item>
   3
    <item>
     6
    </item>
    <item>
     7
    </item>
  <item>
</item>

Best regards,
Anjul.

Re: esql Transitive closure (recursive queries) cocoon2

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 19 Mar 2001, Anjul Srivastava wrote:

> 1. Is there any elegant way to construct an XML document built from
> recursive queries using esql? (see example (5.))

not unbounded recursively, no.

> 2. Are there any plans to support such functionality in esql?

if you can suggest a good syntax for describing it, that'd be swell.

> 3. Is it possible to support such functionality in cocoon? I can't see
> any straightforward way. Ideally one would want to use the "template"
> mechanism of stylesheets to do the recursion for me.

you pretty much need to put the esql query into a java function that you
can invoke arbitrarily at request-time - but that's problematic, since you
don't really know what variables the author is going to reference inside
the function.

> 4. How about cocoon2? Does it alleviate this problem or make it more
> difficult?

it's essentially just a deficiency in the xsp language, i think. various
mechanisms have been suggested to work around it, but no one's ever forced
the issue. it's not a very common problem, but it does irk me.

- donald


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>