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 string
getXpathLiteral(string $element)
Parameters
Return Value
string
cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::')
Translates a CSS selector to an XPath expression.
Parameters
string | $cssExpr | |
string | $prefix | |
Return Value
string
selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::')
Translates a parsed selector node to an XPath expression.
Parameters
Return Value
Parameters
Return Value
Parameters
Return Value
Exceptions
Parameters
Return Value
Parameters
Return Value
Exceptions
Parameters
Return Value
Exceptions
Parameters
Return Value
Exceptions
XPathExpr
addPseudoClass(XPathExpr $xpath, string $pseudoClass)
Parameters
Return Value
Exceptions
XPathExpr
addAttributeMatching(XPathExpr $xpath, string $operator, string $attribute, $value)
Parameters
XPathExpr | $xpath | |
string | $operator | |
string | $attribute | |
| $value | |
Return Value
Exceptions