CSS Selector Handling
Similar to #10 (closed) Oga should be able to handle CSS selectors for #9 (closed) . These will be built on top of XPath selectors. That is, a given CSS selector will be compiled into its XPath equivalent.
For this the following has to be added:
-
Lexer -
Parser -
XPath compiler -
:root -
:nth-child() -
:nth-last-child() -
:nth-of-type() -
:nth-last-of-type() -
:first-child -
:last-child -
:first-of-type -
:last-of-type -
:only-child -
:only-of-type -
:empty -
:link: specific to web browsers -
:visited: specific to web browsers -
:active: specific to web browsers -
:hover: specific to web browsers -
:focus: specific to web browsers -
:target: specific to web browsers -
:lang(): specific to web browsers, little use outside of them -
:enabled: specific to web browsers -
:disabled: specific to web browsers -
:checked: specific to web browsers -
::first-line: requires querying of specific sections of text nodes, not possible in XPath (or at least very difficult) -
::first-letter: requires querying of specific sections of text nodes, not possible in XPath (or at least very difficult) -
::before: not used for querying, instead intended for modifying documents -
::after: not used for querying, instead intended for modifying documents
-
-
Tests for the generated XPath