This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29361 - Add CSS selectors
Summary: Add CSS selectors
Status: NEW
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Requirements for Future Versions (show other bugs)
Version: Working drafts
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Jim Melton
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-06 20:02 UTC by Benito van der Zander
Modified: 2016-01-06 20:02 UTC (History)
0 users

See Also:


Attachments

Description Benito van der Zander 2016-01-06 20:02:48 UTC
Nowadays CSS selectors are the standard way to query for some HTML elements, because these selectors are much shorter than XPath expressions, e.g. span#color div.red for ( element-with-id("blue")[name() = "span"]//div[tokenize(@class) = "red"] ). The alternative using contains-token ( element-with-id("blue")[name() = "span"]//div[contains-token(@class, "red")]  ) is even longer.

Thus for HTML a function fn:css($selector as string) that evaluates a CSS selector on the descendants of the context item would be more useful, e.g. css("span#color div.red")