CssSelectorConverter

CssSelectorConverter

class CssSelectorConverter

CssSelectorConverter is the main entry point of the component and can convert CSS selectors to XPath expressions.

Methods

__construct(bool $html = true)
string toXPath(string $cssExpr, string $prefix = 'descendant-or-self::')

Translates a CSS expression to its XPath equivalent.

Details

__construct(bool $html = true)

Parameters

bool $html Whether HTML support should be enabled. Disable it for XML documents

string toXPath(string $cssExpr, string $prefix = 'descendant-or-self::')

Translates a CSS expression to its XPath equivalent.

Optionally, a prefix can be added to the resulting XPath expression with the $prefix parameter.

Parameters

string $cssExpr The CSS expression
string $prefix An optional prefix for the XPath expression

Return Value

string

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.3/Symfony/Component/CssSelector/CssSelectorConverter.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部