Copied!

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

Cloneable Instantiable
Methods
public __construct ( bool $html = true )
 
  • param bool $html Whether HTML support should be enabled. Disable it for XML documents
public toXPath ( string $cssExpr , string $prefix = 'descendant-or-self::' ) : string
 

Translates a CSS expression to its XPath equivalent.

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

Properties
private array $cache
private static array $htmlCache = [ 'descendant-or-self::' => [ '.language-PHP' => 'descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' language-PHP ')]' ] ]
private $translator
private static array $xmlCache
Properties
private static array $htmlCache = [ 'descendant-or-self::' => [ '.language-PHP' => 'descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' language-PHP ')]' ] ]
private static array $xmlCache
© 2022 Bruce Wells
Search Namespaces \ Classes
Configuration