xml to xhtml

Stefan Behnel stefan_ml at behnel.de
Fri Apr 3 02:00:07 EDT 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.

http://wiki.python.org/moin/WebProgramming
http://wiki.python.org/moin/WebFrameworks

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:

http://wiki.python.org/moin/WebServers

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:

http://codespeak.net/lxml/

Stefan



More information about the Python-list mailing list