[Zope] Re: Using Structured Text and HTML-quote together for RSS 2.0

Florent Guillaume fg at nuxeo.com
Fri Sep 9 07:14:04 EDT 2005


Jonathan Cyr wrote:
> That's the ticket.  You're right the CDATA solution is much better than 
> html-quote'ing everything.
> 
> Many thanks,
> 
> -Jon
> 
> Peter Bengtsson wrote:
> 
>> Create a python script called rssFormatter(text)::
>>
>> from Products.PythonScripts.standard import structured_text, html_quote
>> return html_quote(structured_text(text))
>>
>> Which you use later as <dtml-var "rssFormatter(summary)">
>>
>> I think for some of my RSS feeds I use CDATA, so _my_ rssFormatter()
>> script looks something like this::
>>
>> return "<![CDATA[%s]]>" % text
>>
>> The advantage with CDATA is that you won't need to html quote things.

Which is not really true, you still have to find a way to deal with your 
string if it contains ']]>' which is the end marker for CDATA.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the Zope mailing list