The current implementation of the xpath specification in ElementTree does not allow for predicates that may contain both an apostrophe and a quote. Either one or the other is allowed, but escaping (either string escaping using the backslash or html escaping) is not supported. A simple solution would be to implement the xpath concat function for predicates. This would allow the combination of quote types in the predicate. Attached is a proposed patch for this fix.
as explained on the PR, maybe you could add in the documentation. ..versionadded:: 3.7 Support of the XPath concat function but maybe your PR is too late because 3.7 starts to be in the frozen period for the features.
I understand that the feature is likely too late, but I do not want it to get lost. Is there any way to make certain this feature is accepted for the next release? Do I just select the 3.8 version for this issue?
I think (but not sure) that your feature will be included in 3.8 because 3.7 has been frozen today :/ @ned do you think you could integrate this functionality in 3.7 or 3.8 ?
Sorry, I think this qualifies as a new feature and thus needs to go in 3.8. Plus it should get a wider review from those with ET experience. Perhaps @scoder would be willing go take a look.
I can't see why this should be restricted to attribute values and not text content in general. Therefore, I would suggest adding general support for functions, and making this only a special case. Otherwise, this would only solve a very niche problem, and would require pretty much a rewrite in order to extend it into the "obvious" direction.