Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (16 sloc) 656 Bytes

CssSelector Component

CssSelector converts CSS selectors to XPath expressions.

The component only goal is to convert CSS selectors to their XPath equivalents:

use Symfony\Component\CssSelector\CssSelector;

print CssSelector::toXPath('div.item > h4 > a');


This component is a port of the Python lxml library, which is copyright Infrae and distributed under the BSD license.

Current code is a port of

You can run the unit tests with the following command:

$ cd path/to/Symfony/Component/CssSelector/
$ composer.phar install --dev
$ phpunit
Jump to Line
Something went wrong with that request. Please try again.