The court before whom any person is brought charged with a public offense must examine the complainant and the witnesses for the prosecution on oath, as soon as may be, in the presence of the defendant, and, after the testimony for the prosecution is heard, the witnesses for the defendant must be sworn and examined.
Ala. Code § 15-11-6 (1975)