In this article, we develop two invariance principles for nonlinear discrete-time switched systems based on multiple Lyapunov functions and multiple weak Lyapunov functions, respectively, which allow the first differences of multiple weak Lyapunov functions to be positive on certain sets. It is shown that the solution of the system is attracted to the largest weakly invariant set in a certain specific region. Then, based on the invariance principle developed and geometrical dissipativity, we obtain the generalized output synchronization for discrete-time dynamical networks with nonidentical nodes by an appropriate switching among several communication topologies. Finally, two examples are provided to demonstrate the effectiveness of the main results.