You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Chris Wilder-Smith <cw...@cast.org> on 2004/06/18 15:41:53 UTC

HTML Generator

I've been using the HTML Generator at the top of a pipeline to
dynamically reprocess some HTML.  It turns out that an interaction
between JTidy and the DOM Streamer used in HTMLGenerator cause some
problems. JTidy treats the content of a <script> element as CDATA (it
doesn't further parse the content) and DOMStreamer then escapes
characters like '<', '&', etc.  The typical comments around javascript
e.g.

<script ...>
  <!--
     function foo() {
       ...
     }
  //-->
</script>

leave you with 

<script ...>
   &lt--
     function foo() {
       ...
     }
  //--&gt;
</script>

This breaks the javascript and causes all sorts of havoc.  It looks like
the two options are either fix JTidy (which seems to have not been
touched for around 4 years) or write a transform to undo the effects of
the interaction.

Has anyone else run into this problem?  Any thoughts will be
appreciated.

Thanks,

Chris

-- 
Chris Wilder-Smith
Principal Technical Architect

mailto:cws@cast.org             http://www.cast.org
CAST: 781-245-2212              
AIM:  ChrisWSAtWork             ICQ: 95325318


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


Re: HTML Generator

Posted by Upayavira <uv...@upaya.co.uk>.
Chris Wilder-Smith wrote:

>I've been using the HTML Generator at the top of a pipeline to
>dynamically reprocess some HTML.  It turns out that an interaction
>between JTidy and the DOM Streamer used in HTMLGenerator cause some
>problems. JTidy treats the content of a <script> element as CDATA (it
>doesn't further parse the content) and DOMStreamer then escapes
>characters like '<', '&', etc.  The typical comments around javascript
>e.g.
>
<snip/>

>This breaks the javascript and causes all sorts of havoc.  It looks like
>the two options are either fix JTidy (which seems to have not been
>touched for around 4 years) or write a transform to undo the effects of
>the interaction.
>  
>
Or, you could try a NekoHTMLGenerator I have written (but hardly 
tested). It uses NekoHTML instead of JTidy to parse the HTML.

No idea how it'll handle your scenario.

If you're interested, email me, and I'll send you what you need.

Upayavira

>Has anyone else run into this problem?  Any thoughts will be
>appreciated.
>  
>



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