Copied!

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

CloneableInstantiable
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 Symfony\Component\CssSelector\XPath\Translator $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 = []
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration