Frank Thilo Mueller wrote:
Dear Christian,

thank you very much for your answer. I already had tried both ways
before but I couldnt reach the result I am heading at.

Im using the esql example to print out table column name number i.


<esql:get-column-name>
  <esql:param name="column"><xsp:expr>i</xsp:expr></esql:param>
</esql:get-column-name>


If I replace this i with a 1, everything is fine. If I define int 1=1
outside of the <content> then it gives me an error:

org.apache.cocoon.ProcessingException: Language Exception:
org.apache.cocoon.components.language.LanguageException: Error compiling
esql_xsp: ERROR 1
(org\apache\cocoon\www\samples\databases\xsp\esql_xsp.java): ... default:
this.characters("\n "); // start error (lines 588-588) "String literal is
not properly closed by a double-quote"
XSPObjectHelper.xspExpr(contentHandler,
_esql_query.getResultSet().getMetaData().getColumnName(" // end error i
")); this.characters("\n\n\t"); ... Line 588, column 0: String literal is
not properly closed by a double-quote

Which says nearly nothing to me.

It boils down to Leon's advice to remove whitespace. Note that I wrote <esql:param name="column"><xsp:expr>i</xsp:expr></esql:param> while you write <esql:param name="column"> <xsp:expr>i</xsp:expr> </esql:param> The key is that the macro needs to determine whether it's a string or a number to deal with. A string would translate to a column name while a number would translate to a - well - column number.

The whitespace causes it to be considered as column name.

BTW Leon's other advice to use xsp:attriubte does not work since it targets the SAX stream while you need to pass it to a logicsheet.

Chris.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to