Preferred tool for folding XML into HTML

Peter Hansen peter at engcorp.com
Wed Jan 9 22:30:54 EST 2002


Laurent Szyster wrote:
> 
> Peter Hansen wrote:
> >
> > Laurent Szyster wrote:
> > >
> > > By the way, I advise you to pick wathever XSLT engine available
> > > on your platform and pipe the XML into it from Python. An XSLT
> > > engine written in Python is a non-sense. Providing Python binding
> > > to an XSLT library is *The Right Thing* to do.
> >
> > Why ever would you say this?  Surely, except _possibly_ for reasons
> > of performance, there is no logic in the above statement.
> 
> Bbecause I wrote one "XSLT-like" engine with Python ;-)

(I'm not quite sure whether you mean you tried it and the 
result was too slow, or you tried it and failed and concluded
it was too darned hard to do so you're suggestion nobody else
should try to write one... or ? )

[...] 
> Python _is_ slow at instanciation.
> About 10 times slower than Java, 100 times slower than C.
> 
> > And if performance is thought to be the issue, wouldn't one need to
> > have actual minimum performance requirements in mind, and to measure
> > the performance of a Python solution and determine that it is
> > inadequate, before one could say using Python is nonsense?
> 
> As Cameron pointed out, a difference of two orders of magnitude does
> matter, whatever the requirements.

Although I admit I'm shocked to learn it is 100 times slower,
when I would have thought this would be one of Python's more 
responsive areas of application, I do *not* agree with the
casual "whatever the requirements".  

Probably two orders of magnitude really does a number on the 
effectiveness in "most" areas, but there are still quite a few
smallish utility-type uses of XML with XSLT where the processing
requirements are a tiny, tiny part of the overall picture
and having XSLT built in to Python allows you to produce a
much simpler end result, more easily, and more quickly than
if you had to worry about a "cross-platform Python binding"
which, inevitably, is somewhat harder to work with if nothing
else because it's not in the standard library...

> Now that stable, cross-platform Python binding exists for libxslt
> and Xalan

... like those. :)

The reason I firmly believe there are some real and serious
uses for "native" Python XSLT support is because I have a
number of such smallish utilities in use and in mind which 
will benefit from having this in the standard library, and 
which would likely still be acceptable with *three* orders of
magnitude slower performance.  They might use do their
processing once only, on startup, and certainly don't need
to do any kind of bulk processing.

But I'm just shocked it's that much slower...



More information about the Python-list mailing list