which Python XSLT module?
aleax at aleax.it
Thu Feb 6 01:11:58 CET 2003
Will Stuyvesant wrote:
> learn this .xsl thing but I should be able to do that. But maybe XSLT
> is not good at all? I am really new to all this.
It's a weird language to learn, but I surmise it must be OK once
you've learned it thoroughly (I haven't, yet)/
> Other approaches I did see were SAX and DOM and I know as much about
> them as any newbie. It is my understanding that we should use SAX
> since our input XML docs are huge, and DOM builds the syntaxtree
> completely in memory, where SAX is some kind of event driven class
> method calling system.
> Any recommendations?
For some XML "transcriptions" that just couldn't use SAX (too many
reorderings needed) and were bog-slow with minidom and even pulldom
(far too much virtual memory), I ended up using Reportlab's pyRXP
(and contributing some small mods to it so the trees it build in memory
are mutable) and loved it. Yes, it builds everything in memory, but
with very low overhead and fast like greased lightning. I'd feel safe
(on a cheap 512 MB machine, like, say, my laptop) using pyRXP to
slurp/modify/rewrite XML files of up to, say, 400 MB or so. If your
files are many GB and you can't afford to tie up a machine with enough
RAM, then you can't afford the luxury of having everything in memory
(which does make for the easiest editing), alas.
More information about the Python-list