Volker Bublitz wrote:
hi.
is it possible to use xsp to generate several sql-statements which can
be transformed with the sql-transformer?
example
<xsp:logic>
private String writeSQLOutput() {
StringBuffer sb = new StringBuffer("");
String[] id = request.getParameterValues("ids");
if(id!=null) {
for(int i=0;i < id.length;i++) {
sb.append("<sql:execute-query
xmlns:sql=\"http://apache.org/cocoon/SQL/2.0\">");
sb.append("<sql:query
xmlns:sql=\"http://apache.org/cocoon/SQL/2.0\">");
sb.append("INSERT INTO cmdb2customer (cmdb_id,customer_id)
VALUES "+ id[i] + ", 5");
sb.append("</sql:query>");
sb.append("</sql:execute-query>");
}
}
return sb.toString();
}
</xsp:logic>
<content>
<xsp:expr>writeSQLOutput()</xsp:expr>
</content>
<xsp:page>
my problem is, that this leads to an error (Open quote is expected for
attribute "xmlns:sql" associated with an element type "sql:query")
second problem is, if i change
<
to
<
or to
<
or to
<![CDATA[<]]>
the output that is generated contains < instead of the character "<".
if anyone here knows how can i write the "<"-character out of a String
that could probably help.... other ideas are welcome too. thanks a lot.
The usual way of dealing with this type of problem is with DOE.
How about:
<xsp:logic disable-output-escaping="true"> ... </xsp:logic>
Does that work?
Maybe try that on the <xsp:page> element?
I've not used XSP, and I don't know what gets output where or how.
Ben Pope
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]