cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Savory <>
Subject Re: String replacement in Cocoon
Date Mon, 24 Feb 2003 06:15:28 GMT
On Sun, 23 Feb 2003, I-Lin Kuo wrote:

> I really do need to do this, as I'm generating insert statements for the
> database. My information comes in the form of XML documents which I'm
> partially pulling apart to enter in the database. Unfortunately, I can't
> just take the information between the tags and generate an insert statement,
> because the characters '?& have special meaning and have to be escaped.

Ah, I see. If you're using XSP and assigning the strings to variables, the
escaping is taken care of automatically for you:

    String text = <xsp-request:get-parameter name="text" default=""/>;
        <esql:query>INSERT INTO MyTable(Text) VALUES (<esql:parameter><xsp:expr>text</xsp:expr></esql:parameter>)</esql:query>

See for information on
Prepared Statements.

Hope that helps,


Andrew Savory                                Email:
Managing Director                              Tel:  +44 (0)870 741 6658
Luminas Internet Applications                  Fax:  +44 (0)700 598 1135
This is not an official statement or order.    Web:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message