Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/vendor/symfony/css-selector/Symfony/Component/CssSelector
Yannick Warnier 382e48ab6d Add static resources and remove tests dir for release 10 years ago
..
Exception Add static resources and remove tests dir for release 10 years ago
Node Add static resources and remove tests dir for release 10 years ago
Parser Add static resources and remove tests dir for release 10 years ago
Tests Add static resources and remove tests dir for release 10 years ago
XPath Add static resources and remove tests dir for release 10 years ago
.gitignore Add static resources and remove tests dir for release 10 years ago
CHANGELOG.md Add static resources and remove tests dir for release 10 years ago
CssSelector.php Add static resources and remove tests dir for release 10 years ago
LICENSE Add static resources and remove tests dir for release 10 years ago
README.md Add static resources and remove tests dir for release 10 years ago
composer.json Add static resources and remove tests dir for release 10 years ago
phpunit.xml.dist Add static resources and remove tests dir for release 10 years ago

README.md

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');

HTML and XML are different

The CssSelector component comes with an HTML extension which is enabled by default. If you need to use this component with XML documents, you have to disable this HTML extension. That's because, HTML tag & attribute names are always lower-cased, but case-sensitive in XML:

// disable `HTML` extension:
CssSelector::disableHtmlExtension();

// re-enable `HTML` extension:
CssSelector::enableHtmlExtension();

When the HTML extension is enabled, tag names are lower-cased, attribute names are lower-cased, the following extra pseudo-classes are supported: checked, link, disabled, enabled, selected, invalid, hover, visited, and the lang() function is also added.

Resources

This component is a port of the Python cssselect library v0.7.1, which is distributed under the BSD license.

You can run the unit tests with the following command:

$ cd path/to/Symfony/Component/CssSelector/
$ composer install
$ phpunit