Popular recipes by Mario Ruggier http://code.activestate.com/recipes/users/110641/2002-11-18T15:01:35-08:00ActiveState Code RecipesXYAPTU: Lightweight XML/HTML Document Template Engine for Python (Python)
2002-11-18T15:01:35-08:00Mario Ruggierhttp://code.activestate.com/recipes/users/110641/http://code.activestate.com/recipes/162292-xyaptu-lightweight-xmlhtml-document-template-engin/
<p style="color: grey">
Python
recipe 162292
by <a href="/recipes/users/110641/">Mario Ruggier</a>
(<a href="/recipes/tags/xml/">xml</a>).
Revision 3.
</p>
<p>Xyaptu builts on Alex Martelli's generic and elegant module, YAPTU (Yet Another Python Template Utility), to instantiate XML/HTML document templates that include python code for presentational purposes. The goal is _not_ to be able to embed program logic in a document template. This is counter productive if a separation of content and logic is desired. The goal _is_ to be able to prepare arbitrarily complex presentation templates, while offering a simple and open-ended means to hook in application data. A page template may therefore contain anything that targeted clients will accept, with the addition of five XML tags and one 'pcdata' expression token, as mark-up for the python code that defines the coupling between the presentation to the application data.</p>