cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: esql-get as parameter
Date Thu, 24 May 2001 17:40:28 GMT
On Thu, 24 May 2001, K.P.Majoor wrote:

> I'm trying to get recursively results from my dbase like this :
>
> <xsl:template match="kblib:root-cat">
>
>   <esql:execute-query>
>     <esql:query>SELECT name, category_id FROM categories WHERE
> categoryPar=null</esql:query>
>     <esql:results>
>
>        <esql:row-results>
>        <category>
>           <name>
>               <xsl:call-template name="kids">
>                <xsl:with-param name="id"><esql:get-string
> column="name"/></xsl:with-param>
>               <xsl:with-param name="ancestor"><xsl:number level="any"
> count="kblib:root-cat" format="1"/></xsl:with-param>
>              </xsl:call-template>
>
>                   <esql:get-string column="name"/>
>           </name>
>     </category>
>   </esql:row-results>
>
>  </esql:results>
> </esql:execute-query>
>
> <xsl:template match="kblib:kid-cat" name="kids">
>  <xsl:param name="id"/>
>  <category> <name> <xsl:value-of select="$id"/> </name> </category>
> </xsl:template>
>
> I don't understand why the esql-get does not return anything into the id
> parameter of the kid template....? If I replace it with a string, it
> works.
> The second esql-get returns the values perfect like I want to have them.
>
> Eventually the structure shoudl be sth like this :
>
>   <category>
>     <name></name>
>     <category>
>         <name></name>
>         <category>
>             <name></name>
>         </category>
>   </category>
> </category>
>
> Does anybody have an idea why this does not work?

yeah - esql/xsp is _not_ able to handle creation of arbitrarily deep
nested content like this - it would require creating and recursively
calling a java method, which isn't the easiest thing in the world to do in
xsp. however, if you generate a simple list of category/name pair things,
you should be able to massage it into an arbitrarily deep nested tree
structure using xslt.

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


Mime
View raw message