[lxml-dev] Targeted XSL transformations
Stefan Behnel
stefan_ml at behnel.de
Thu Jul 16 11:41:04 CEST 2009
Emanuele D'Arrigo wrote:
> 2009/7/16 Stefan Behnel wrote:
>> Emanuele D'Arrigo wrote:
>>> I wish I could leave that to something indeed rather than having to
>>> implement it myself. Unfortunately, although my original post referred to
>>> xhtml, in practice I'm not dealing with a browser nor with xhtml. Instead
>>> I'm attempting to write a GUI system based on Mozilla's XUL.
>>
>> How does that discourage CSS?
>
> It isn't XUL or me working on a GUI system that does. But lxml does not have
> an etree.CSS() function which generates a CSS transformation, does it?
> However, it does have an etree.XSLT() function which generates an xslt
> transformation. Isn't it?
That's what I meant: you don't need that. CSS doesn't do tree
transformations, it only cares about layout and 'visual effects'. The idea
is to build up a document that contains the complete content, and then
associate a CSS file with it that defines where the different parts of the
content appear and how they should look like (colour, fonts, etc.).
You can use XSLT to aggregate the content into a document, but you'd write
up a CSS file manually (or with a suitable CSS editor or whatever) to
define the visual layout of the presentation. Do you have a need to do that
programmatically?
Stefan
More information about the lxml-dev
mailing list