I have a method that I want to return a list. The problem is that one of the items in the list needs to have an embedded single quote character. I'm currently returning the list like this: <dtml-return "['item1', 'item2', 'item3']"> how can I recode this so that I can return items like "John's"? Thanks. James W. Howe mailto:jwh@allencreek.com Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html Ann Arbor, MI 48103
On 7 Mar, James W. Howe wrote:
I have a method that I want to return a list. The problem is that one of the items in the list needs to have an embedded single quote character. I'm currently returning the list like this:
<dtml-return "['item1', 'item2', 'item3']">
how can I recode this so that I can return items like "John's"?
This is just a guess (I'm a Zope newbie too) but I believe <dtml-return "['John\'s', 'Mary\'s']"> Will work. -- ______ __ __ _____ _ _ | ____ | \_/ |_____] |_____| |_____| |_____ | | | | @ t w i s t e d m a t r i x . c o m http://www.twistedmatrix.com/~glyph/
At 05:17 PM 3/7/00 -0500, glyph@twistedmatrix.com wrote:
On 7 Mar, James W. Howe wrote:
I have a method that I want to return a list. The problem is that one of the items in the list needs to have an embedded single quote character. I'm currently returning the list like this:
<dtml-return "['item1', 'item2', 'item3']">
how can I recode this so that I can return items like "John's"?
This is just a guess (I'm a Zope newbie too) but I believe
<dtml-return "['John\'s', 'Mary\'s']">
Will work.
I forgot to try that (I tried using alternative quote characters and that didn't work). Thanks. James W. Howe mailto:jwh@allencreek.com Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html Ann Arbor, MI 48103
On Tue, 7 Mar 2000, James W. Howe wrote: [snip]
<dtml-return "['item1', 'item2', 'item3']">
how can I recode this so that I can return items like "John's"?
Try: <dtml-return expr="['item1', 'item2', 'item3', 'John\'s']"> It works for me.
Thanks.
No problem. --Jeff --- Jeff K. Hoffman 704.849.0731 x108 Chief Technology Officer mailto:jeff@goingv.com Going Virtual, L.L.C. http://www.goingv.com/
participants (3)
-
glyphï¼ twistedmatrix.com -
James W. Howe -
Jeff K. Hoffman