XML/XSLT with Python

Uche Ogbuji uche at ogbuji.net
Sat Sep 27 22:18:25 CEST 2003


"K. N." <vald at valis.amber.eu.org> wrote in message news:<mailman.1064090130.16541.python-list at python.org>...
> Is there any good and fast Python module for XSLT
> processing ? I'm going to use XML and XSLT to generate
> web pages, so I need XSLT processor that will be able
> to transform for example a DOM object in memory - I 
> don't want to create XML file containing data and then
> load it and transform with XSLT, but I want to do 
> this at once - without writing to a temporary file. 
> Actually I've seen alot articles about parsing XML, 
> but nothing about creating XML documents and storing
> it as an object that will be passed to XSLT processor,
> and that is what I'm planning to do.
> I think its a quite good solution, but I have no idea
> which modules will be most suitable for this task.
> Does anyone have some experience in this matter and 
> could point me where should I look ?

4XSLT (http://4suite.org) will do what you seek.  In most situatons it
is not as fast as libxslt, which is, after all, written entirely in C,
but it does have its advantages, including a very rich Python API (in
my biased opinion the richest Python API of all the choices).  It is
certainly fast enough for most purposes.  You can use the cDomlette
mutation API to generate your document in memory and then pass it to a
pocessor instance.

I want to mention that Dr. Korb mentioned having problems with 4Suite
and Pyana, but in private conversation admits this was over a year
ago, i.e. eons in the life of an actively maintained project such as
4Suite.  Much has changed since then.

If you decide to give it a try, start with:

http://uche.ogbuji.net/akara/nodes/2003-01-01/basic-xslt
http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/domlettes

See also:

http://www.xml.com/pub/a/2002/10/16/py-xml.html
http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/basic-xpath
http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/xslt-ext-elems
http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/xslt-ext-funcs
http://uche.ogbuji.net/tech/akara/nodes/2003-03-07/xslt-ext-api


-- 
Uche Ogbuji
http://uche.ogbuji.net




More information about the Python-list mailing list