I want to extract the first element form the list $res/Name
. In my solution I obtain all the list and not only the first element, here is what I wrote.
for $res in /Restaurants/Restaurant let $n := count($res/Dish) order by $n descending return ($res/Name)[1]
You can see here the XML and the result: http://www.xpathtester.com/xquery/7992b12910492f493273835e828dc386
Where is the problem?
No comments:
Post a Comment