What is the expected output? What do you see instead?
As per the jQuery example, http://api.jquery.com/contains-selector, the word 'John' should be underlined. Instead I'm getting a NS_ERROR_DOM_INVALID_EXPRESSION_ERR exception
What version of the product are you using? On what operating system?
GwtQuery 1.0 with GWT 2.3
Please provide any additional information below.
Browser tested in ; Firefox 4.
The reason seems to be using quotes inside the contains function. With quotes, the equivalent XPath that the selection engine was using in SelectorEngineCssToXPath::select() was:
//div[@class='comment'] and (contains(string(.),''John''))]
which is not valid XPath syntax due to the quotes doubled up around John.
Removing the quotes such that my selector is now similar to:
gives an XPath of //div[@class='comment'] and (contains(string(.),'John'))]
which works
If no quotes is the right way to use gwtQuery contains(), then that's different to what jQuery's contains() selector expects. (http://api.jquery.com/contains-selector/)
Original author: dewi.jo...@gmail.com (July 06, 2011 11:07:38)
What steps will reproduce the problem?
What is the expected output? What do you see instead? As per the jQuery example, http://api.jquery.com/contains-selector, the word 'John' should be underlined. Instead I'm getting a NS_ERROR_DOM_INVALID_EXPRESSION_ERR exception
What version of the product are you using? On what operating system? GwtQuery 1.0 with GWT 2.3
Please provide any additional information below. Browser tested in ; Firefox 4.
The reason seems to be using quotes inside the contains function. With quotes, the equivalent XPath that the selection engine was using in SelectorEngineCssToXPath::select() was:
//div[@class='comment'] and (contains(string(.),''John''))]
which is not valid XPath syntax due to the quotes doubled up around John.
Removing the quotes such that my selector is now similar to:
$("div[@class='comment']:contains(John)").css("text-decoration", "underline");
gives an XPath of //div[@class='comment'] and (contains(string(.),'John'))]
which works
If no quotes is the right way to use gwtQuery contains(), then that's different to what jQuery's contains() selector expects. (http://api.jquery.com/contains-selector/)
Original issue: http://code.google.com/p/gwtquery/issues/detail?id=89