[ZPT] Reason for <script> and <style> exclusion?

Dieter Maurer dieter@handshake.de
Fri, 29 Mar 2002 12:16:46 +0100


Harry Wilkinson writes:
 > On Tuesday 26 March 2002 4:28 pm, Joel Burton wrote:
 > > > I've been wondering something for a while now.... Why is it that
 > > > script and
 > > > style tags are specifically excluded from ZPT rendering?  I
 > > > thought I might
 > > > stumble accross a really good reason for it after getting along
 > > > without it
 > > > for a while using Python scripts, but I haven't yet.
 > > >
 > > > So, what's the exclusion for?
 > > >
 > > > I'd really like to be able to use ZPT to render my dynamically generated
 > > > scripts and styles.
 > >
 > > Harry --
 > >
 > > Can you explain your problem specifically and clearly? I'm rendering script
 > > and style tags in ZPT now; either I'm doing something right or I'm not
 > > understanding where you're stuck.
 > >
 > 
 > Maybe I phrased it badly.  The tags and their contents are not excluded from 
 > the output, but their contents are not processed.  They are skipped because 
 > of this like in TAL/HTMLParser.py :
 > 
 > CDATA_CONTENT_ELEMENTS = ("script", "style")
The HTML spec defines the content of "script" and "style" as
CDATA (= Character Data) content. This means, the content
consists of pure/plain text, no SGML/HTML/XML elements.
It must not be interpreted by SGML applications but literally
given to the application.

Apparently, what ZPT does...


Dieter