Keep It Simple, Stupid | |
PerlMonks |
Re: "combined" HTML *and* CSS parser?by brian_d_foy (Abbot) |
on Apr 12, 2005 at 22:44 UTC ( [id://447201]=note: print w/replies, xml ) | Need Help?? |
Sure it's possible. You have to keep some state to know which things apply to which tags (DIV, SPAN, and so on defining a scope), then looking in your CSS data structure to get the right elements. You just have to apply things like the CSS spec says you should. I'm not sure HTML::Tree will be low-level enough for you to do that, and you can always right your own parser as a sub-class of HTML::Parser if something else doesn't do what you want.
-- brian d foy <brian@stonehenge.com>
In Section
Seekers of Perl Wisdom
|
|