Kid (templating language)

From Seo Wiki - Search Engine Optimization and Programming Languages

Jump to: navigation, search

Kid is a simple template engine for XML-based vocabularies written in Python. Kid claims to have many of the best features of XSLT, TAL, and PHP, but "with much of the limitations and complexity stamped out".

While kid was heavily hyped by the TurboGears framework it looks like it's more and more replaced by Genshi due to better debugging and basic XPath support as well as better performance.


Python part:

from kid import Template
template = Template(file='mytemplate.kid',
    mylist=['1', '2', '3', '4', '5', '6']
print template.serialize()

Template part:

<html xmlns=""
    <title py:content="title">title goes here</title>
      <li py:for="item in mylist" py:content="item">item goes here</li>

External links

Personal tools

Served in 0.046 secs.