[lxml-dev] Targeted XSL transformations
Emanuele D'Arrigo
manu3d at gmail.com
Mon Jul 13 13:35:33 CEST 2009
Hi everybody, newbie here, typing from an unusually sunny UK.
I've been using lxml with great pleasure for a few months now and I'd like
to thank the main authors and the rest of the lxml community for the work
that has gone into it. From my perspective it's a well done API, with many
useful features and it's easy to use.
I was wondering if I could pick this mailing-list's collective brain as my
own seems to be insufficient for the matter at hand.
Let's say I have parsed an xml document, representing xhtml data, into an
ElementTree, and I have applied one or more xsl transformations to add style
information to it.
Now, let's say I want to add a whole subtree with a top-element of class
"sub" to it. The subtree to be added might have been partially styled
already, i.e. because it comes from an xml file that has its own
xml-stylesheet processing instructions. However, some styling can occurr
only in the context of the whole tree, i.e. because the document-wide xsl
transformation file specifically establishes that elements of class "sub"
must have a yellow background. Furthermore, the same, xsl file asserts that
if the document contains an element of class "sub" the document's background
color must be purple rather than blue.
My fundamental question in this context is: how do I avoid re-applying the
xsl transformation to the whole ElementTree and only apply the bits of the
transformation that are necessary, due to the change in the tree?
a Manu typing from a now much more normal, cloudy UK - [sigh]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/lxml-dev/attachments/20090713/f624848b/attachment.htm
More information about the lxml-dev
mailing list