class CssSelector
CssSelector is the main entry point of the component and can convert CSS selectors to XPath expressions.
$xpath = CssSelector::toXpath('h1.foo');
This component is a port of the Python cssselector library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect.
static string | toXPath(mixed $cssExpr, string $prefix = 'descendant-or-self::') Translates a CSS expression to its XPath equivalent. | |
static | enableHtmlExtension() Enables the HTML extension. | |
static | disableHtmlExtension() Disables the HTML extension. |
Translates a CSS expression to its XPath equivalent.
Optionally, a prefix can be added to the resulting XPath expression with the $prefix parameter.
Enables the HTML extension.
Disables the HTML extension.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/CssSelector/CssSelector.html