AndrewD, military justice is different from civilian justice. A military trial is different from a civilian trial.
Civilians are judged by the constitution, military members are judged by
The Uniform Code of Military Justice (UCMJ).
Punitive Articles of the UCMJ
Article 106a—Espionage
(a)
“(1) Any person subject to this chapter who, with intent or reason to believe that it is to be used to the injury of the United States or to the advantage of a foreign nation, communicates, delivers, or transmits, or attempts to communicate, deliver, or transmit, to any entity described in paragraph (2), either directly or indirectly, anything described in paragraph (3) shall be punished as a court-martial may direct, except that if the accused is found guilty of an offense that directly concerns (A) nuclear weaponry, military spacecraft or satellites, early warning systems, or other means of defense or retaliation against large scale attack, (B) war plans, (C) communications intelligence or cryptographic information, or (D) any other major weapons system or major element of defense strategy, the accused shall be punished by death or such other punishment as a court-martial may direct.
...
Elements.
(1) Espionage.
(a) That the accused communicated, delivered, or transmitted any document, writing, code book, signal book, sketch, photograph, photographic negative, blueprint, plan, map, model, note, instrument, appliance, or information relating to the national defense;
(b) That this matter was communicated, delivered, or transmitted to any foreign government, or to any faction or party or military or naval force within a foreign country, whether recognized or unrecognized by the United States, or to any representative, officer, agent, employee, subject or citizen thereof, either directly or indirectly; and
(c) That the accused did so with intent or reason to believe that such matter would be used to the injury of the United States or to the advantage of a foreign nation.
(2) Attempted espionage.
(a) That the accused did a certain overt act;
(b) That the act was done with the intent to commit the offense of espionage;
(c) That the act amounted to more than mere preparation; and
(d) That the act apparently tended to bring about the offense of espionage.
MORE
...