Copied!

XPath expression translator interface.

This component is a port of the Python cssselect library, which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.

CloneableInstantiable
Methods
public __construct(?Symfony\Component\CssSelector\Parser\ParserInterface $parser = NULL)
public addAttributeMatching(Symfony\Component\CssSelector\XPath\XPathExpr $xpath, string $operator, string $attribute, ?string $value) : Symfony\Component\CssSelector\XPath\XPathExpr
 
  • throws \ExpressionErrorException
public addCombination(string $combiner, Symfony\Component\CssSelector\Node\NodeInterface $xpath, Symfony\Component\CssSelector\Node\NodeInterface $combinedXpath) : Symfony\Component\CssSelector\XPath\XPathExpr
 
  • throws \ExpressionErrorException
public addFunction(Symfony\Component\CssSelector\XPath\XPathExpr $xpath, Symfony\Component\CssSelector\Node\FunctionNode $function) : Symfony\Component\CssSelector\XPath\XPathExpr
 
  • throws \ExpressionErrorException
public addPseudoClass(Symfony\Component\CssSelector\XPath\XPathExpr $xpath, string $pseudoClass) : Symfony\Component\CssSelector\XPath\XPathExpr
 
  • throws \ExpressionErrorException
public cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::') : string
public getExtension(string $name) : Symfony\Component\CssSelector\XPath\Extension\ExtensionInterface
 
  • throws \ExpressionErrorException
public static getXpathLiteral(string $element) : string
public nodeToXPath(Symfony\Component\CssSelector\Node\NodeInterface $node) : Symfony\Component\CssSelector\XPath\XPathExpr
 
  • throws \ExpressionErrorException
public registerExtension(Symfony\Component\CssSelector\XPath\Extension\ExtensionInterface $extension) : static
 
  • return $this
public registerParserShortcut(Symfony\Component\CssSelector\Parser\ParserInterface $shortcut) : static
 
  • return $this
public selectorToXPath(Symfony\Component\CssSelector\Node\SelectorNode $selector, string $prefix = 'descendant-or-self::') : string
Properties
private array $attributeMatchingTranslators = []
private array $combinationTranslators = []
private array $extensions = []
 
  • var \Extension\ExtensionInterface[]
private array $functionTranslators = []
private Symfony\Component\CssSelector\Parser\ParserInterface $mainParser
private array $nodeTranslators = []
private array $pseudoClassTranslators = []
private array $shortcutParsers = []
 
  • var \ParserInterface[]
Methods
private parseSelectors(string $css) : array
 
  • return \SelectorNode[]
Methods
public static getXpathLiteral(string $element) : string
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration