
170 Cal.App.2d 54 (1959)
HERBERT ALEXANDER, Petitioner,
v.
SUPERIOR COURT OF LOS ANGELES COUNTY, Respondent; LEWIS JONES, Real Party in Interest.
Civ. No. 23788. 
California Court of Appeals. Second Dist., Div. One.  
Apr. 30, 1959.
 Goodman & Hirschberg and Barrie M. Karen for Petitioner.
 Harold W. Kennedy, County Counsel, and William E. Lamoreaux, Assistant County Counsel, for Respondent.
 Leo S. Rich for Real Party in Interest.
 NOURSE, J. pro. tem.  [fn. *]
 By his petition filed herein Herbert Alexander seeks a writ of prohibition to restrain the superior court from taking further proceedings under or upon a cross-complaint filed against him by the real party in interest Lewis Jones.
 There is no dispute as to the facts; they are: One Ruth Jones filed a complaint in the respondent court on her own behalf and on behalf of Yvonne Angela Alexander Jones, a minor, naming the real party in interest Lewis Jones as defendant. In this complaint she alleged that she was the mother of Yvonne and that Jones was her father. She prayed that the court declare that Yvonne was the child of herself and Jones and that Jones be ordered to support Yvonne. She further prayed for attorney's fees and for custody of the minor child. Jones answered this complaint denying that he was the father of the child and for want of information and belief denied that the plaintiff Ruth was the mother of the child. *56 At the time of answering he also filed a cross-complaint naming as the sole cross-defendant petitioner here. By his cross-complaint he alleged that Ruth was the mother of the child and that the cross-defendant petitioner here was the father of the child and prayed that the court determine that the cross-defendant was the father and that the court make appropriate order compelling the cross- defendant to support the minor. To this cross-complaint the petitioner filed a general demurrer. Upon its being overruled he filed an answer denying the allegations of the cross-complaint as to his paternity.
 The trial court will, unless restrained, proceed to the trial of the issues tendered by the cross-complaint and the answer.
 [1a] We have concluded that the trial court would be acting in excess of its jurisdiction in attempting to try said issues. The complaint of Ruth, insofar as it sought on behalf of the minor to have the existence of the relationship between the minor and Jones declared was based upon section 231 of the Civil Code and insofar as it sought a judgment compelling him to support Yvonne it was based on section 196a of the Civil Code.
 Section 231 only authorizes an action to be maintained to declare a relationship between the parties to the action and an action brought under section 196a may only be maintained on behalf of an illegitimate child by its mother or guardian or guardian ad litem appointed upon the application of or with the consent of its mother. These sections undoubtedly give the superior court jurisdiction of the causes of action created thereby but the court may only exercise that jurisdiction when its jurisdiction is invoked by a party authorized to maintain the action.
 [2] A cross-complaint constitutes an assertion of an alleged distinct and independent cause of action and when one is properly interposed there are two simultaneous actions pending in the latter of which the defendant in the original action becomes a plaintiff who must by his cross- complaint allege facts which give him the right to maintain his action. (Case v. Kadota Fig Assn., 35 Cal.2d 596, 603 [220 P.2d 912]; Pacific Finance Corp. v. Superior Court, 219 Cal. 179, 182 [25 P.2d 983, 90 A.L.R. 384].)
 [1b] That Jones is not a party who had the right to invoke the jurisdiction of the court under either of these sections is apparent. The child is not a party to the cross-complaint and there is no relationship to be declared between the cross-complainant and Alexander nor is Jones a party who, under section *57 196a, may seek to impose upon Alexander the obligation to support the minor. If the allegations of the original complaint are true then certainly Jones, as the father of the child, has no right to assert that same relationship between the child and some other person. If they are untrue then Jones is an entire stranger to the relationship.
 [3] Respondent real party in interest seeks to support the cross- complaint under section 442 of the Code of Civil Procedure, but a mere reading of that section shows that the cross-complaint here is not authorized by it. By section 442 a cross-complaint is only authorized where the cross-complainant seeks affirmative relief relating to or depending upon the contract, transaction, matter, happening or accident upon which the action is brought or affecting the property to which the action relates. Certainly, Jones and Alexander could not both have been parties to the "transaction, happening or accident" upon which the claims of the minor, as asserted in the complaint, are based.
 [4] It is, of course, true that if the respondent court should enter a judgment against the petitioner that judgment might be reviewed upon appeal therefrom. This, however, would not, in our opinion, constitute a speedy or adequate remedy. It is plain that the court, if it proceeds, would be exceeding its jurisdiction and that any judgment it rendered against petitioner could not be sustained. By such proceeding the petitioner would be subject to needless expense and under the circumstances shown here the trial court should be prohibited from proceeding. (Tide Water Assoc. Oil Co. v. Superior Court, 43 Cal.2d 815 [279 P.2d 35].)
 Let a peremptory writ of prohibition issue as prayed.
 White, P. J., and Lillie, J., concurred.
NOTES
[fn. *]  *. Assigned by Chairman of Judicial Council.
