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.


I-Lin Kuo, Ann Arbor, MI


----Original Message Follows----
From: Andrew Savory <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: String replacement in Cocoon
Date: Sun, 23 Feb 2003 16:33:02 +0000 (GMT)


Hi,


On Sun, 23 Feb 2003, I-Lin Kuo wrote:

> I'm trying to replace something like
>
> <SQLStatement>
>   INSERT INTO MyTable(text)
>   VALUES ('& What's the matter?')
> </SQLStatement>
>
> with
>
> <SQLStatement>
>   INSERT INTO MyTable(text)
>   VALUES ('\& What''s the matter\?')
> </SQLStatement>

You probably don't really want to do this ... the database should hold the
"proper" value of the text, not a value modified for display (or
whatever).

> I'd like to take the contents of the first <SQLStatement> and pipe it into
> an XSP page (while preserving whitespace) but can't figure out how to do
> that. Is this the right approach, or is there another way?


Not sure what you're trying to achieve here. Why do you need the \
escaping?


Andrew.




_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail



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



Reply via email to