[ZPT] CDATA section in zpt

Fergal Daly fergal at esatclear.ie
Mon Nov 28 13:13:46 EST 2005


On 11/28/05, "Jürgen R. Plasser" <plasser at hexagon.at> wrote:
> Fergal Daly wrote:
> > <content:encoded>
> > <![CDATA[
> >    <span tal:replace="..." />
> > ]]>
> > </content:encoded>
> >
> > is essentially the same as
> >
> > <content:encoded>
> >
> >    &lt;span tal:replace=&quot;...&quot; /&gt
> >
> > </content:encoded>
> >
> > so TAL doesn't see a <span> element at all. It could be done with something like
> >
> > <content:encoded>
> > <span tal:replace="structure string:&lt;![CDATA[${...}&gt;">
> > </content:encoded>
>
> I had the same idea right after my e-mail to this list, but the RSS feed
> (of which this tag is a part of) worked fine without CDATA. When I build
> the feed with the string expression, structure does not work for me
> (error). And without structure the feed's content starts with a "[" and
> ends with a ">" in my feed reader.

The CDATA should definitely not be a requirement, it is basically just
a convenient way of expressing text without having to worry about
escaping your <s, >s and &s. It's possible the construct above gives
an error in your feed reader because the ${...} expression also has a
CDATA section in it, but if you got it to work without CDATA then you
needn't worry about it,

F


More information about the ZPT mailing list