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>

where internal "'"s are replaced by "''" and "?" and "&" are escaped by a backslash. I know how to do this using regular expressions, so if I could assign the value of //SQLStatement into a java variable in an XSP page, I'd be OK.

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?

P.S. I've read Jeni Tennison's string replacement method at
http://www.dpawson.co.uk/xsl/sect2/StringReplace.html#d7016e13
but this won't quite do it as I need to use back references....


I-Lin Kuo, Ann Arbor, MI Macromedia Certified ColdFusion 5.0 Advanced Developer Sun Certified Java 2 Programmer Ann Arbor Java Users Group (http://www.aajug.org)



_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail



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



Reply via email to