cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans-Guenter Stein <Hans-Guenter.St...@siteos.de>
Subject Re: problem of unwanted changing < to &lt; in query result
Date Tue, 25 Jul 2000 19:39:19 GMT
Anyway: how to do it:

2) Disable output escaping in the HTML Serializer.
    A *really* bad idea. Would have the net effect that you
    couldn't get a '<' or '>' character to appear in the
    browser (unless you start using '&amp;lt;' in your
    content documents, which is A Bad Idea).

Paul Russell wrote:

> On Fri, Jun 30, 2000 at 08:52:52AM -0700, Ramin Jalali wrote:
> > I'm getting some data from Oracle database via SQLProcessor and SQL queries.
> > The problem is that some data are in html code with <p>, </p>, and other
> > tags. I need to have them with html tags again but every < changes to &lt;
> > and every > changes to &gt; please tell me if there is  any way to turn this
> > off and get my data pure and intact.
>
> Nope. The problem is that Cocoon (like all [good] java programs)
> works in unicode internally. Any '<' characters in the data
> flowing through cocoon only get converted into '&lt' in the
> final stage of processing (inside the formatter). The *only*
> way to get HTML tags into the output of your page (if you're
> using the standard formatter) is to get them into cocoon as
> SAX events (XML events).
>
> There are several approaches to solving this, all of them
> require some level of programming, I'm afraid.
>
>  1) Parse the output of the database queries.
>     As far as I know (I could be wrong - Donald?) the SQL
>     Taglib doesn't have a facility to parse XML from the
>     results of a database query (personally, I think this
>     would be a bad thing anyway, but there we go), so
>     you'd have to do it outside the framework of the
>     taglib.
>
>  2) Disable output escaping in the HTML Serializer.
>     A *really* bad idea. Would have the net effect that you
>     couldn't get a '<' or '>' character to appear in the
>     browser (unless you start using '&amp;lt;' in your
>     content documents, which is A Bad Idea).
>
>  3) Write a custom taglib or producer to pull the XML from
>     the database and parse it.
>
> This is one of those weird problems where the best advice I
> can give you really is not to store XML in relational databases
> unless you have a data type mapping set up for it somehow.
>
> --
> Paul Russell                               <paul@luminas.co.uk>
> Technical Director,                   http://www.luminas.co.uk
> Luminas Ltd.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message