[lxml-dev] Avoiding re-parsing for document loading
Stefan Behnel
stefan_ml at behnel.de
Fri Jan 30 20:32:30 CET 2009
Hi,
Laurence Rowe wrote:
> I have an XSLT that accesses a number of other documents. These other
> documents are also created in lxml. Is there a way to pass them to my
> stylesheet without incurring an additional parse?
This might be a way to do it:
http://codespeak.net/lxml/extensions.html#xslt-extension-elements
That said, you should still do some performance measurements to see if
parsing a document that you return from a custom resolver (called when
encountering the document() function) is really expensive enough to merit a
custom solution. Parsing is an impressively cheap thing in lxml/libxml2.
Stefan
More information about the lxml-dev
mailing list