max(..) returns NaN

Hello,

I’ve got the following problem: the max() function returns a NaN value.

An example of the query:
max(message_dictionary[message_type=1]/message_key)

I’ve checked and doublechecked:
* the message_dictionary exists and has the fields message_type and message_key
* message_type and message_key are needed: minOccurs & maxOccurs is 1 in the schema
* message_type and message_key are both of type xs:integer

Any idea what i should check? For example a query with message=type=0 works, so i guess it’s a problem with some values. What do i have to change in my schema so only values are allowed which work with the max function?

Thanks in advance,
Dries

Sorry if it’s an obvious question, but what does

count(message_dictionary[message_type=1]/message_key)

return?

Michael Kay