Hello Dariusz,
the behaviour is certainly a bug.
But apart from that I do not understand your query.
First there is no implicit ino:id attribute in
XQuery formulations.
Thus the formulation would be:
for $b in input()/doc
where tf:getInoId($b/…) = max(tf:getInoId($b/…))
return $b
However that is alway true for each document.
Thus you probably meant the document with the highest inoId:
for $b in input()/bib
let $maxInoId := max( for $c in input()/bib return tf:getInoId($c/…) )
where tf:getInoId($b/…) eq $maxInoId
return $b
Easier is and optimized is:
(
for $b in input()/bib
return $b
sort by (tf:getInoId(…) descending)
)[position() eq 1 ]
Best regards
Walter
#API-Management#Tamino#webMethods