My records on the 35th Alabama Infantry show that there were two Martins who served in Company "D".
First I have a James L. Martin who is listed as a Private. Prisoner of War Records indicate that he was captured at the battle of Nashville, TN 12/16/1864 and transfered to Louisville, KY on 01/04/1865. He was then shipped on to Camp Chase, OH on the same day. He remained at Camp Chase until he was release upon his Oath of Allegiance on 05/13/1865.
Second, I have John Nelson Martin [sometime listed as James N.] who held the rank of Captain. John entered the army as a 2nd Lieutenant and finally promoted to Captain to rank from June of 1863 [courtesy of Alan Pitts]. Other records show a Lt. Martin, first name illegible, who is probably Lt. John Nelson Martin.
Hope this helps.
Doug Anderson