Xpath

Mar 14, 2013 at 10:53 AM
Hi ,

Can any one suggest how can i write the xpath for the following .


1) if i want <span> tag to have either the text or the <br> tag within it

I tried this
_ htmldoc.DocumentNode.SelectNodes("not[//span//br]")_ but din't worked.


2)<a> tag can either have <span> or <img> as its child node ,
Mar 18, 2013 at 6:00 PM
1) //span[text() or br]
2) //a[span or img]
this works for immediate children of <span> or <a>. For children at any level try
1) //span[.//text() or .//br]
2) //a[.//span or .//img]