xml to xhtml

Stefan Behnel stefan_ml at behnel.de
Fri Apr 3 08:00:07 CEST 2009

jud779 at gmail.com wrote:
> On Apr 1, 11:16 am, Joe Riopel <goo... at gmail.com> wrote:
>> On Wed, Apr 1, 2009 at 10:43 AM,  <jud... at gmail.com> wrote:
>>> If anyone can give me some guidance what should be the best way to
>>> generate html/xhtml page using python would be great. I am open to
>>> other options like xsl or anything else that can make things simple.
>> Since you're open to other options, I would take a look at XSLT.
>> http://www.w3schools.com/xsl/
> XSLT sounds good. I have already created temporary XSL and its working
> fine. Still question is how to put up this on web server index.html.
> I am planning to create one index.html and call cgi python which in
> return produces html page from xml/xsl. Does this sounds like a good
> plan??
> Is there any other options than the one i describe above. If, then pls
> help me out.

There are tons of web servers and web frameworks that support Python.


Using CGI is a particularly bad idea, as it is very resource consuming to
start up a new Python interpreter for each request. Most web servers also
support Fast-CGI, which basically keeps the interpreter running. Here are
some other ways to do similar things:


You might also want to read about WSGI, which is the Python standard for
web server interfaces. Most web frameworks support it, so this keeps your
application independent of a particular web server (and testable even
without a web server).

If you want to do XSLT in Python, lxml is a very good choice:



More information about the Python-list mailing list