cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Bagby <>
Subject Need "disable-output-escaping" or alternative
Date Tue, 24 Apr 2001 18:48:52 GMT
>From the Cocoon FAQ:

Why doesn't disable-output-escaping="yes" work?

This is similar to the above - we believe this is bad programming practice.
It's like using GOTOs. There are usually other ways to do what you want to
do - though you may have to spend some time getting your head round them.
Ask on  <>,
specifying exactly what you want to do - we can't help you if you only say
"disable-output-escaping doesn't work".   

While I completely understand the reason why it wasn't implemented in
Cocoon, I have a situation where I think "disable-output-escaping" is
necessary.  Here's the scenario:

I am using an HTTP request to get an XML fragment, which consists of data
from a database, using a custom logicsheet tag which is similar to
<util:get-url-contents>.  I have control over the format of the data, but
not the data itself.  Let me illustrate this with an example:

Suppose #CITY#, #STATE# and #COMMENTS# represent three data fields.  I can
create a template like this:


and the appropriate values will be filled in at request time.  The problem
is that #COMMENTS# may have embedded HTML (which may or may not be
well-formed, but for the sake of this example let's make the assumption that
it is), and other characters which should be escaped such as &, <, >, etc.
Here's an example:

Looking for SWF > 40, tall & althletic.  Must be <b>non-smoker</b>.  E-mail
me <a href="">here</a>.

Because of the > and &, I MUST put it in a CDATA block:


But when I do this, the embedded HTML code also gets escaped, so that it
shows up in the browser as HTML code, which is not what I want.  Seems to me
that "disable-output-escaping" would do the trick.  Of course, this means
that the > and & in the above example would be literal > and &, NOT
character entities &gt; and &amp;, in the HTML output, which is generally
bad form, but most browsers will render it as intended anyway, so I can live
with it.

In conclusion:
1. Is there another way to get around this without
2. If not, how could I implement it?  
3. Where can I find the Xalan source that Cocoon uses?
4. What are the ramifications of re-building Cocoon with a modified Xalan?
4. Would I be better off using Saxon?

Oh, I'm using Cocoon 1.8.2 & Weblogic 5.1.0.  PLEASE ask if you need furthur



Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message