problem getting xpath function ends-with() to work while contains() works fine

Viewed 12044

i am trying to get the tags that have an attribute that end with a certain id.
like <span id="ctl00_ContentPlaceHolder1_Country">
i want to get the spans that have the id ends with 'Country'
i try the following xpath //span[ends-with(@id,'Country')] but i get the following exception
"Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function."

the strange thing is that contains works fine so the following xpath works //span[contains(@id,'Country')]
any ideas why this happens? thanks

3 Answers
Related