[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: recommended package for xslt processing in python



G'day,

From: "Nicola Larosa" <nico@tekNico.net>
> Hash: SHA1
[...]
> "XSLT is definitely trendy, because it seems *at first* well-suited to
> processing XML documents. [...] If, however, you're quite comfortable with
> Python [...], you may find that it's easier to *forget* about these
> newfangled technologies and use *good old Python code* to do the job. See
> Recipe 12.5 for a very different approach."
>
> "Recipe 12.5: Transforming an XML Document *Using Python*"
>
> I cannot say it better than David: if at all possible, go ahead and
> translate those "stylesheets" to Python, you'll thank yourself later.
> There's lots of options on this side of the hill too: PyXML, 4Suite, and a
> look at this column:

Having gone down the xslt path in a Python program, I kind of agree...

XSLT seems right... but after you battle with it for a while, you find you
haven't made much progress. It seems that XSLT makes easy things easy, and
hard things impossible.

And the syntax drives you totally batty. XML is definitely not a good way to
implement a programming language.

I keep thinking that maybe it's just that I'm not very good at it yet, but
in that case the learning curve is much worse than Python.

The python libs we are using are kinda cool in that you can hook Python
methods into it, but it was a fair amount of grief getting this working; The
xslt libs are in C, calling back to Python. When you get exceptions in your
Python callbacks, you get segfaults etc with bugger all info on what died...
something I'd almost forgotten about.

----------------------------------------------------------------
Donovan Baarda                http://minkirri.apana.org.au/~abo/
----------------------------------------------------------------



Reply to: