cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "hugo burm" <hu...@xs4all.nl>
Subject Setting attributes of the esql tags dynamically
Date Wed, 13 Feb 2002 14:43:10 GMT

How can I set the "column" attribute of the tags in the esql taglib
dynamically? xsp:attribute generates an error.

The problem:
I have simple sql query "select * from mytable".
Mytable has 5 columns.
The code below generates a Xalan transformer error in C2.0.1  (W2000, Tomcat
4.0.1):
When I replace the outdented code below the <!-- 1 --> line with:
<xsp:expr>ic</xsp:expr> the numbers 12345 are printed as expected.
(cnt=number of columns=5).
When I replace the outdented code below the <!-- 1 --> line with:
<esql:get-column-name column="1"/> , the name of the first column is printed
5 times as expected.
So the logic and the query are ok, it is the xsp:attribute that generates
the error.

At the end of the esql documentation of the esql tags there is a note in
documentation of "@*|node()" that the taglib expects a <esql:column> tag
with the name of the column as content when there is no column attribute
(after evaluating xsp which is what I need). I experimented with this but
that didn't work either. How can I use this?

Thanks
Hugo Burm
hugob@xs4all.nl


code
====

        <esql:results>
           <esql:row-results>
              <xsp:logic>
                  for (ic=1; ic &lt;= cnt; ic++)  {
              </xsp:logic>
<!-- 1 -->
  <esql:get-column-name>
    <xsp:attribute
name="column"><xsp:expr>ic</xsp:expr></xsp:attribute>
  </esql:get-column-name>

              <xsp:logic>
                 }
              </xsp:logic>
           </esql:row-results>
        </esql:results>


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