In my PHP script, I\'m using XPATH to search nodes for text. Everything works swimmingly -except - when I search for a word with an apostrophe.
basically my code lo
As Google shared with you, you cannot escape an apostrophe in XPath. The simplest workaround is to use a different quote character around the string parts of the query.
$nodes = $xml->xpath('//line[contains(translate(text(),"'.$upper.'","'.$lower.'"),"'.$search.'")]');
Of course, the above is only useful if you don't want to allow double-quotes in the search value. If that might be necessary, then you could move the searching/comparison into PHP-land using the method that Gordon pointed out in your previous question.