What cascading html template sheet is

2009-01-10

Cascading html template sheet (CHTS) description and specifications early draft

For a description of the purpose and reasons for this to be created check Templates and presentation logic

The language will be similar to css (will have css selectors to select the corresponding html elements), it will allow for full CSS 3 selectors to make it as flexible as the latest version of CSS.

I chose CSS as a base because it does something similar for styles and is a proven working solution. It's also easier for people with prior CSS knowledge to learn to use it faster.

Why not XSLT ? XSLT is more than what we needed, is a full featured language. We don't want to make calculations or some strange things with the xml (html).

we just want to alter the HTML to put some data into it (template). XSLT is overkill for this, because is designed to do much more.

Things that must solve

  1. Set the value of an element (value:$value)
  2. 2 Allow an element to be hidden (visible:true/false;)
  3. Display arrays of data (loops), allow nesting
  4. Allow some small parts to be included, to avoid modifying common parts for all htmls

Predefined properties:

Special constructs

Modifiers:

Share this with the world

Related

Comments

Allain Lalonde

Sounds like your trying to do on the server side what it'd be trivial to do using jQuery on the client side.

It supports css selection, DOM transforms, etc... If you gave it a JSON object for rendering in the view... it'd transform the page any way you wrote it to.

You might want to look into server side JavaScript. If for no other reason than it seems to line up pretty well with what you're thinking.

My 2 cents

Posted on 2009-01-11 21:43:46
potherca

You might want to take a look at TAL (or PHPTAL for the php implementation). From what I gather it comes pretty close to solving most (if not all) of the problems and demands you wrote about in both your posts on CHTS. If it doesn't solve your problem, I'm pretty sure it'll be a nice point of inspiration.

(Although I might be missing some of your points... I've tried to read both your post attentionately, but I feel like I might be too tired right now to really absorb it properly...)

Posted on 2009-02-17 10:15:28
PHP programmer Ukraine

I dislike your idea:

is is not css, people must learn new syntax:
"if:($price > 300 )//conditions"

and if to parse html, then why not xslt? it's at least standartised. And time does not matter here if to use caching.

Posted on 2009-05-22 13:49:37

Make yourself heard

Categories

Subscribe

All Posts

CHTS posts

All Comments

This post comments

© Copyright CodeAssembly

All code is licensed under LGPL, unless otherwise noted