-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port css2xpath.js #10
Comments
One consideration that came to me last night was that if using CSS to select, there needs to be a way to select element attributes (something CSS can't intrinsically do), and that there would be a need to select and element based on it's attributes, but also select an attribute of that element. Will give this my consideration when I get to it. |
Eh? CSS has attribute selectors. I'm probably misunderstanding you. |
Yes, CSS has attribute selectors to select an element based upon an attribute, but it cannot select the attribute itself! You can't target the |
Oh, right. |
You don't really need to target an attribute do you? Once you've got the node you can just use getAttribute or setAttribute to work on it. |
Well, there's a need to do it in the CSS for the instance of automatically running a large number of 3rd-party queries through DOMTemplate -- i.e. the translation run in NNF. The translations are provided as a simple array of 'query' > 'string' and have the need to set attributes. The translation logic in NNF simply passes the whole array to DOMTemplate, it doesn't check which points to an attribute and which doesn't; and that would be a bad idea anyway as it would mean running the queries twice, or worse re-implementing parts of DOMTemplate within an NNF function. IMO I should change the CSS attribute selector (without condition), i.e. |
The plan is to support full CSS queries for queries as these are better known, easier for web developers to use and more natural to the content being worked with.
There's a compact JavaScript CSS to XPath converter here https://code.google.com/p/css2xpath/source/browse/trunk/src/css2xpath.js that I can port to PHP.
The text was updated successfully, but these errors were encountered: