Bill,


Please use @VARPARAM vs. @VAR for passing variables in @CALLMETHOD method 
parameters.



@VARPARAM is designed to work as a pass-as-reference function and solves the 
precise issue you are seeing.



Robert



From: Bill Downall [mailto:[email protected]]
Sent: Friday, March 25, 2011 9:03 AM
To: [email protected]
Subject: Witango-Talk: Quote cleaning strategies



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.



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

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

Reply via email to