II’m a very naive user of Xquery, who is just at the beginning of learning.
I have plein of problems fwith syntax. I try two explain two of them here.
I’m using the Exist sample database “mondial.xml” :
http://demo.exist-db.org/rest//db/mondial/mondial.xml
When I write the query :
doc/mondial/country/border[@country=“F”]
to know the code of countries bordering France, I get too muvh information
(the entire country elements), while I want juste the country codes.
Of course, I tried to use a FLWOR construction, but, there, I get a message of syntax error that
I cannot even understant.
More generally : how to “point” to values of XML attributes, so as to reriebve just them ?
By the way of the syntax of FLOWR : I managed to get the countrie having more than 60000000 habitants simply by writing :
for $p in doc(“mondial.xml”)/mondial/country let $b:=$p/population where
$b >6000000 return $b.
but it’s a mystery to me why my construction works there and that does not work, for, istance, in my trial to improve the first query.
:evil:
Thanks a lot, and sorry for the naivety of my questions. I’m try to learn by myself.