cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conal Tuohy <con...@paradise.net.nz>
Subject RE: Templating: experiments with Conal's html-to-xslt transform
Date Fri, 10 Dec 2004 13:34:49 GMT
Bertrand wrote:

> For me, the template author just wants to say "all <table> elements
> must be copied with border=1 added", but he has no idea in
> which order
> the elements will appear in the source, and shouldn't have to care.
>
> Does your for-each syntax allow this? I think it requires declarative
> rules, and if we're careful about how they are defined, they won't be
> too scary and will add a lot of power. I've put my rules in a
> separate
> div on purpose, to make it clear that the template has a
> "linear" part
> and another "rules" section, and that the "rules" section works in a
> different way than the rest.
>
> WDYT?

I like the idea - in fact I had the same idea myself, but without adding a
special "rules" section. I'm not sure I see the point in keeping it in a
special div? I think it's good to allow people to define templates anywhere
in the template file ... that way you can take a "design dummy" page and
simply annotate it with these attributes without having to rearrange it.

Another thing it really should have is a way to declare global parameters,
passed to it from the sitemap. The old stylesheet I posted the other day
automatically declares parameters "id" and "random" because they were common
requirements of our templates, but it would be better to have to declare
them explicitly. e.g. <html template:parameters="foo bar baz">

I've done some work (not yet finished) on a similar transform to jxt, but
without any pattern-matching templates so far (they're not impossible, just
not quite so easy, because jxt doesn't already have pattern-matching
templates).

Cheers

Con


Mime
View raw message