hi,
guess I did not make myself clear either ;)
I think the code in style.py does something to get to what you want.
It does generate a CSSStyleDeclaration for each element defined in the
sheet and present in the document which should contain the "generated
styles". Please try to check the code again. It is a bit convoluted
but should be clear enough.
Check the method ``getView(document, css)`` which takes a document
(here an etree.HTML object) and a stylesheet (a CSS string) and
returns a "view" containing: a dict of {DOMElement:
css.CSSStyleDeclaration} so for each DOMElement in document the
defined CSS. Or actually only for the DOMElement selected in the CSS.
I fear the referred code is the nearest of what you want (if I
understand it right): A real query functionality of a sheet applied on
an (HTML) document?
best regards
Christof
> distributionhttp://
code.google.com/p/cssutils/source/browse/trunk/examples/style.py