You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Volker Bublitz <vb...@imatics.de> on 2005/04/22 15:55:42 UTC
xsp and < symbol problem
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.
greetings,
volker
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: xsp and < symbol problem
Posted by Volker Bublitz <bu...@poolzeit.de>.
thanks, but unfortunately it still doesn't work...
don't know what i do "wrong" (as i think because it's my understanding
that the purpose of xsp is to create dynamic xml-output ?)
volker
Am 25.04.2005 um 11:23 schrieb Ben Pope:
> Volker Bublitz wrote:
>> hi,
>> i tried both but neither does work. i googled but can't find anything
>> on how to create strings with "<" or ">" characters or how to print
>> these characters as output of the xsp.
>
> Posssibly my bad, I think the value is "yes", not "true":
>
> disable-output-escaping="yes"
>
> Can't help with the other problem.
>
> Ben
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: xsp and < symbol problem
Posted by Volker Bublitz <vb...@imatics.de>.
thanks, but unfortunately it still doesn't work...
don't know what i do "wrong" (as i think because it's my understanding
that the purpose of xsp is to create dynamic xml-output ?)
volker
Am 25.04.2005 um 11:23 schrieb Ben Pope:
> Volker Bublitz wrote:
>> hi,
>> i tried both but neither does work. i googled but can't find anything
>> on how to create strings with "<" or ">" characters or how to print
>> these characters as output of the xsp.
>
> Posssibly my bad, I think the value is "yes", not "true":
>
> disable-output-escaping="yes"
>
> Can't help with the other problem.
>
> Ben
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: xsp and < symbol problem
Posted by Ben Pope <be...@gmail.com>.
Volker Bublitz wrote:
> hi,
>
> i tried both but neither does work. i googled but can't find anything on
> how to create strings with "<" or ">" characters or how to print these
> characters as output of the xsp.
Posssibly my bad, I think the value is "yes", not "true":
disable-output-escaping="yes"
Can't help with the other problem.
Ben
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: xsp and < symbol problem
Posted by Volker Bublitz <vb...@imatics.de>.
hi,
i tried both but neither does work. i googled but can't find anything
on how to create strings with "<" or ">" characters or how to print
these characters as output of the xsp.
besides, i've got another problem.
code in xsp:
<xsp:page xmlns:xsp="http://apache.org/xsp"
xmlns:sql="http://apache.org/cocoon/SQL/2.0">
<sql:execute-query name="customer">
<sql:query>
INSERT INTO cmdb (bezeichnung,kategorie,standort,admin) VALUES (
'<sql:substitute-value
xmlns:sql="http://apache.org/cocoon/SQL/2.0" sql:name="bezeichnung"/>',
'<sql:substitute-value
xmlns:sql="http://apache.org/cocoon/SQL/2.0" sql:name="kategorie"/>',
'<sql:substitute-value
xmlns:sql="http://apache.org/cocoon/SQL/2.0" sql:name="standort"/>',
'<sql:substitute-value
xmlns:sql="http://apache.org/cocoon/SQL/2.0" sql:name="admin"/>')
</sql:query>
</sql:execute-query>
<xsp:logic>
[...]
output:
<sql:execute-query name="customer" xmlns:xsp="http://apache.org/xsp"
xmlns:sql="http://apache.org/cocoon/SQL/2.0">
<sql:query>
<sql:substitute-value sql:name=""/>
<sql:substitute-value sql:name=""/>
<sql:substitute-value sql:name=""/>
<sql:substitute-value sql:name=""/>
</sql:query>
</sql:execute-query>
what happened to the "INSERT INTO" etc???
greets,
volker
> 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: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: xsp and < symbol problem
Posted by Ben Pope <be...@gmail.com>.
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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org