
582 N.W.2d 506 (1998)
Jarmaine ALLEN, Plaintiff,
v.
IOWA DISTRICT COURT FOR POLK COUNTY, Defendant.
No. 97-997.
Supreme Court of Iowa.
July 1, 1998.
*507 James A. Benzoni, Des Moines, for plaintiff.
Thomas J. Miller, Attorney General, Robert P. Ewald, Assistant Attorney General, John Sarcone, County Attorney, and Steve Foritano and Daniel C. Voogt, Assistant County Attorneys, for defendant.
Considered by HARRIS, P.J., and LARSON, CARTER, NEUMAN, and TERNUS, JJ.
PER CURIAM.
The plaintiff challenges the district court's finding of contempt for his refusal to testify without being granted transactional immunity pursuant to Iowa Rule of Criminal Procedure 19(3). Finding the plaintiff was entitled to both use and transactional immunity, we sustain the writ.

I. Background Facts and Proceedings.

The plaintiff, Jarmaine Allen, is one of the defendants charged in the shooting death of Phyllis Davis on April 8, 1996. Allen pleaded guilty to second-degree murder pursuant to a plea agreement with the county attorney's office. After pleading guilty, Allen filed a motion in arrest of judgment seeking to withdraw his plea, alleging the involuntariness of the plea and newly-discovered evidence. The district court overruled the motion, and sentenced Allen to an indeterminate fifty-year term of imprisonment. Allen appealed that judgment and sentence.
Thereafter, the State proceeded with first-degree murder charges against Allen's codefendant, David Flores. The State sought to elicit testimony from Allen, and filed a request for immunity pursuant to Iowa Rule of Criminal Procedure 19(3). In its application, the State requested the court grant Allen only use immunity. Allen objected and filed a resistance arguing rule 19(3) provided transactional immunity. In its order dated February 25, 1997, the court granted Allen use immunity and ordered him to testify regarding the events on April 8, 1996, notwithstanding any fifth amendment right against self-incrimination. See U.S. Const. amend. V. Allen's application for discretionary review was denied. See Iowa R.App. P. 201.
Thereafter, the prosecutors attempted to depose Allen on March 17, 1997. He refused to testify, asserting his fifth amendment right against self-incrimination. The deposition was halted, and a contempt hearing was set for the next day. At the hearing, the court again reaffirmed that Allen was entitled to only use immunity and ordered him to testify. Allen refused. The court then found him in contempt and, after reconsideration, sentenced him to six months in the custody of the department of corrections, consecutive to his fifty-year prison term.
Allen filed a petition for writ of certiorari, which was granted by this court. In this certiorari action, Allen argues the trial court exceeded its jurisdiction or acted illegally in *508 ordering him to testify and in refusing to grant him transactional immunity.[1]

II. Scope and Standard of Review.

Certiorari is an action at law and this court's review is to determine the legality of an action taken by the district court. Zimmermann v. Iowa Dist. Ct., 480 N.W.2d 70, 74 (Iowa 1992). This court will sustain a writ of certiorari if the district court exceeded its jurisdiction or acted illegally. French v. Iowa Dist. Ct., 546 N.W.2d 911, 913 (Iowa 1996). "Illegality exists when the findings on which the court has based its conclusions of law do not have substantial evidentiary support or when the court has not applied the proper rule of law." Whitlock v. Iowa Dist. Ct., 497 N.W.2d 891, 893 (Iowa 1993). If the district court's findings are supported by substantial evidence, those findings are binding upon this court. Zimmermann, 480 N.W.2d at 74. The district court's legal conclusions, however, are not. Id.

III. Transactional and Use Immunity.

