[ZPT] Stylesheet Language

Evan Simpson evan@4-am.com
Mon, 13 May 2002 11:18:34 -0500


Casey Duncan wrote:
> A nice capability this lends you is the ability to affect structure by tag or 
> tag structure alone. For instance, you could strip all font tags (or change 
> them to spans), replace all image tags based on their src values, etc.

Yep.  This is the kind of capability I've been wanting for quite a 
while, but until I read your original proposal, the closest I could come 
was writing some kind of awful DOM-walking script.  CSS selectors don't 
give you everything, but they give you a lot! :-)

> So, [name] means: set the tag attribute "name" right? What is $1? did you mean 
> $i?

Yes, on both counts.  The attribute assigment syntax is inspired by 
CSS2's attribute selection syntax.

> I was thinking along these lines. It should be possilbe to use linked style 
> sheets with html templates as well. I can see having a global style sheet 
> containing things useful site-wide, a more local style sheet, useful for a 
> given functional area. And then an inline style sheet used only by a single 
> template.
> 
> They would cascade just like CSS does, so that local rules could augment or 
> replace more global ones.

Indeed.  A single <?xml-stylesheet type="text/tssl" 
path="here/site.tssl"?> in each template would allow us the same kind of 
flexibility as standard_html_header, assuming that site.tssl can @import 
other stylesheets, or be implemented easily as a Script.

> I'm pretty excited about this as a general concept. I think it really could 
> transcend traditional notions about templating. Thanks for running with it.

Thanks for the idea!

Cheers,

Evan @ 4-am