Ex-soldier in court for attempted murder