Is there some kind of CSS multiple selector (comma) in XPath, so I could find fetch, say, //img and //*[@background] elements in one query?
4 Answers
There is an or operator (|) in XPath:
//img|//*[@background]
2 Comments
HiveHicks
Oh, that was easy. Thanks! :)
Muhammad Umer
unlike css comma it'd select either one correct? css comma would select both if possible.
In addition to the "union" operator | which exists in XPath 1.0 and 2.0 there is also the "comma" operator , in XPath 2.0 to form a sequence of items e.g. //img, //*[@background].