It is admitted that the writ of attachment under which petitioner was arrested and held in custody was regular in form. It was addressed to any sheriff of the State, and was issued by the circuit court of Calhoun county in term time. It recites : *102“It having been made known to the court by competent evidence, that heretofore, viz., on the 30th clay of April, 1896, a subpcena issued out of this court directed to L. B. Pearce, commanding him to appear at the present term of the court, to give evidence in behalf of the defendant in a case pending in this court, wherein Lizzie Hendrix is plaintiff and Southern R’y Co. is defendant, and it appearing to the court by the return of the sheriff on said subpoena indorsed, that the said L. B. Pearce was duly served with a copy of said subpoena, and it further appearing that said L. B Pearce has willfully refused to testify as by said subpoena he was required, and willfully and without good excuse refuses to appear in obedience to said subpoena : You are, therefore, commanded to arrest the said L. B. Pearce and him safely keep so that you may have him before the court on the instanter,” &c.
It can not be denied, that a witness who has been duly subpoenaed by a competent court to give his evidence in a cause therein pending, is guilty of a contempt of court if he refuses or fails to attend without excuse for his delinquency. — 24 Am. & Eng. Encyc. of Law, 171, and authorities, note 2; 3 Ib. 783.
Section 4784 of the Code provides, that “no court, chancellor, or judge, on the return of a writ of habeas corpus has authority to inquire into the regularity or justice-of any order, judgment, decree or process of any court legally constituted, or into the justice or propriety of any commitment for contempt'made by a court, officer or body, according to law, and charged in such commitment.”
In Ex parte John Hardy, 68 Ala. 315, it was said : “It can not be denied, that every court is the exclusive judge of a contempt committed in its presence or against its process, and that the exercise of such power by a court of competent jurisdiction can not be revised on error, nor assailed collaterally by a resort to a writ of habeas corpus. But where there is either a want or excess of jurisdiction in the committing court, a writ of habeas corpus is then the appropriate remedy of the prisoner.” Where the court adjudging the contempt has jurisdiction of the subject matter and the person, there must be a total want, or an excess, of jurisdiction, in order that the writ of habeas corpus may be invoked as an appro*103priate remedy for the release of a prisoner who claims to be illegally restrained of his liberty under such an order. — Ex parte Merlet, 71 Ala. 373; Ex parte Simmons, 62 Ala. 416. The proceeding in such cases is not in its nature appellate but rather original, and the validity of the order or judgment assailed is drawn in question collaterally. "The general principle, then,-prevails, that when a record or process is collaterally assailed, it must be for illegality, not for error or irregularity. * * * If the jurisdiction has not attached, — if the process, or judgment is, therefore, without authority of law, — it is not only irregular but illegal. But if jurisdiction has attached, and there is a departure from, or a neglect to observe the prescribed mode of procedure, the process or judgment is merely irregular. However gross may be the irregularity, the correction of it is not the -function of a writ of habeas corpus prosecuted under the statute.” — Kirby v. The State, 62Ala. 54; Ex parte Hubbard, 65 Ala. 473; Ex parte Brown, 63 Ala. 188; Ex parte McKivett, 55 Ala. 236; Ex parte Burnett, 30 Ala. 461.
In the case before us, the court had jurisdiction of the subject-matter and the person against whom the contempt was adjudged and the attachment issued. The attachment is regular on its face, shows no want or excess of jurisdiction by the court in its issuance. It sets out the facts upon which it was issued, which, it recites were made known to the court “by competent evidence,” and thereupon adjudges that the petitioner “has willfully refused to testify as by said'subpoena he was required, and willfully and without good excuse refuses to appear in obedience to said order,” wherefore he was ordered attached for such disobedience. The judge of the city court of Montgomery very properly refused, on habeas corpus before him, to discharge the petitioner, and left the matter where it belongs ; to the circuit court of Calhoun county.
It is S’-iid, the subpoena was served on Sunday, and that petitioner lived over one hundred miles from the county seat of Calhoun county ; that no affidavit, such as is required by section 2793 of the Code, appears to have been made, authorizing á subpoena in such cases. But all these questions are for the circuit court issuing the attachment, on a return thereof to that court, and *104can not be inquired into on habeas corpus in a collateral proceeding.
Affirmed.