Translator
class Translator implements TranslatorInterface
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.
Methods
Details
Parameters
static
getXpathLiteral(string $element)
Parameters
cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::')
Translates a CSS selector to an XPath expression.
Parameters
string | $cssExpr | |
string | $prefix | |
selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::')
Translates a parsed selector node to an XPath expression.
Parameters
SelectorNode | $selector | |
string | $prefix | |
Parameters
getExtension(string $name)
Parameters
Exceptions
registerParserShortcut(ParserInterface $shortcut)
Parameters
Parameters
Exceptions
addCombination(string $combiner, NodeInterface $xpath, NodeInterface $combinedXpath)
Parameters
Exceptions
Parameters
Exceptions
addPseudoClass(XPathExpr $xpath, string $pseudoClass)
Parameters
Exceptions
addAttributeMatching(XPathExpr $xpath, string $operator, string $attribute, $value)
Parameters
XPathExpr | $xpath | |
string | $operator | |
string | $attribute | |
| $value | |
Exceptions