xml - XPath to find an element whose attribute contains a text, case-insensitively? -


    <root> // other nodes     <a href="/patternframework/pages/logout.aspx?np=/sites/novatestsite/home.aspx" slick-uniqueid="92">sign out</a>     </root> 

how write xpath returns a tag href contains "logout.aspx"?

for instance

//a[@href[contains[., "logout.aspx"]] 

case-sensitive:

//a[contains(@href,'logout.aspx')]  

case-insensitive xpath 2.0:

//a[contains(lower-case(@href),'logout.aspx')]  

case-insensitive xpath 1.0:

//a[contains(translate(@href, 'abcdefghijklmnopqrstuvwxyz', 'abcdefghijklmnopqrstuvwxyz'),'logout.aspx')]  

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -