getCssToXpath() public method

public getCssToXpath ( )
Example #1
0
 public function load(\Transphporm\Config $config)
 {
     $functionSet = $config->getFunctionSet();
     $baseDir = $config->getFilePath();
     $functionSet->addFunction('attr', new \Transphporm\TSSFunction\Attr());
     $functionSet->addFunction('data', new \Transphporm\TSSFunction\Data($config->getElementData(), $functionSet, 'data'));
     $functionSet->addFunction('root', new \Transphporm\TSSFunction\Data($config->getElementData(), $functionSet, 'root'));
     $functionSet->addFunction('key', new \Transphporm\TSSFunction\Data($config->getElementData(), $functionSet, 'key'));
     $functionSet->addFunction('iteration', new \Transphporm\TSSFunction\Data($config->getElementData(), $functionSet, 'iteration'));
     $templateFunction = new \Transphporm\TSSFunction\Template($config->getElementData(), $config->getCssToXpath(), $baseDir);
     $functionSet->addFunction('template', $templateFunction);
     $functionSet->addFunction('json', new \Transphporm\TSSFunction\Json($baseDir));
     // Register HTML formatter here because it uses the template function
     $config->registerFormatter(new \Transphporm\Formatter\HTMLFormatter($templateFunction));
 }
Example #2
0
 public function load(\Transphporm\Config $config)
 {
     $config->registerPseudo(new \Transphporm\Pseudo\Attribute());
     $config->registerPseudo(new \Transphporm\Pseudo\Nth());
     $config->registerPseudo(new \Transphporm\Pseudo\Not($config->getCssToXpath()));
 }