The man is on trial accused of attempting to murder his wife as she slept next to their four-year-old granddaughter.