Edgewall Software

genshi.template.markup

Markup templating engine.

MarkupTemplate

Implementation of the template language for XML-based templates.

>>> tmpl = MarkupTemplate('''<ul xmlns:py="http://genshi.edgewall.org/">
...   <li py:for="item in items">${item}</li>
... </ul>''')
>>> print tmpl.generate(items=[1, 2, 3])
<ul>
  <li>1</li><li>2</li><li>3</li>
</ul>


See Genshi XML Template Language, ApiDocs/0.5.x, Documentation

Last modified 9 years ago Last modified on Dec 7, 2015, 3:34:18 AM