A Swindon man has been charged with attempted murder after an alleged attack inside a prison.