Canonical solution of the state labelling problem for SU(n)SO(n) and Littlewood's branching rule. I. General formulation