[ZPT] Nesting a Tag in CSS
Martijn Pieters
mj@zope.com
Thu, 10 Oct 2002 10:35:17 -0400
On Thu, Oct 10, 2002 at 10:31:17AM +0100, Chris Withers wrote:
> Martijn Pieters wrote:
> > Templates are supposed to be meaningful even when unrendered. This means
> > that a template cannot break the rules of HTML, which state that <style>
> > and <script> tags can *only* contain text content.
>
> Would the following be OK?
>
> <style type="text/css">
> p {
> color: <tal:x replace="request/bodycolor">red</tal:x>;
> }
> </style>
>
> ..since the only tags are in another namespace?
In XHTML yes (kind-of, the spec does say that additional namespace elements
or attributes mean that *strict* conformance is then broken).
In HTML, where namespaces don't exist (and TAL is an anomaly there), no. It
may be that the TAL engine accepts this syntax for HTML documents, but you
will just have to try and find out. ;)
--
Martijn Pieters
| Software Engineer mailto:mj@zope.com
| Zope Corporation http://www.zope.com/
| Creators of Zope http://www.zope.org/
---------------------------------------------