I want to get the maximum value for an attribute. I have the following statement:
let $posts := doc("Posts.xml")/posts/row[./@OwnerUserId = $user/@Id]
let $maxScore := fn:max(xs:integer($posts/row/@Score))
When I want to return maxScore, it shows up as an empty value. Upon further tinkering, the following:
Return $posts/row/@Score
Also shows up as empty, even though I know each row has a 'Score' attribute
I've been fighting with this for over an hour, any help is appreciated