
478 S.W.2d 256 (1972)
Ex parte James B. TURNER.
No. 15914.
Court of Civil Appeals of Texas, Houston (1st Dist.).
March 3, 1972.
James B. Turner, pro se.
BELL, Justice.
This is an original proceeding by which Relator seeks his release from confinement *257 by virtue of a commitment issued by the Juvenile Court of Harris County. Relator was found guilty of contempt of court for failure to deliver two children to the Harris County Welfare Unit and his punishment was fixed at a fine of $500.00 and confinement in the County jail for 30 days.
In November 1971, July Hendrix filed a petition for a writ of habeas corpus seeking to recover custody of Clinton Dean Roberts and Clifford Gene Roberts, twin boys, who had allegedly been given to her by the natural parents so that she might adopt them. Relator allegedly took the children from her and had since refused to return them. The court entered its order, directed to Relator, commanding him to produce the children before the court on December 7, 1971, and to show cause why he held them in custody.
On December 7, Relator did not produce the children. He filed an answer consisting of a general denial, exceptions to the petition asserting its vagueness and that it did not show the petitioner there had any right or standing before the court. An extensive hearing was held and at the end of the hearing the court, on December 8, ordered Relator to deliver said children to the Harris County Child Welfare Unit, to which it awarded custody, within 48 hours but no later than 4 p.m. on December 10. The matter of the welfare of the children being brought in issue the court had jurisdiction to place custody in the Harris County Child Welfare Unit. On December 15 an affidavit was filed charging that Relator had failed and refused to comply with the court's order of December 8, 1971. A show cause order was issued and served and a hearing on the contempt motion was had on January 6, 1972. After the hearing Relator was held in contempt for failure to produce the children before the court on December 7, 1971, in obedience to the writ of habeas corpus previously issued by the court and also for not delivering them in obedience to the order of December 8. Punishment was fixed as above stated.
Upon petition to this court we released Relator on bond pending a hearing.
We reach the conclusion that the court was, under the facts of this case, without jurisdiction to hold Relator in contempt of court for not producing the children before the court on December 7. The petition for writ of habeas corpus is but one way of bringing minor children before the court so the court can determine what is best for the welfare of the children and in whose custody they should be placed. Legate v. Legate, 87 Tex. 248, 28 S.W. 281. The purpose and effect of the writ in the case was to determine who was entitled to custody. The court had jurisdiction to determine this. The fact that the children were nor personally present in court is immaterial. Land v. Landry, 244 S.W. 569 (Tex.Civ.App.Beaumont), n. w. h. The fact of the children being within the State though without the county is immaterial. The court had jurisdiction to determine custody.
We are of the view, however, that the act of not personally producing the children at this stage where the only order was to produce them and to show why Relator held the children in custody and restraint, was at most a constructive contempt. A direct contempt is one taking place within the presence of the court. The court thus knows the facts and needs no evidence. A failure to produce would be contempt if it were within the power of the person to do so, but whether it was in his power requires evidence. The acts alleged to constitute contempt do not take place in the presence of the court. Ex Parte Ratliff, 117 Tex. 325, 3 S.W.2d 406. It being a constructive contempt, the Relator, before he may be declared in contempt and punished, is entitled to be accorded due process. This requires the filing of a sworn complaint stating the facts alleged to constitute contempt. Ex Parte Ratliff, supra; Ex Parte White, 149 Tex. 155, 229 S.W.2d 1002; Ex Parte Hardin, 161 Tex. 567, 344 S.W.2d 152; Ex Parte Hill, 122 *258 Tex. 80, 52 S.W.2d 367. Too, the party must know he is having the hearing, with a view to determining whether he is in contempt, where the contempt is not committed in the presence of the court. Ex Parte Ratliff, supra.
The record reflects the hearing on December 7 was not one to determine whether Relator was in contempt of court. The court did not then purport to hold Relator in contempt but made an order fixing custody. There was never a complaint filed on December 7 charging Relator with contempt of court. No demand was made by the court on December 7 in open court that Relator immediately produce the children which Relator in open court contemptuously refused to do. See Ex Parte Flournoy, 158 Tex. 425, 312 S.W.2d 488. Neither was the writ of habeas corpus in this case one such as was involved in the case of Ex Parte Grimes, 443 S.W. 250 (Tex.Sup.), where the very purpose of the writ was to enforce a final custody judgment in a manner provided by the Code of Criminal Procedure.
We conclude, therefore, that the part of the judgment holding Relator in contempt for not producing the children on December 7 was void.
As previously stated, on December 15 a sworn complaint was filed charging Relator with having refused to comply with the order of December 8. Nowhere is there any allegation about failure to produce the children on December 7. A hearing was held January 6, 1972, to determine whether Relator was in contempt of court. The testimony adduced at that hearing is before us. Also filed with us by Relator is the testimony taken at the habeas corpus hearing. At submission we questioned whether we could consider such statement as it did not appear that any of the previously developed evidence was introduced at the contempt hearing. A careful search of the record fails to reflect that it was introduced. The contempt hearing was a separate proceeding. Ex Parte Ratliff, supra. We have studied the authorities to determine whether the trial court could judicially notice the previous testimony. We find that judicial notice may not be taken of such testimony. Scott v. Clark, 38 S. W.2d 382 (Tex.Civ.App.Austin), n. w. h.; Grayson v. Rodermund, 135 S.W.2d 178 (Tex.Civ.App.Austin), n. w. h.
We have carefully read all of the testimony adduced at the contempt hearing held January 6, 1972. In view of the disposition we make of the case we need not lengthen this opinion by reciting the evidence. We may assume without expressly passing on the matter that the evidence is sufficient to show disobedience to the order of December 8.
We hold, as above stated, that the finding of contempt for not producing the children on December 7 was void because there was a constructive contempt and there was no affidavit charging Relator with contempt for his alleged contemptuous conduct on that day. There was the requisite affidavit charging contempt for violating the order of December 8. The court held one contempt hearing and rendered one judgment finding Relator guilty of two acts of contempt and in the judgment fixed only one penalty for both acts. The court is thus unable to determine what part of the penalty is applicable to each act of contempt.
In a case where more than one act of contempt is charged the proper procedure is for the affidavit to charge the separate acts each of which is alleged to be contemptuous, and the court should make his finding as to each charge and fix separately the punishment assessed for each act. Ex Parte Genecov, 143 Tex. 476, 186 S.W.2d 225. Where one penalty is fixed for more than one act of contempt and it is found the Relator could not be held in contempt for one of the acts, the whole judgment is tainted and is void and a person held under it is illegally restrained of his liberty. We think this is the effect of the following cases: Gompers v. Buck's *259 Stove and Range Co., 221 U.S. 418, 440, 31 S.Ct. 492, 55 L.Ed. 797, 34 L.R.A.,N.S., 874; Carter v. United States, 135 F.2d 858, 864 (U.S.Ct. of App., 5th Cir.); Oates v. United States, 223 F. 1013 (U.S.Ct.of App., 4th Cir.).
Relator is ordered discharged.
