On Thu, Sep 22, 2005 at 09:26:04PM -0500, aaron@...749... wrote:
Bryce Harrington wrote:
What would be involved in making Inkscape able to handle templated SVG? I.e., something like:
[% i = 1 %] [% FOREACH foo IN bar %] <rect x="[% foo.x %]" y="[% foo.y %]" width="100%" height="100%" fill="[% foo.color %]" id="rect[% i %]" /> [% i = i + 1 %] [% END %]
The stuff in the [% %] brackets is Template::Toolkit macro syntax. (Similar to <? in PHP, and so forth in other templating languages.)
TALES is an xml friendly templating language that utilizes attributes and standard document element nodes (like <g /> in our case). Bryce, I'm sure you are familiar with TALES from working with Zope.
Erf, unfortunately yes I am. It's a clever idea - you fold your template syntax directly into your regular syntax tags. Unfortunately, my experience with it in Zope was pretty bad: Debugging it was extremely frustrating, the documentation was wholy inadequate, and the syntax was very verbose. Admittedly, most of these issues are probably due more to its implementation in Zope than to the idea itself, but...
Bryce