
47 Cal.2d 25 (1956)
In re CHARLOTTE F. FLORANCE, on Habeas Corpus.
Crim. No. 5935. 
Supreme Court of California. In Bank.  
Aug. 28, 1956.
 Fraser, Brown & Hewett and Robert W. Fraser for Petitioner.
 Joel E. Ogle, County Counsel (Orange), George F. Holden, Stephen K. Tamura and William Christensen, Assistant County Counsel, for Respondent.
 SHENK, J.
 This is a proceeding in habeas corpus by and on behalf of Charlotte F. Florance, a fourteen year old girl detained in the Orange County Juvenile Hall at Santa Ana. Her detention is alleged to be unlawful for the reasons (1) that on January 31, 1956, she was taken into custody without legal process and questioned in an improper manner; (2) that although she has been detained ever since, the statutory procedure for detaining her has not been followed; (3) that she is not permitted to visit with ministers or other persons nor to consult with her attorney in private, and (4) that even if this court releases her, she will be summarily and unlawfully rearrested.
 On July 11, 1956, an order to show cause was issued, directed to the Superintendent of the Orange County juvenile hall and to the Orange County probation officer. A return was filed on July 20th, raising issues of fact which would ordinarily require a reference. However, in order to obviate the necessity of a reference the attorneys for the petitioner and the respondents joined in a stipulation of facts. This stipulation states that all restrictions on visitation of the petitioner and on private consultation by her with her attorneys have been removed. In addition, the stipulation discloses that when the petitioner was lodged in the juvenile hall the juvenile authorities had probable cause to believe that her home was unfit. Subdivision (d) of section 700 of the Welfare and Institutions Code provides that the jurisdiction of the juvenile court extends to any minor whose home is unfit.
 After the petitioner was taken into custody her mother and one George Andrus were indicted by the grand jury for violating subdivision 1 of section 261 and sections 285 and 288 *27 of the Penal Code and section 702 of the Welfare and Institutions Code. It is stipulated that on the criminal trial which ensued both were found guilty of violating section 288 of the Penal Code and in addition Andrus was found guilty of violating section 702 of the Welfare and Institutions Code.
 Thereafter a hearing on the petition to have the petitioner declared a ward of the juvenile court was held before that court. On July 25, 1956, the juvenile court rendered the following findings and order:
 "Charlotte F. Florance, the person named in the verified petition now on file in this Court, being this day brought before me ... at a special session of said Court as required by law, for a hearing and examination upon the charge of being within the provisions of Section 700, Subdivision D of the Juvenile Court Law ... as set forth in said petition, and a citation having issued requiring the person having custody or control of said person ... to appear, and due service thereof having been made more than twenty- four hours before the time stated therein, and due notice having been given the parents ... of said person ..., and said person and her parents being present, and testimony being taken and it appearing that said person ... [was of] the age of 14 years on the 3rd day of January, 1956, and it appearing that said person comes within ... Section 700 of the Welfare and Institutions Code, Subdivision D, and should be a ward of the Juvenile Court, in that the home of the above-named is an unfit place for her. ..."
 "Now, Therefore, the said Charlotte F. Florance, is adjudged and declared to be a ward of the Juvenile Court, and it is ordered that custody of said minor be taken from her mother, as it is for the welfare of said minor, and vested in the Probation Officer for suitable placement until further order of the Court. ..."
 In addition to the foregoing the juvenile court made further findings of fact which beyond question support the order. It is unnecessary to recite them.
 [1] The order declaring the petitioner to be a ward of the juvenile court is appealable. (Welf. & Inst. Code,  580.) All of the procedural irregularities alleged to have occurred prior to the hearing before the juvenile court can be urged on any appeal that may be taken from the order. The order recites the facts necessary to confer jurisdiction on the juvenile court, and no defect in that jurisdiction otherwise appears on the face of the record. [2] It is the general rule that the *28 writ of habeas corpus will not be granted where, as here, the petitioner has an adequate remedy by appeal. (Ex parte Stephen, 114 Cal. 278 [46 P. 86]; Ex parte Long, 114 Cal. 159 [45 P. 1057]; Ex parte Williams, 87 Cal. 78 [24 P. 602, 25 P. 248]; In re Jones, 34 Cal.App.2d 77 [93 P.2d 185]; In re Tiffany, 49 Cal.App. 44 [192 P. 547]; 24 Cal.Jur.2d, Habeas Corpus,  13.)
 [3] One exception to the foregoing rule is where the petitioner is detained pursuant to an unconstitutional statute. (See In re Bell, 19 Cal.2d 488, 494-495 [122 P.2d 22]; 24 Cal.Jur.2d, Habeas Corpus,  20.) [4a] The petitioner contends that the statutory procedure for declaring a minor a ward of the juvenile court is unconstitutional because no provision is made for notifying the minor of the reason for the proceedings. However, the Juvenile Court Law provides that a petition stating the facts supporting the proceedings must be filed with the juvenile court within 48 hours after the minor is taken into custody (Welf. & Inst. Code,  722, 729, 729.5); that the county probation officer must be notified of the filing of the petition immediately (Welf. & Inst. Code,  725); that the minor's parents must be notified of her detention immediately (Welf. & Inst. Code,  729), and that at least 24 hours before the hearing on the petition the minor's parents must be served with a citation to appear (Welf. & Inst. Code,  726). The probation officer is charged with the duty of representing the interests of the minor. (Welf. & Inst. Code,  640.) That officer is required to submit a written report to the juvenile court stating the reasons why the minor has been brought before that court, and this report is open to inspection by the parties. (Welf. & Inst. Code,  639.) Also, the juvenile court is authorized to "order such further notice of the proceedings to be given as the court may deem proper." (Welf. & Inst. Code,  726.) [5] Juvenile court proceedings are not designed to punish, especially when they concern minors not accused of crime. (In re Daedler, 194 Cal. 320 [228 P. 467]; In re O'Day, 83 Cal.App.2d 339 [189 P.2d 525]; In re Dargo, 81 Cal.App.2d 205 [183 P.2d 282]; In re Jones, supra, 34 Cal.App.2d 77; In re McDermott, 77 Cal.App. 109 [246 P. 89]; Welf. & Inst. Code,  736; 15 Cal.Jur.2d Delinquent Children,  5, p. 634.) The state, represented by the juvenile court and the probation officer, stands in loco parentis to the minor. The primary consideration in proceedings to declare a minor a ward of the juvenile court is the minor's welfare. [4b] The foregoing provisions *29 of the law are for the guidance of the juvenile court and the probation officer, and since notice to the minor's parents of the proposal to have the minor made a ward of the juvenile court is provided for and was here duly given, the constitutional requirement of due process is clearly satisfied.
 The order to show cause is discharged and the petition is denied.
 Gibson, C.J., Carter, J., Traynor, J., Schauer, J., Spence, J., and McComb, J., concurred.
