I have some XPath code that's working great 99% of the time. But now I have an XML document that contains unescaped characters in it. In this case the string I'm looking for is something like "Maury's bad string".
So how do I construct an XPath query to find this string? I tried escaping:
../a:Data[a:Name='" & NewT.Name.Replace("'", "'") & "'"
But that fails to match the text. So then I tried:
../a:Data[a:Name='" & NewT.Name.Replace("'", "''") & "'"
But that tells me there's an invalid token in the search string.
Anyone know the trick here?