CssSelectorConverter
in package
CssSelectorConverter is the main entry point of the component and can convert CSS selectors to XPath expressions.
Tags
Table of Contents
Properties
- $cache : mixed
- $htmlCache : mixed
- $translator : mixed
- $xmlCache : mixed
Methods
- __construct() : mixed
- toXPath() : string
- Translates a CSS expression to its XPath equivalent.
Properties
$cache
private
mixed
$cache
$htmlCache
private
static mixed
$htmlCache
= []
$translator
private
mixed
$translator
$xmlCache
private
static mixed
$xmlCache
= []
Methods
__construct()
public
__construct([bool $html = true ]) : mixed
Parameters
- $html : bool = true
-
Whether HTML support should be enabled. Disable it for XML documents
toXPath()
Translates a CSS expression to its XPath equivalent.
public
toXPath(string $cssExpr[, string $prefix = 'descendant-or-self::' ]) : string
Optionally, a prefix can be added to the resulting XPath expression with the $prefix parameter.
Parameters
- $cssExpr : string
- $prefix : string = 'descendant-or-self::'