|
@@ -20,12 +20,12 @@ discard block |
|
|
block discarded – undo |
|
20
|
20
|
$this->functionSet = $functionSet; |
|
21
|
21
|
|
|
22
|
22
|
$this->translators = [ |
|
23
|
|
- ' ' => function($string) use ($prefix) { return '//' . $prefix . $string; }, |
|
24
|
|
- '' => function($string) use ($prefix) { return '/' . $prefix . $string; }, |
|
25
|
|
- '>' => function($string) use ($prefix) { return '/' . $prefix . $string; }, |
|
26
|
|
- '#' => function($string) { return '[@id=\'' . $string . '\']'; }, |
|
27
|
|
- '.' => function($string) { return '[contains(concat(\' \', normalize-space(@class), \' \'), \' ' . $string . ' \')]'; }, |
|
28
|
|
- '[' => function($string) use ($hash) { return '[' .'php:function(\'\Transphporm\Parser\CssToXpath::processAttr\', \'' . $string . '\', ., "' . $hash . '")' . ']'; }, |
|
|
23
|
+ ' ' => function($string) use ($prefix) { return '//'.$prefix.$string; }, |
|
|
24
|
+ '' => function($string) use ($prefix) { return '/'.$prefix.$string; }, |
|
|
25
|
+ '>' => function($string) use ($prefix) { return '/'.$prefix.$string; }, |
|
|
26
|
+ '#' => function($string) { return '[@id=\''.$string.'\']'; }, |
|
|
27
|
+ '.' => function($string) { return '[contains(concat(\' \', normalize-space(@class), \' \'), \' '.$string.' \')]'; }, |
|
|
28
|
+ '[' => function($string) use ($hash) { return '['.'php:function(\'\Transphporm\Parser\CssToXpath::processAttr\', \''.$string.'\', ., "'.$hash.'")'.']'; }, |
|
29
|
29
|
']' => function() { return ''; } |
|
30
|
30
|
]; |
|
31
|
31
|
} |
|
@@ -85,7 +85,7 @@ discard block |
|
|
block discarded – undo |
|
85
|
85
|
} |
|
86
|
86
|
|
|
87
|
87
|
public function getXpath($css) { |
|
88
|
|
- $this->css = str_replace([' >', '> '],['>', '>'], trim($css)); |
|
|
88
|
+ $this->css = str_replace([' >', '> '], ['>', '>'], trim($css)); |
|
89
|
89
|
$css = explode(':', $this->css)[0]; |
|
90
|
90
|
$selectors = $this->split($css); |
|
91
|
91
|
$xpath = '/'; |