Forum Discussion

jack_edwards's avatar
Occasional Contributor
9 years ago

Using FindChildByXPath with apostrophe in XPath

TC11 Documentation:   Hello,   We have used FindChildByXPath successfully in the past, but are having an issue when the XPath contains an apostro...
  • HKosova's avatar
    9 years ago

    Hi Jack,


    If a value contains apostrophes, you need to wrap it in quotes instead of apostrophes:

    Value = "A Midsummer Night's Dream"
    TempStr = "//*[@title=" & Chr(34) & Value & Chr(34) & "]"
    ' This is the same as TempStr = "//*[@title=""A Midsummer Night's Dream""]"