cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paint...@mc.duke.edu
Subject RE: esql:results
Date Wed, 18 Apr 2001 15:52:36 GMT

Mukesh,

Perhaps you are looking for this tag:
<esql:get-column-name column="1"/>

Put it inside the <esql:results> element.

There are other tags you might need, that provide the column data type and
so forth.  Right now the only documentation for this stuff is in the
logicsheet for the taglib.  Look in your Cocoon source tree for esql.xsl.
Search for templates matching "esql:get".  I think the only thing that
might be lacking is a tag to provide the column count.  You may have to
grab some of the java code from the taglib for that, or suggest to Donald
that such a tag be added.

Note that you could generate part of the header information just by using
XSL to extract the element names from the elements in one row.

-Christopher



On Wed, 18 Apr 2001 mukesh.jethwa@bankofamerica.com wrote:

> I have a simple objective which is to create a table of column names and
> thier values.
>
> I have a generic stylesheet which will serve all dynamically created XML
> docs in the following format.
> Note: The column names will vary based on the query but this should not
> matter to the stylesheet.
> eg.
>     <header>
>       <column name="id"         type="int"/>
>       <column name="department" type="string"/>
>     </header>
>
>     <row>
>       <id>1111</id>
>       <department>Enginering</department>
>     </row>
>     <row>
>       <id>2222</id>
>       <department>Design</department>
>     </row>
>     etc...
>
> Note the <header> holds the meta data stuff for the column name
> How can I use esql to  generate this information ?
>
>
> Currently I am using <esql:get-columns/> like this
> eg.
> <esql:row-results>
>   <row>
>     <esql:get-columns/>
>   </row>
> </esql:row-results>
>
> but this creates an XML doc like this:- where 'id' and 'department' are
> column names
>
>     <row>
>       <id>1111</id>
>       <department>Enginering</department>
>     </row>
>     <row>
>       <id>2222</id>
>       <department>Design</department>
>     </row>
>






---------------------------------------------------------------------
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