Actually I had been eyeballing that query definition in the .xql file and wondering which version of the file needed which one, but the dotted notation of the the name threw me a bit.
I really need to learn plpgsql.
I have just tested the fix and it works.
I will keep testing and feeding back.
Regards
Richard