In the RESTXQ documentation there is this example which works fine :
declare %rest:path("cities") %output:method("json") %output:json("format=jsonml") function page:cities() { element cities { db:open('factbook')//city/name } };
If I have the same factbook db but with name as attribute and not as element, with the only change in the code the xquery request db:open('factbook')//city/@name I will have the error message: [XQDY0025] Duplicate attribute 'name'.
That's ok, but what is the right way in xquery to easily use multiple attributes as return value of request.
Is the right way to prefer elements to attributes ?
Cheers
Florent