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
static string
getXpathLiteral(string $element)
No description
string
cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::')
Translates a CSS selector to an XPath expression.
string
selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::')
Translates a parsed selector node to an XPath expression.
getExtension(string $name)
No description
addAttributeMatching(XPathExpr $xpath, string $operator, string $attribute, string $value)
No description
Details
at line line 76
__construct(ParserInterface $parser = null)
Constructor.
at line line 94
static string
getXpathLiteral(string $element)
at line line 123
string
cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::')
Translates a CSS selector to an XPath expression.
at line line 142
string
selectorToXPath(SelectorNode $selector, string $prefix = 'descendant-or-self::')
Translates a parsed selector node to an XPath expression.
at line line 154
Translator
registerExtension(ExtensionInterface $extension)
Registers an extension.
at line line 174
ExtensionInterface
getExtension(string $name)
at line line 190
Translator
registerParserShortcut(ParserInterface $shortcut)
Registers a shortcut parser.