Using upper-case and lower-case xpath functions in selenium IDE

天大地大妈咪最大 提交于 2019-11-26 16:32:48

upper-case() and lower-case() are XPath 2.0 functions. Chances are your platform supports XPath 1.0 only.

Try:

translate('some text','abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')

which is the XPath 1.0 way to do it. Unfortunately, this requires knowledge of the alphabet the text uses. For plain English, the above probably works, but if you expect accented characters, make sure you add them to the list.

Rashmi Pandit

If you are going to need upper case in multiple places in your xslt, you can define variables for the lower case and upper case and then use them in your translate function everywhere. It should make your xslt much cleaner.

Example at XSL/XPATH : No upper-case function in MSXML 4.0 ?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!