[lxml-dev] Targeted XSL transformations

Emanuele D'Arrigo manu3d at gmail.com
Thu Jul 16 14:10:27 CEST 2009


2009/7/16 Stefan Behnel <stefan_ml at behnel.de>

> What? Why? I thought you used the Mozilla engine for displaying the XUL
> pages?


Ahem. No. I am using the XUL -format- as a description of interfaces. But
I'm implementing my own layout engine in a completely different rendering
framework (Panda3d <http:/www.panda3d.com>). Sorry if this wasn't clear from
my previous messages.

> When I add a composite GUI element to an interface (i.e. a new record in a
> > table) it's easy enough to add it to the tree of objects in the GUI, but
> in
> > terms of style I'd need to find out which style information applies to it
> > given the nature of the added element and its location in the tree. In a
> > sense, rather than selecting the element given a (css) rule, I'd need to
> > select the applicable rules from the element and its position.
>
> And that needs to be decided at runtime? Aren't there any general rules
> like "when element X appears within the panel named Y, give it style Z"?


Not only. Some rules are applicable to an element even though they are
specific to that element. I.e. ".myClass" applies to any element of class
"myClass". And that might not be that difficult to find. But there are some
rules that specify that IF element Y has a child element X you should apply
style Z (to Y, not X). To find those rules sounds a little harder.



> I doubt that you really have requirements that you cannot express
> statically (i.e. in advance) using CSS selectors. If you really need to
> distinguish identical elements depending on some logic in the XSLT driven
> document generation process, just give them different IDs and use those in
> the CSS file.


Yes, true, I might be attempting to cover all cases programmatically when
some sensible use of css/xslt might simplify the implementation.

 What I think you need to understand is the difference between the document
> status of an element (e.g. descendant of Z, child of X, @id="Y",
> @enabled="true") and the visual representation (visible, green, large,
> ...). The mapping between those two is what CSS is designed for. And the
> CSS engine that sits right inside your XUL layout engine will do that
> mapping for you whenever either the document or the style information
> changes.


Except, as I mentioned at the very beginning and is the crux of the
discussion, I do not have a css engine nor a xul layout engine. I am making
those more or less from scratch.

Manu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/lxml-dev/attachments/20090716/bb5e5bbc/attachment-0001.htm 


More information about the lxml-dev mailing list