cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject Re: Dynamic CForm with HTML-Tags in Initial-Value
Date Tue, 14 Mar 2006 12:03:23 GMT
On Tue, 2006-03-14 at 11:39 +0100, Moritz Kobel wrote:
> On Sat, 11 Mar 2006 12:48:27 +0100
> Bruno Dumon <bruno@outerthought.org> wrote:
> 
> > On Fri, 2006-03-10 at 19:35 +0100, Moritz Kobel wrote:
> > > Hi,
> > > 
> > > i'm writing a simple content management system with the html-editor
> > > tiny-mce instead of htmlarea. on one page there are multiple
> > > content-fields possible, so i generate the template & definition
> > > file with data from a sql database.
> > > when i fill up the inital-value with html code from the database
> > > all the html-tags are removed.
> > > 
> > > can somebody give me a hint how to solve this problem? i found no
> > > solution seeking the mailinglist and asking google.
> > 
> > If the fields use the string datatype, then make sure the HTML is in
> > escaped form, i.e. something like &lt;html&gt;&lt;body&gt; ...
> > 
> > Not sure if this is the problem though, as you would need to do
> > special effort for having it not escaped.
> > 
> 
> Thank you... it works!
> 
> if somebody has the same problem:
> using postgresql i've this part in the query:
> 
> [...]
> replace(replace(encode(v.content,'escape'),'&lt;','&amp;lt;'),'&gt;','&amp;gt;')
> as content
> [...]
> 
> (v.content is a bytea)

hmmm, IIUC you are escaping the XML double (and it seems not correct:
you need to escape every ampersand, not just &lt; and &gt;) because when
retrieving it from the database, you will be parsing it again. Why not
just remove the parsing?

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message