
802 S.W.2d 702 (1991)
James A. COLLINS, Director of the Texas Department of Criminal Justice, Institutional Division, Relator,
v.
The Honorable Joe KEGANS, Judge of the 230th Judicial District Court of Harris County Texas, Respondent.
No. 71166.
Court of Criminal Appeals of Texas, En Banc.
January 30, 1991.
*703 Jim Mattox, Atty. Gen., & Mary F. Keller, Lou McCreary, Michael P. Hodge, Ann Kraatz & William C. Zapalac, Asst. Attys. Gen., Austin, for relator.
Stanley G. Schneider & Judge Joe Kegans, Houston, for respondent.
Tom Moran & Kimberly De La Garza, Houston, for real party in interest.
Robert Huttash, State's Atty., Austin, for the State.
Before the court en banc.

OPINION
McCORMICK, Presiding Judge.
This is an original mandamus proceeding. The Relator is James A. Collins, Director of the Texas Department of Criminal Justice, Institutional Division (hereinafter "DOJ"), and the Respondent is the Honorable Joe Kegans, Judge of the 230th Judicial District Court of Harris County. Relator is seeking a writ of mandamus from this Court compelling Respondent to rescind a judgment and sentence issued in the case styled, "The State of Texas v. Patricia Michelle Manuel," Cause No. 540349, in which Respondent found Manuel guilty of injury to a child and ordered that she be placed in the newly created "Alternative Incarceration Probation" (boot camp program) of the DOJ. We will deny the writ.
On August 2, 1990, during the punishment phase of a criminal trial, Respondent declared Article 42.12, Section 8(a)(2), V.A. C.C.P., unconstitutional. That Article is entitled "Alternative Incarceration Probation" and in relevant part reads:
"Sec. 8. (a) For purposes of this section, the jurisdiction of a court in which a sentence requiring confinement in the Texas Department of Corrections is imposed for conviction of a felony shall continue for 90 days from the date the execution of the sentence actually begins. After the expiration of 75 days but prior to the expiration of 90 days from the date the execution of sentence actually begins, the judge of the court that imposed the sentence may suspend further execution of the sentence imposed and place the defendant on probation under the terms and conditions of this article, if in the opinion of the judge, the defendant would not benefit from further incarceration in a penitentiary.... Probation may be granted under this section only if:
"(1) the defendant is otherwise eligible for probation under this article;
"(2) the defendant is a male 17 years of age or older but younger than 26 years and does not have a physical or mental handicap that precludes strenuous physical activity; and
"(3) the defendant had never before been incarcerated in a penitentiary serving a sentence for a felony.
"(b) On the date the execution of a sentence begins for a defendant placed on probation under this section, the probationer shall begin participation in a program in the Texas Department of Corrections under Article 6203c-9, Revised Statutes."[1]
Thus, by its terms, the boot camp program is limited to male defendants. Respondent, after finding Manuel guilty of injury to a child, but before pronouncing her sentence, declared that the portion of Section (a)(2) relating only to male defendants was unconstitutional in that it violated Article I, Section 3a of the Texas Constitution and the Equal Protection Provision of the Fourteenth Amendment to the United States Constitution.[2] However, instead of finding the statute unconstitutional in its application to all persons and thus incapable of enforcement, Respondent in this case entered *704 Findings of Fact and Conclusions of Law which in part found that despite her sex, Manuel would benefit from the boot camp program. Citing the Severability Clause of the Code of Criminal Procedure, Article 54.01, V.A.C.C.P., as authority for her actions, Respondent severed the words "a male" from the statute and declared the remainder constitutional. Whereupon, under this judicially rectified statute, Respondent sentenced Manuel "to be placed in the S.A.I.P. (Boot Camp) program in the Texas Department of Criminal Justice pursuant to Article 6203(c)-9/Article 42.12, Sec. 8."
On December 6, 1990, Relator filed his application for writ of mandamus to have this Court compel Respondent to withdraw her sentence and the Findings of Fact and Conclusions of Law. He bases his application on two grounds: first, Relator asserts that the trial court's actions violate the Separation of Powers Doctrine under Article II, Section 1 of the Texas Constitution;[3] and-second, he argues that Respondent has "exceeded the bounds of her authority" in that she has issued an order that is "so arbitrary, unreasonable, or based upon so gross and prejudicial an error of law as to establish abuse of discretion."[4] Relator avers that he is without an adequate remedy and that mandamus should lie to correct the trial court's actions. We disagree.
It is observed that Relator is before this Court in his capacity as Director of the DOJ.[5] He seeks to insulate himself from a judgment and sentence that was issued in a case where he was not a party and at a time when no action has been taken to force him to comply with Respondent's orders. Essentially, Relator is seeking to protect himself from possible contempt actions.[6] The general rule is that before this Court will issue a writ of mandamus the relator must demonstrate two things: (1) The act sought to be compelled must be purely ministerial (as opposed to discretionary) in nature, see State ex rel. Eidson v. Edwards, 793 S.W.2d 1, 5 (Tex. Cr.App.1990); State ex rel Thomas v. Banner, 724 S.W.2d 81, 83 (Tex.Cr.App. 1987), and (2) there is no other adequate remedy. See State ex rel. Holmes v. Salinas, 784 S.W.2d 421, 423 (Tex.Cr.App. 1990); Smith v. Flack, 728 S.W.2d 784, 794 (Tex.Cr.App.1987); Johnson v. Fourth Court of Appeals, 700 S.W.2d 916, 917 (Tex. 1985).[7] In the case before us, Relator has failed to show why habeas corpus would be an inadequate remedy if and *705 when Respondent pursues contempt proceedings as a means of enforcing her orders. Indeed, it is axiomatic that mandamus will not issue during the pendency of contempt proceedings and that the validity of a contempt judgment can be attacked "only by way of habeas corpus." Deramus v. Thornton, 160 Tex. 494, 333 S.W.2d 824, 827 (1960); Ex parte Arapis, 157 Tex. 627, 306 S.W.2d 884, 887 (1957); Wagner v. Warnasch, 156 Tex. 334, 295 S.W.2d 890, 893 (1956); The State v. Thurmond, 37 Tex. 340, 341 (1872); Tims v. Tims, 204 S.W.2d 995 (Tex.App.Amarillo, 1947, writ ref'd); Dallas County by Commissioners Court v. Mays, 747 S.W.2d 842, 845 (Tex. App.Dallas) reversed for other reasons sub nom, Mays v. Fifth Court of Appeals, 755 S.W.2d 78 (Tex.1988); Jackson v. Crawford, 727 S.W.2d 628, 631 (Tex.App. Dallas 1987, no writ); Haskett v. Harris 567 S.W.2d 841, 845 (Tex.App.Corpus Christi 1978, no writ); Doss v. Doss, 521 S.W.2d 709, 711 (Tex.App.Houston [14th Dist.] 1975, no writ); Garcia v. Garcia, 469 S.W.2d 920, 921 (Tex.App.San Antonio 1971, no writ); Ex parte Henderson, 300 S.W.2d 189, 190 (Tex.AppBeaumont 1957, no writ). See also Ex parte Williams, 690 S.W.2d 243 n. 1 (Tex.1985).
In Deramus, the Texas Supreme Court refused to mandamus a trial court which had threatened the Relator with contempt actions. The Supreme Court wrote:
"We do have authority to correct the action of a trial judge in the abuse of his discretion, or in violation of his clear duty under the law, where there is no adequate remedy by appeal, and even to direct a trial judge to enter an order of dismissal where that is the only proper judgment that can be rendered on undisputed facts.... Therefore this matter becomes not so much a question of jurisdiction to entertain this application for mandamus, but rather the consideration of long-established policy. Nevertheless, in view of the unbroken line of authorities we are reluctant to depart from a judicial path so well landmarked, especially so since the claimed inadequacy of habeas corpus [ (the stigma of arrest and confinement)] in this instance is one common to all cases where escape is sought from the penalty of a contempt judgment. This in itself, we think, is sufficient to justify our refusal of this application. To do otherwise would completely change the procedure long followed in this State and allow in every case an attack by way of mandamus." 333 S.W.2d at 827.
In the instant case, as in Deramus, habeas corpus provides Relator with an adequate remedy. To grant his application for writ of mandamus in this case would establish precedent allowing any party facing contempt proceedings to mount preliminary attacks in any higher appellate court. As stated by the Supreme Court in Deramus, and applicable to the case at bar, we decline to so "completely change the procedure long followed in this State" to allow such to happen. This is not to say that we cannot use our mandamus powers to compel Respondent to withdraw her orders. In this case, however, where Relator has asserted viable, factual reasons for not being able to comply with Respondent's orders, it should be Respondent to first rule upon the adequacy of these reasons and if possible and desirable on her part, Respondent should be the first to fashion alternative remedies allowing for reasonable time limitations under V.T.C.A., Gov't Code, Section 21.002(g)(2). See generally Ex parte Krupps, 712 S.W.2d 144, 151-152 (Tex.Cr. App.1986) (Onion, P.J., concurring). But as Relator readily acknowledged during oral arguments and we now stress, Respondent possesses the discretion and authority to declare the aggrieved statute unconstitutional and, notwithstanding any statute to the contrary, see V.T.C.A., Gov't Code, Section 21.002(g)(1), she is constitutionally empowered "to issue writs necessary to enforce [her] jurisdiction." Tex.Const. Article V, Section 8.
The application for writ of mandamus is denied.
CLINTON, J., concurs in result.
TEAGUE, J., dissents.
MALONEY, J., not participating.
*706 BAIRD, Judge, concurring.
I join the opinion authored by Presiding Judge McCormick and write only to address one point not fully discussed.
It is well established that before this Court will issue a writ of mandamus, the applicant must demonstrate two things: 1) The act sought to be compelled is purely ministerial in nature, and, 2) there is no other adequate remedy. Collins v. Regans, at 704. In this cause, we denied relief because Relator failed to meet the second prong of the aforementioned test.
If Respondent pursues contempt proceedings as a means of effecting her order, Relator's remedy lies in a petition for writ of habeas corpus. Although this may be an extreme measure, it was not the only alternative previously available to the State. In such a situation, Tex.Code Crim. Proc.Ann. art. 44.01(b) entitled the State to appeal the sentence on the ground that the sentence was illegal. Therefore, the State had a less extreme remedy available to challenge Respondent's declaration that Tex.Code Crim.Proc.Ann. art. 42.12, § 8(a)(2) was unconstitutional. As noted by Presiding Judge McCormick, writing for the majority, "[t]he Harris County District Attorney's Office represented the State at the time of sentencing. The Assistant District Attorney did not object to the trial court's determination that Article 42.12 was unconstitutional and did not appeal the ruling although he or she was clearly entitled to pursue that legal remedy. See Article 44.01(b), V.A.C.C.P." Collins, at 704, n. 5.
Tex.Code Crim.Proc.Ann. art. 44.01 became effective on November 3,1987. Prior to that date this Court held that the State's inability to appeal in a criminal case was sufficient to meet the second prong of the mandamus test. State ex rel. Millsap v. Lozano, 692 S.W.2d 470, 481 (Tex.Cr.App. 1985), and State ex rel. Thomas v. Banner, 724 S.W.2d 81, 83 (Tex.Cr.App.1987). Since the State now has the ability to appeal in some instances, it appears that mandamus will not lie, if, in those instances, the State abandons its right to appeal. The abandonment of an appeal by the prosecuting attorney is an abandonment by the State. State v. Sanchez, 764 S.W.2d 920, 921 (Tex.App. Austin 1989).
I recognize that habeas corpus may be an extreme measure, however, such an action is the only remaining remedy because the State abandoned the better remedy. I am not suggesting or encouraging Relator to disobey Respondent's order. I am merely stating that since there is an adequate remedy now available through habeas corpus, mandamus will not lie. Accordingly, I concur with the majority opinion. Additionally, I feel the most prudent remedy would have been for the State to have challenged Respondent's order by an appeal pursuant to Tex.Code Crim.Proc.Ann. art. 44.01(b).
With these comments, I join the majority opinion.
NOTES
[1]  The Legislature repealed Article 6203c-9 in 1989. Provisions relating to the Alternative Incarceration Program for Probationers are now found in Texas Government Code, Section 498.-052.
[2]  Relator does not challenge this finding. Indeed, during oral arguments Relator indicated that he is presently engaged in a judicial action to have the statute declared unconstitutional in its application to all persons, not just females.
[3]  Relator argues under this point that deletion of the words "a male" from the statute results in a rewriting of the law in an impermissible manner. Relator agrees that an unconstitutional part of a statute may be stricken if the remainder of the statute is complete and not violative of legislative intent. He asserts, however, that a deletion of the statute which acts to broaden its scope as to subject or territory (such as in this case when the deletion acts to include females), violates legislative intent. He relies upon Ex parte Levinson, 160 Tex.Crim. 606, 274 S.W.2d 76 (App.1955). But see Ex parte Tullos, 541 S.W.2d 167 (Tex.Cr.App.1976). Relator concludes that by rewriting the statute contrary to legislative intent, the Respondent has in essence usurped the law-making powers delegated solely to the Legislature. Thus the statute must be declared void in its entirety and is not subject to any saving provision if it is constitutionally infirm.
[4]  Under this point, Relator argues that Respondent's actionsordering Manuel to boot camp are incapable of being carried forward because he has no facilities to house and care for women in the program. He also insists that he cannot create such housing within two months time (the time between the day when he first received notice that Manuel had been sentenced to boot camp and the day of her expected arrival at the DOJ). As such, Relator concludes that Respondent's orders are "arbitrary and unreasonable" and should be set aside. He relies upon Johnson v. Fourth Court of Appeals, 700 S.W.2d 916 (Tex. 1985).
[5]  The Harris County District Attorney's Office represented the State at the time of sentencing. The Assistant District Attorney did not object to the trial court's determination that Article 42.12 was unconstitutional and did not appeal the ruling although he or she was clearly entitled to pursue that legal remedy. See Article 44.01(b), V.A.C.C.P.
[6]  Contempt proceedings may be lurking but there is nothing in the record that we have before us to suggest that "show cause orders" have been issued or are even imminent.
[7]  Some courts add that Relator must also demonstrate a clear right to the relief sought. Johnson v. Fourth Court of Appeals, 700 S.W.2d at 917 and cases cited therein; Green v. Heckler, 742 F.2d 237, 241 (5th Cir. 1984) and cases cited therein.
