Re: How to select for ' in XPATH?
My real problem seems to be that I need a XPATH 1.0 solution since I want to do this in a browser environment, right?
Any hint what can be done to make this work? (I have no control over the webpage nor control over user selection)
XPath 1.0 has no escape mechanism for string literals. Unless you can use variables (and I don't know of a way with document.evaluate to do that) you are left with breaking up the string into components that contain no single quote and components that contain a single quote and then concatenate them e.g. if the selection on the page is e.g.
"//*[contains(., concat('What', \"'\", ' that?')"
Martin Honnen http://msmvps.com/blogs/martin_honnen/
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format