An appellate court has upheld a prison sentence for a man who attacked a 74-year-old taxi driver shortly after being released from detention.