Problems getting result total from cursor

What happens is the following.
Using an Xquery I retrieve a browcursor. Using the following construction:

_browse.AppendFormat("_xquery={0}&_cursor=open&_scroll=no&_sensitive=vague&_position={2}&_quantity={3}&_count=cheap", System.Web.HttpUtility.UrlEncode(cursor.Query), _sort.ToString(), position, cursor.CursorSize);

But I don’t seem to be able to get the total number of documents found. I thought I’d look for a _count property, but that’s not there.

Any help would be greatly appreciated.

Isn’t there a xf:count function that does what you require?

Well, I don’t know about that, but I was looking for an universal solution and found the following…

let $count : = ({_xquery}) return count($count)

where the _xquery is the xquery used for the cursor.

And this works pretty nicely actually.