Valency of Ce and Pr in LRu4P12 (L = Ce and Pr) was studied by L2,3-edge x-ray absorption near-edge structure (XANES) spectroscopy. The Ce-L3 XANES spectrum suggests that Ce is mainly trivalent, but the 4f state strongly hybridizes with ligand orbitals. The band gap of CeRu4P12 seems to be formed by strong hybridization of 4f electrons. Pr-L2 XANES spectra indicate that Pr exists in trivalent state over a wide range in temperature, 20 < T < 300 K. We find that the metal-insulator (MI) transition at TMI = 60 K in PrRu4P12 does not originate from Pr valence fluctuation.