cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramin Jalali" <ra...@healthnetint.com>
Subject RE: problem of unwanted changing < to &lt; in query result
Date Fri, 30 Jun 2000 17:19:38 GMT
Hi,

Thanks for your advice. Actually I don't have any idea about the custom
taglib or producer to pull the XML the database and parse it. Would you
please give me a hint.

Thanks,

Ramin



-----Original Message-----
From: Kearney, Bryan [mailto:bkearney@solant.com]
Sent: Friday, June 30, 2000 9:54 AM
To: 'cocoon-users@xml.apache.org'
Subject: RE: problem of unwanted changing < to &lt; in query result


we began making se of CDATA blocks when we new that an element would contain
a string which could contain HTML data.

If the data contins html-fragments, we are using xsl:copy-of instead of
xsl:value-of

-- bk


-----Original Message-----
From: Paul Russell [mailto:paul@luminas.co.uk]
Sent: Friday, June 30, 2000 10:29 AM
To: cocoon-users@xml.apache.org
Subject: Re: problem of unwanted changing < to &lt; in query result


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


---------------------------------------------------------------------
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