Use immunity is a limited form of immunity for the testifying witness. It compels a witness to testify despite his or her rights against self-incrimination, and prohibits the use of the testimony in a subsequent prosecution. State v. Fox, 491 N.W.2d 527, 533 (Iowa 1992). This type of immunity only protects a witness "against the actual use of the compelled testimony and evidence derived directly or indirectly from such testimony." Id. If the testimony or evidence derived therefrom is used in a subsequent prosecution, it is incumbent upon the government to show in any later prosecution an independent source of the immunized testimony. United States v. Harvey, 900 F.2d 1253, 1257 (8th Cir.1990).
In contrast, transactional immunity is essentially full immunity from prosecution. It protects a witness from all later prosecutions related to matters about which the witness testifies. Fox, 491 N.W.2d at 533.
Allen alleges the trial court lacked jurisdiction or authority to order him to testify without granting him transactional immunity. He presents several reasons why he did not testify without the broader immunity. At the time of the order compelling him to testify, he was concerned his testimony could be used by the government if he were successful on his direct appeal; he was a suspect in another murder which allegedly furnished the motive for the shootout which claimed Davis's life; and he was concerned about other charges which could arise from the incident, including a possession of concealed weapons charge allegedly dismissed without prejudice.[2]

IV. The Collateral Bar Rule.

The State argues Allen was required to comply with the order compelling him to testify, regardless of its propriety. It contends Allen's only remedy was to comply with the court's order to testify and then challenge any improper use of that testimony in a subsequent action.
As a general rule, a party cannot attack the validity of a court order which is the basis for the contempt charge on appeal from the judgment of contempt. Hargis v. Fleck, 261 Iowa 1031, 1038, 157 N.W.2d 103, 107 (1968). The party must challenge the order by direct appeal. Id. at 1039, 157 N.W.2d at 108. This court has held that an erroneous, irregular, or improvident order furnishes no grounds for a person to disobey its terms. Iowa Supreme Ct. Bd. of Prof'l Ethics & Conduct v. Hughes, 557 N.W.2d 890, 892-93 (Iowa 1996). "If there is jurisdiction of the parties and legal authority to make an order, the order must be obeyed *509 however erroneous or improvident." In re Marriage of Welsher, 274 N.W.2d 369, 371-72 (Iowa 1979). A person, however, cannot be punished for the violation of a void order. Hughes, 557 N.W.2d at 892. An order is void if it is entered by a court lacking subject matter jurisdiction. Id.
Allen sought immediate appellate review of the February 25 immunity order and the order compelling him to testify by filing an application for discretionary review. Discretionary review was denied, and Allen was left with no recourse but to imperil himself by testifying without the broader immunity, or to violate the order compelling him to testify. Courts have declined to apply the collateral bar rule when there was not an adequate and effective remedy to review the challenged ruling, or where compliance could cause irreparable injury which may not be repaired by appellate vindication. See Maness v. Meyers, 419 U.S. 449, 460-61, 95 S.Ct. 584, 592, 42 L.Ed.2d 574, 584 (1975); United States v. Ryan, 402 U.S. 530, 533-34, 91 S.Ct. 1580, 1582, 29 L.Ed.2d 85, 88-89 (1971); In re Novak, 932 F.2d 1397, 1400-01 (11th Cir. 1991); United States v. Pearce, 792 F.2d 397, 400-02 (3d Cir.1986). We find a similar situation exists here. Therefore, Allen is not prevented from challenging the order compelling him to testify or the immunity order on appeal.

V. Immunity Pursuant to Iowa Rule of Criminal Procedure 19(3).

