cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <h...@dvs1.informatik.tu-darmstadt.de>
Subject Re: programatically examine columns in a row
Date Mon, 17 Sep 2001 21:14:46 GMT
On 17.Sep.2001 -- 06:43 PM, Chris Newland wrote:
> Hi All,
> 
> I'm looking for a generic way to examine the columns in a row retrieved using esql:
> 
> <esql:results>
> 	<xsp:logic>
> 	int cols = <esql:get-column-count/>;
> 	String colname;
> 	</xsp:logic>
> 	
> 	<esql:row-results>
> 		<xsp:logic>
> 			for (int i = 0; i &lt; cols; i++)
> 			{

try
 				colname = <esql:get-column-name><esql:param name="column"><xsp:expr>i</xsp:expr></esql:param></esql:get-column-name>;
                                                                 ^^^^^^^^^^              
                        ^^^^^^^^^^
<xsp:attribute> does not work as you'd expect -- it is needed to
construct XML tags dynamically that are outputted to the
transformation process. Here you'd need to construct different Java
code. Most included taglibs follow this convention to use
<prefix:param> tag for this.

> 			}
> 		</xsp:logic>
>          	</esql:row-results>
> </esql:results>
> 
> but this throws an exception: No method matching getColumnName() found in interface java.sql.ResultSetMetaData.
(i.e. the column attribute is not being picked up)
> 
> Is it possible to add attributes to a logicsheet tag? I don't think it is but I can't
think of another way of passing the parameter to the get-column-name tag.
> 
> Is this possible?

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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