Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

CSS query improperly converted to xpath #11

Open
GeeH opened this issue Jun 28, 2016 · 1 comment
Open

CSS query improperly converted to xpath #11

GeeH opened this issue Jun 28, 2016 · 1 comment

Comments

@GeeH
Copy link
Contributor

GeeH commented Jun 28, 2016

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.


@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-dom; a new issue has been opened at laminas/laminas-dom#3.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants