The HTML class attribute is a whitespace-separated list. E.g.,
<div class="aaa bbb ccc">
...
</div>
Is there a simple XPath expression that selects all div-s with class aaa (i.e. where the class list contains aaa). I have found a complicated solution (source):
//div[contains(concat(" ", normalize-space(@class), " "), " aaa ")]
Is there a simple solution?
The solution has to work with all major up-to-date browsers, inside Document.evaluate(), which is XPath 1.0, but ultimately I am curious about any solutions in later XPath versions too.
aaa, then simply//div[contains(@class,"aaa")]would do.