Projects tagged ‘python’, ‘template’, and ‘xml’


[6 total ]

74 Users
   

Genshi is a Python library that provides an integrated set of components for parsing, generating, and processing HTML, XML or other textual content for output generation on the web. The major feature ... [More] is a template language, which is heavily inspired by Kid [Less]
Created over 3 years ago.

13 Users
   

Cheetah is a Python-powered template engine and code generator. It can be used as a standalone utility or it can be combined with other tools. Web developers are its principle user group, but it has ... [More] many potential uses and is also being used to generate C++ game code, Java, SQL, form emails, and even Python code. [Less]
Created over 3 years ago.

0 Users

A simple template engine, written in Python. Templates hold no logic, with nodes being cloned and repeated according the the data applied. This template was designed as a way to convert JSON to HTML/XML.
Created 12 months ago.

0 Users

csv2xmlgen is a python program to generate XML files based on a template. It has been developed for generating KML files (Google Earth layers) from CSV data, but it can be used to process any kind of ... [More] XML defined with the template. For more details, see wiki section. With the source code, there is a complete example of KML template that was used to generate a Google Earth layer with information the beaches of Galicia released in http://www.recursosmarinos.net (direct link: http://www.recursosmarinos.net/wp-content/uploads/gis/Praias_Galicia.kmz). [Less]
Created 4 months ago.

0 Users

Proton is a simple, "code-less" engine for xml/xhtml templates. Code-less, because it uses 3 types of ID (attribute) in a template file, rather than snippets of code — this moves the complexity out ... [More] of the template and into the application. There are currently implementations available in Python (Py3K) and Java. A simple Proton template looks like this: PAGE TITLE PAGE TITLE LINK ITEM LIST ITEMS And to render this template, you might do something like this: tmp = Templates()['test.xhtml'] tmp.setelement('title', 'An Xhtml Page', '*') tmp.setelement('link', 'This is a link to Google') tmp.setattribute('link', 'href', 'http://www.google.com') tmp.repeat('list-item', 5) for x in range(0, 5): tmp.setelement('list-item', 'test%s' % x, x) print(str(tmp)) [Less]
Created 4 months ago.

0 Users

XSLTemplate is a simple XSLT based templating system that was created in order to use XSLT for WSGI web applications. The goal is to have a simple means of using XSLT for templating as well as provide ... [More] an obvious and simple way of extending template via traditional XSLT extension functions and elements. As it is based on 4Suite, all the 4Suite documentation can be used as a basis for creating extensions. Also, XSLTemplates comes with some basic extensions specific to web applications. Basic UsageTo use XSLTemplates insert the middleware into your WSGI stack. from xsltemplates import TemplateMiddlware app_conf = {'template_directory', 'templates'} app = YourApplication() app = TemplateMiddleware(app_conf, app) Then from within your application you can specify the template you want to use. The result from the output is the source of the transform. from xsltempltes import set_template class MyApp(object): def __call__(self, environ, start_response): # sets the template in the environ dict with the key 'xsltemplate.template' set_template(environ, 'index.xslt') xml = """ hello world""" start_response('200 OK', [('content-type', 'text/html')]) return [xml] The result of the transformation will be the output. ParametersYou can send parameters to the stylesheet as well by adding them to the 'xsltemplate.params' dict in the environment or using the 'set_params' function. For example, from xsltemplates import set_params, set_template def some_wsgi_app(environ, start_response): set_template(environ 'index.xslt') params = {'message' : 'Hello World!'} set_params(environ, params) xml = """ hello world""" start_response('200 OK', [('content-type', 'text/html')]) return [xml] To use the "message" parameter in the stylesheet use the xsltemplates namespace. This latter method is somewhat preferred depending on your usage. [Less]
Created 12 months ago.