0

XML file

<Bookstore>
  <Book>
     <title lang = "en" cover = "hard"> HP </title>
     <title lang = "en" cover = "soft"> HM </title>
  <Book>
<Bookstore>

How to get value of the attribute "cover" using the last() predicate? The XPath specification allows "predicates" to be used in XPath statements. For example, the last() predicate will select the last value from a group/list of values.

I tried using /Bookstore/Book/title[last()]/@cover. But I get error that this XPATH cannot parse XPaths which contain XPath predicate last(). Where am I going wrong?

Thanks!

SEgeek
  • 119
  • 2
  • 8

0 Answers0