The blagotube home of Sune Kirkeby. Here are rambling rants and some bits of code.

05. Dec
2003

Template Untwining

I am thinking about reverse-template engines, that is engines for taking templates and their instances and extracting the data that was filled into the templates.

For example if I have the Zope Page Template:

<h1 tal:content='document/title'> Document Title Goes Here</h1>

And this instance of it:

<h1>Rampaging Rucksacks Ravage Rome</h1>

I would like an automated way of extracting document/title, possibly getting this Python data structure:

{ 'document/title': 'Rampaging Rucksacks Ravage Rome', }

Well, I should probably head off to my trusted editor, write a few unittests and see if I can’t hack together something to satisfy them.

This post was written by Sune Kirkeby on 2003-12-05, and claimed to be mostly about rambling.