This content has been marked as final. Show 2 replies
I think you'll be just fine changing the order of your two statements. As odie_63 already pointed out, the max population country is probably in another continent.
You might want to try something like this:
declare variable $xmldoc1:= doc("mondial-3.0.xml");
for $a in $xmldoc1/mondial/country[encompassed/@continent ='f0_132']
let $maxpop := max($a/@population)
where $a/@population = $maxpop