Sorting by inoid

Hello,
I have the following xquery:

declare namespace tf = "http://namespaces.softwareag.com/tamino/TaminoFunction"
for $b in input()/STLBibliographicIbermarc
where tf:getInoId($b) < 10 
return tf:getInoId($b) 
sort by tf:getInoId($b) descending


There appears to have a problem with this code in the sort clause. The behavior I want to achieve is simply to sort the resutset by inoid descending. Can anyone help me?
Thanks in advance,
Julien Martin.

Hello,
you probably mean

sort by (. descending)

Sort by is a separate expression, which is applied on the complete result sequence of the FLWR expression.
Note in the mean time the XQuery draft has changed to the FLWOR expression, where the ordering is integrated into the FLWR.

Best regards
Walter

I still can

Hi Julien,

declare namespace tf = “http://namespaces.softwareag.com/tamino/TaminoFunction
for $b in input()/STLBibliographicIbermarc
return $b
sort by (tf:getInoId(.))

sorts documents by InoId. Walters solution is correct but does
not work, this is a bug.

Regards,
Juliane.