Which of the following XPath expressions will select the price element in the third book element? A. //book[position() = last()]/price B. //book[@id ='BK3']/price C. //book[position() = 3]/price D. /books/book[position() = 3]/price E. //price[position = last()] F. //book/price[position = 3]
All are correct choices according to the article.
But I feel E and F are not. Reason there is nothing called 'position', it should be 'position()'.
I tried the same on XML spy, it does not yield the correct result even with position().
//price[position() = last()], gives me all 3 prices //book/price[position() = 3], no result was yielded.