On Tue, 19 Jun 2001, Ian Brayshaw wrote:

> I am finding XSLT & XML to be a good alternative to normal templating
> techniques. One of the biggest benifits I've found is being able to generate
> the one data set and have it rendered in different ways for different
> applications. I presume this is possible in TT2.

Have a look at http://london.pm.org/~mark/ttxpath/

(from last technical meeting)

Leo's been playing around with this a bit more since the last technical
meeting and I've been talking over him how it's possible to switch views
and have different output

The concept is you have a template that defines what 'bits' of the xml you
want which you pull out with xpath.  You then 'tell' TT to render these
with the view ('output system of choice') which goes through the xml and
converts it into whatever output you feel like recursivly like.

Note that this example has too much code in the template view that
really should be squirrled away/converted into perl (/me hides) but
you get the idea...



s''  Mark Fowler                                     London.pm   Bath.pm
     http://www.twoshortplanks.com/              [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}

Reply via email to