It happened at that time, when Eli was laid down in his place (now his eyes had begun to grow dim, so that he could not see),
"Where the ark of God was"  (1 Samuel 3:3).  This clause modifies "temple of the Lord" and NOT the place where Eli and Samuel were sleeping. This phrase identifies the location of this episode as Shiloh.  The KJV is superior to the RSV in this passage, because the RSV arranges the clauses in such a manner as to suggest that Samuel was sleeping in the Holy of Holies, which was definitely not true.