Iowa Rule of Criminal Procedure 19(3) governs the granting of immunity to witnesses. Rule 19(3)(a)(1) requires the county attorney to file a verified application to obtain immunity for a witness. Rule 19(3)(a) then provides:
(3) Upon consideration of such application the judge shall enter an order granting the witness immunity to prosecution for any crime or public offense concerning which the witness was compelled to give competent and relevant testimony or to produce competent and relevant evidence.
(4) Testimony, documents or evidence which has been given by a witness granted immunity shall not be used against the witness in any trial or proceeding, or subject the witness to any penalty or forfeiture; provided, that such immunity shall not apply to any prosecution or proceeding for a perjury or a contempt of court committed in the course of or during the giving of such testimony.
(Emphasis added.)
Focusing on subsection 3, Allen argues rule 19(3) provides transactional immunity. The State concedes rule 19(3) is ambiguous and that the rule "probably" provides transactional immunity, but argues the district court reasonably interpreted the rule to allow only use immunity. It contends subsection 3, if interpreted to grant transactional immunity, would render the "use" language of subsection 4 meaningless. Additionally, the State argues it is not unreasonable to interpret rule 19(3) as granting a right coextensive with the fifth amendment. See Kastigar v. United States, 406 U.S. 441, 92 S.Ct. 1653, 32 L.Ed.2d 212 (1972).[3]
Rule 19(3) "is of legislative origin and must be interpreted as any other statute." In re Girdler, 357 N.W.2d 595, 597 (Iowa 1984). A statute will be construed in conformity with its dominating general purpose. Id. "The object of statutory interpretation is to discover the true intention of the legislature considering the clearly-stated objects and purposes involved." Id.
We touched on this issue briefly in In re Girdler. In that case, the district court order granting Girdler immunity essentially mirrored the statutory language of subsections 3 and 4. Id. at 596-97. Girdler appealed the order, contending the scope of the immunity granted was insufficient to displace his constitutional right against self-incrimination. Id. at 597. We disagreed, finding the order in fact granted both use immunity and transactional immunity. Id. at 598.
Consistent with our position in Girdler, we conclude rule 19(3) provides both use and *510 transactional immunity. Subsection 3 is directive and requires a court, after consideration of the application, to grant immunity from prosecution for any crime or public offensetransactional immunity. Subsection 4 dictates that the evidence shall not be used against the witness in future trials or proceedings. The use immunity provided by subsection 4 clearly extends beyond criminal prosecutions.
We reject the State's contention that the trial court in this matter was somehow limited to granting only the use immunity requested by the State. The government cannot circumvent the protections mandated by rule 19(3).
This interpretation of the rule does not, contrary to the State's contention, render subsection 4 meaningless. The State believes that if immunity from prosecution is granted there is no need to prohibit the use of the testimony against the witness. This contention ignores the vital differences between use and transactional immunity. While subsection 3 prohibits future prosecution "for any crime or public offense," subsection 4 provides the evidence shall not be used against that witness in "any trial or proceeding, or subject the witness to any penalty or forfeiture." Therefore, without subsection 4, the immunized witness would not be protected from the use of that testimony against him or her in future civil, administrative, or forfeiture actions.
We find Allen was entitled to both use and transactional immunity. Because the district court misapplied rule 19(3), it acted illegally in ordering him to testify without both transactional and use immunity.

VI. Disposition.

Allen was entitled to use and transactional immunity pursuant to the statutory provisions of rule 19(3). The district court's order granting only use immunity is contrary to the dictates of this rule, and should be and is vacated. The resulting contempt finding and punishment were therefore based upon an illegal order.
The case is remanded with directions to the district court to set aside the judgment and sentence entered against Allen for contempt.
WRIT SUSTAINED; CASE REMANDED.
NOTES
[1]  Allen also raises a constitutional vagueness challenge to rule 19. That issue was not raised to the district court, which Allen concedes in his reply brief. Because error was not preserved on this issue, we do not address it. See State v. Webb, 516 N.W.2d 824, 828 (Iowa 1994).
[2]  Submitted with this appeal was Allen's motion to expand the record. We grant the motion, finding much of the information that was presented was conveyed to the district court in Allen's resistance to the State's application for use immunity. We note, however, that while the information provides pertinent factual information relevant to the appeal, it does not impact our decision regarding the interpretation of our immunity statute.
[3]  Neither party challenges whether use or transactional immunity is required under our state constitution.
