telcontar has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
let me see if I can explain this in a satisfactory way.
I have been using HTML::Tree to parse HTML documents, and I could use some CSS parser to parse CSS files (or statements). But how do I put them in context- use them together? This will give me two parse trees, but what I'd rather have is a single tree where I can access CSS properties at the level of HTML elements.
For instance, if I have a simple CSS rule, and I get a parse tree out of it, how am I to know which HTML elements it will apply to? This depends on the property (since some properties have no rendering effect on some types of elements), on inheritance, etc.
In short, is there any way to combine some HTML and CSS browsers so that, in the HTML parse tree, one can tell which elements effectively have which CSS properties? (Except for taking apart some browser source code)
Does this make any sense at all?
John
let me see if I can explain this in a satisfactory way.
I have been using HTML::Tree to parse HTML documents, and I could use some CSS parser to parse CSS files (or statements). But how do I put them in context- use them together? This will give me two parse trees, but what I'd rather have is a single tree where I can access CSS properties at the level of HTML elements.
For instance, if I have a simple CSS rule, and I get a parse tree out of it, how am I to know which HTML elements it will apply to? This depends on the property (since some properties have no rendering effect on some types of elements), on inheritance, etc.
In short, is there any way to combine some HTML and CSS browsers so that, in the HTML parse tree, one can tell which elements effectively have which CSS properties? (Except for taking apart some browser source code)
Does this make any sense at all?
John
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: "combined" HTML *and* CSS parser?
by brian_d_foy (Abbot) on Apr 12, 2005 at 22:44 UTC | |
by telcontar (Beadle) on Apr 13, 2005 at 12:17 UTC | |
Re: "combined" HTML *and* CSS parser?
by wfsp (Abbot) on Apr 13, 2005 at 07:10 UTC |
Back to
Seekers of Perl Wisdom