zend-dom icon indicating copy to clipboard operation
zend-dom copied to clipboard

CSS query improperly converted to xpath

Open GeeH opened this issue 9 years ago • 1 comments

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7470 User: @fcheslack Created On: 2015-04-29T21:02:26Z Updated At: 2015-11-06T21:29:02Z Body In Zend\Dom\Document\Query, CSS selector strings with classes and attributes in the same segment are not properly converted to XPath.

"input.class[name='inputname']"

is converted to

input.classname[@name='inputname']

instead of

input[contains(concat(' ', normalize-space(@class), ' '), ' classname ')][@name='inputname']

This seems to be solved by simply moving the 'Classes' section of Query._tokenize to the top of the function before the "[@" it checks for is replaced into the expression by other steps. I'm not sure if it was placed as the last step for a reason though.


GeeH avatar Jun 28 '16 13:06 GeeH

This repository has been closed and moved to laminas/laminas-dom; a new issue has been opened at https://github.com/laminas/laminas-dom/issues/3.

weierophinney avatar Dec 31 '19 21:12 weierophinney