Use CSS selectors to collect HTML elements from a streaming parser (e.g. SAX stream)
- by Jakub Narebski
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 parser? Are there CSS selectors 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 inetersted in implementing selector combinators, e.g. 'A B' descendant selector.
I prefer solutions describing algorithm, or in Perl.