Use CSS selectors to collect HTML elements from a streaming parser (e.g. SAX stream)
How to parse CSS (CSS3) selector and use it (in jQuery-like way) to collect HTML elements not from DOM (from tree structure), but from stream (e.g. SAX), i.e. using sequential access event based parser? By the way, are there any CSS selectors (or their combination) that need access to DOM (Wikipedia SAX page says that XPath selectors "need to be able to access any node at any time in the parsed XML tree")? I am most interested in implementing selector combinators , e.g. 'A B' descendant selector. I prefer solutions describing algorithm, or in Perl (for HTML::Zoom ). I would do it with regular