I have a variable, retrieved from a database column, that may contain single
or double quotes.

If request$paragraph contains this value: *I was surprised that he was only
5'4" tall.*
*
*
I want to pass it to a method that cleans up text for safe XML encoding.

<@assign request$cleanedPara
value=<@callmethod object=this method="XMLEncode('<@var
request$paragraph>')">>

the XMLEncode method takes the input parameter and replaces less-than signs,
greater-than signs, European characters with diacritical marks, and
quotation marks of both kinds with XML-safe encoding. It works nicely in
almost all circumstances.

But I haven't yet tricked it into working when the input string contains
either an unmatched apostrophe or an unmatched double-quote character. The
problem seems to be at the @callmethod tag: the method cannot find the input
text if it has an odd number of either of the problem characters in it.
paragraph has to be enclosed in some quotation character, because it
contains spaces. I've tried lots of ways of quoting and not quoting the
parameter, and encoding but haven't found one yet that works.

Does anyone have a trick to share that would make this work? Editing in 5.5
Studio, running in 6.0.7. Thanks.

Bill


----------------------------------------

To unsubscribe from this list, please send an email to [email protected] 
with "unsubscribe witango-talk" in the body.

Reply via email to