
44 Cal.App.2d 61 (1941)
STRATFORD IRRIGATION DISTRICT, Appellant,
v.
EMPIRE WATER COMPANY et al., Respondents.
Civ. No. 2611. 
California Court of Appeals. Fourth Dist.  
April 5, 1941.
 Harris, Willey & Harris, Ronald B. Harris and Everett G. Harris, for Appellant.
 H. Scott Jacobs and Dearing & Jertberg for Respondents.
 GRIFFIN, J.
 Plaintiff and appellant brought this action in condemnation. Defendants and respondents demurred generally and specially to the complaint. Their demurrers, identical in form, were sustained. Plaintiff failed to amend. Judgment was entered for defendants. From this judgment plaintiff appealed.
 The complaint alleges generally that the plaintiff is an irrigation district and that it brings the action on behalf of the landowners within its boundaries; alleges the corporate existence of the two defendants; describes the location and boundaries of the district; alleges that the defendant Empire Water Company (hereinafter called the company) is the owner of the water distribution system which serves the lands within the district; that standing in the name of the company are 85/8 shares of the capital stock of the Lemoore Canal and Irrigation Company, whose lands and water are appurtenant to the lands within the district; that the stock was pledged to the respondent bank for the debt of another; and that there was a resolution of the board of directors of the district in compliance with section 1241 of the Code of Civil Procedure. A map showing the boundaries of the district and the distribution system of the company was made a part of the complaint by reference, and then followed a description of the property sought to be condemned, i. e., all the right, title and interest of the company in and to the 85/8 shares of the Lemoore Canal and Irrigation Company stock hereinabove described; the upper Stratford weir, located on *64 the Kings River; the lower Stratford weir; described canals, laterals and rights of way thereof; a strip of land 40 feet in width on each side of the Kings River from the north line of the Empire Ranch as per recorded maps of said ranch and as described in the recorded deed dated January 8, 1906, from the Empire Investment Company to the Empire Water Company; a strip of land along both sides of Kings River, from the north line of the Empire Ranch as per recorded maps, together with all buildings and improvements thereon and all appurtenances, water, and water rights thereunto belonging, including that proportion of the waters of Kings River to which the 18,712 acre tract owned by said grantor (Empire Investment Company) is entitled as being riparian to said river; all the interest, if any, of the Empire Water Company in and to the bed and banks of the Kings River lying south of the north line of section 19, township 20 south, range 20 East, M. D. B. & M., and north of the south line of section 32, township 20 south, range 20 East M. D. B. & M.; together with all structures of any kind and description located upon or used in connection with the properties hereinabove described.
 Plaintiff prays for judgment taking and condemning the several properties as described, and that the court ascertain and assess the value of the property sought to be condemned pertaining to the realty, and of each and every estate or interest therein, for the public uses hereinabove set forth.
 The grounds of demurrer are (1) that the court has no jurisdiction of defendants or of the subject of the action for the reason that the property sought to be condemned is not sought to be condemned for a public use but that the use for which said property is sought to be condemned is a private use; (2) that the records of Kings County will show that all of the lands in the Stratford Irrigation District were sold and conveyed to the present owners of said lands or their predecessors in interest by the Empire Investment Company, subject to all the covenants and conditions of a certain recorded contract and deed claimed to have been pleaded by reference to the deed in the complaint. (The terms of the contract and deed are not set forth in the complaint. They are set out in Stratton v. Railroad Com., 186 Cal. 119 [198 P. 1051], Braley v. Empire Water Co., 130 Cal.App. 532 [20 PaCal.2d 75], and Quist v. Empire Water Co., 204 Cal. *65 646 [269 P. 533]); (3) that the complaint does not state facts sufficient to constitute a cause of action; (4) that the complaint is uncertain, ambiguous and unintelligible; (5) that there is a defect or misjoinder of parties defendant in that all the landowners of the Empire Ranch west of Kings River in the Stratford Irrigation District are proper and necessary parties for the reason that the purpose of the action is broad enough to cover all the water rights of each and all of the landowners who are successors in interest of the company in said contract and whose lands are riparian to said Kings River; and (6) that none of the landowners on the entire Empire Ranch east of Kings River, are made parties defendant in the action.
 The trial court sustained each of the demurrers on the ground that the complaint did not state facts sufficient to constitute a cause of action.
 Respondents contend that the other grounds set forth in their demurrers to the complaint should have been sustained by the lower court and may be properly considered by this court on appeal; that if this court determines that the demurrers should have been sustained on any other grounds rather than the failure to state a cause of action, this court can properly affirm the judgment.
 [1] In reviewing upon appeal an order sustaining a demurrer to a complaint, an appellate court is not limited to the grounds of demurrer upon which it was sustained by the court below, but if the complaint is insufficient upon any ground properly specified in the demurrer, the order must be sustained. (Johnson v. Fletcher, 97 Cal.App. 153 [274 P. 1001]; Burke v. Maguire, 154 Cal. 456 [98 P. 21].)
 Respondents argue that should the appellant be successful in securing a decree of condemnation, it would merely step "into the shoes of the Empire Water Company" under the decision in Bent v. Second Extension Water Co., 51 Cal.App. 648 [197 P. 657]; that the fact that the irrigation district becomes the owner of the water contract in the place of the Empire Water Company, a private corporation, does not change the private character of the water contract and the rights of the landowners; that the landowners still have the right to have their water furnished them for $1 per acre per annum under the contract which, under the decision of Stratton v. Railroad Com., supra, it is claimed is a private *66 use and not a public use; that the only possible escape from this situation would be for the appellant to acquire by purchase or condemnation, all of the water rights of the land owners on the east side of Kings River on the Empire Ranch that if the water contract were retired and cancelled by such proceeding, then the district would own the water rights now belonging to the company and the landowners; that until the water agreement and the rights of the landowners therein are taken over by the irrigation district the use is, and will continue to be, private and not public. In support of respondents' argument it is contended that the trial court, as well as this court, in considering the merits of the pleadings under consideration, must and should take judicial notice of the status of the water rights of the Empire Water Company and the landowners as determined by the recorded contract and deed and by the Supreme and Appellate Courts of this state in construing them. (Citing Livermore v. Beal, 18 Cal.App.2d 535 [64 PaCal.2d 987], Southern Pac. R. R. Co. v. Painter, 113 Cal. 247 [45 P. 320], and sec. 1875, subds. 2 and 3, Code Civ. Proc.) It was apparently on the theory that the property sought to be taken was not being taken for a public use that the court sustained respondents' demurrers. Therefore we will first discuss this theory.
 [2] Eminent domain is the right of the people or government to take private property for public use, and the complaint must show that the use for which the property is to be taken is a public use, so declared by the legislature. (Northern Light etc. Co. v. Stacher, 13 Cal.App. 404 [109 P. 896]; 10 Cal.Jur., p. 397, sec. 99.) The legislature has declared in section 61b, Act 3854, Deering's General Laws 1937, volume 1, page 1843, that "... irrigation districts may acquire, by ... condemnation, the irrigation system, canals and works through which lands in such districts have been or may be supplied with water for irrigation, or other property necessary or proper for the purposes of the district ... or for the capital stock of any corporation owning such system or other property ... subject to any liens, encumbrances or obligations thereon ..." (See also sec. 15 of said act.)
 [3] It is therefore the general rule that an irrigation district may acquire by condemnation a system of canals and water works and may purchase or condemn an existing water *67 system, in which case it takes subject to the rights of existing consumers, whether such rights exist by virtue of a contract or dedication of the system for use in connection with certain lands. (26 Cal.Jur., p. 404, sec. 632; Lindsay-Strathmore Irr. Dist. v. Wutchumna Water Co., 111 Cal.App. 688 [296 P. 933].)
 [4] Section 17 of the act provides that "The use of all water required for the irrigation of the lands in any district formed under the provisions of this act ... for ... beneficial uses, within such district, together with the rights of way for canals and ditches, sites for reservoirs, and all other property required in fully carrying out the provisions of this act is hereby declared to be a public use ..." (Italics ours.) It has been held that where the legislature declares a particular use to be a public use the presumption is in favor of its declaration and the courts will not interfere therewith unless the use is clearly and manifestly of a private character. (County of San Mateo v. Coburn, 130 Cal. 631 [63 P. 78, 621]; Contra Costa Coal Mines R. R. Co. v. Moss, 23 Cal. 323; 20 C.J., p. 551, sec. 38.)
 Section 1241, subdivision 2, of the Code of Civil Procedure, provides that before property can be taken it must appear that the taking his necessary to a use authorized by law, and it is further provided that when the board of directors of an irrigation district shall by resolution have found and determined that a public interest and necessity require the acquisition and that the property described in such resolution is necessary therefor, such resolution shall be conclusive evidence of the public necessity, except in the case of the taking of property located outside of the territorial limits thereof. (County of Los Angeles v. Rindge Co., 53 Cal.App. 166 [200 P. 27]; San Benito Co. v. Copper Mountain Min. Co., 7 Cal.App.2d 82 [45 PaCal.2d 428].)
 However, the mere declaration by the legislature of a purpose for which property may be taken for a public use is not conclusive and does not preclude a person whose land is being condemned from showing upon the trial that, as a matter of fact, the use sought to be subserved is a private one, or from assailing the complaint on the ground that it so appears therefrom. The character of the use and not its extent, determines the question of public use.
 [5] In addition to the general allegations above related in the complaint, it particularly alleges that "the irrigating of *68 the lands described within the boundaries of plaintiff and the acquiring of rights of way and the construction of ditches and gates and the acquiring of existing rights of way for ditches and structures appurtenant thereto, as hereinbefore set forth, are for a public use and benefit."
 Respondents concede that if all the landowners were joined and their rights under the contract, together with their water rights, were condemned along with the distributing system, a cause of action in all probability could be stated. In other words, it is argued that the district can take the whole but it cannot take any part of the lands. The legislature, however, has provided that an irrigation district may take less than the whole. (Sec. 61B, California Irrigation District Act, supra, p. 1843; Henderson v. Oroville-Wyandotte Irr. Dist., 207 Cal. 215 [277 P. 487]; Bent v. Second Extension Water Co., supra; 10 R. C. L. 88.)
 Considering the nature of the district and the allegations of the complaint, we are convinced that a cause of action was stated in so far as it affirmatively shows thereby that the property sought was for a public use. (Northern Light etc. Co. v. Stacher, supra; Rialto Irr. Dist. v. Brandon, 103 Cal. 384 [37 P. 484]; Cummings v. Peters, 56 Cal. 593.)
 [6] While we recognize the general rule that a demurrer raises no question of fact but assumes the correctness and truth of the facts in the pleadings to which the demurrer was interposed, the court is permitted to read such pleadings as if they contained a statement of all matters of which the court is required to take judicial notice even when the pleadings contain an express allegation to the contrary. (Livermore v. Beal, supra.) This case, however, refers to land office records. The authorities cited would not support a holding that the trial court in the instant case, in ruling on the demurrers, must take judicial notice of and take into consideration the contract which respondents claim is referred to in the deed, incidentally referred to in the complaint as being on record in the recorder's office. [7] It is a general rule that matters of substance must not be alleged by way of reference. (Burkett v. Griffith, 90 Cal. 532 [27 P. 527, 25 Am.St.Rep. 151, 13 L.R.A. 707]; Hibernia S. & L. Soc. v. Thornton, 117 Cal. 481 [49 P. 573]; Ahlers v. Smiley, 11 Cal.App. 343 [104 P. 997].) *69
 Even if it may be assumed that the contract, as explained in the case of Stratton v. Railroad Com., supra, may be rightfully considered in determining the issues before us, that action was instituted to determine the character of the relationship between the water company and the landowners, as to whether that relationship was that of a public utility and consumer for the purpose of fixing rates under the jurisdiction of the commission. The court held that such relationship did not exist. This determination is not necessarily a determination of the issues here presented on the demurrers. (Hewitt v. San Jacinto etc. Irr. Dist., 124 Cal. 186 [56 P. 893]; Henderson v. Oroville-Wyandotte Irr. Dist., supra.)
 The contract and deed above referred to may furnish evidentiary support for respondents' contention under proper pleadings, but we are unable to hold that this reference is sufficient to overcome the allegations of appellant's complaint on the question of public use. (Kansaburo Ohsaki v. Ahern, 61 Cal.App. 787, 790 [215 P. 714]; Munson v. Bowen, 80 Cal. 572 [22 P. 253]; Laguna Drainage Dist. v. Charles Martin Co., 144 Cal. 209 [77 P. 933]; Whiteman v. Anderson-Cottonwood Irr. Dist., 60 Cal.App. 234, 241 [212 P. 706]; El Camino Irr. Dist. v. El Camino Land Corp., 12 Cal.2d 378 [85 PaCal.2d 123]; Anderson-Cottonwood Irr. Dist. v. Klukkert, 13 Cal.2d 191 [88 PaCal.2d 685].)
 [8a] The only remaining point of merit presented and argued in the briefs pertains to the claimed defect or misjoinder of parties defendant. It is argued that all of the landowners on the Empire Ranch east of Kings River and in the Stratford Irrigation District are proper and necessary parties to this action for the reason that the purpose of the action is broad enough to cover all of the water rights of each and all of the landowners who are successors in interest of the Empire Investment Company in the contract above referred to and whose properties are riparian to the Kings River. Respondents cite section 1244 of the Code of Civil Procedure, subdivision 2, which provides that the complaint must contain "the names of all owners and claimants, of the property, if known, or a statement that they are unknown, who must be styled defendants".
 Plaintiff has alleged that the Empire Water Company is the owner of the property sought to be condemned. There is nothing in the pleading to suggest that any other person *70 or corporation has any interest in the property except the defendant Security-First National Bank of Los Angeles, the pledgee of the stock. These allegations satisfy the requirements of the section.
 [9] A demurrer admits all the material allegations of a complaint but does not change or enlarge those allegations. It certainly cannot insert allegations in a complaint that do not appear in it.
 [8b] There is not the slightest reference in the complaint to the contract upon the terms of which defendants rest their argument of nonjoinder of necessary parties defendant. Casual reference is made to a deed from the Empire Investment Company to the Empire Water Company which defendants maintain refers to this contract. No attempt is made to plead either the deed or contract by stating its substance, by attaching copies as exhibits or by reference to the book where the contract is recorded, assuming that this might be done, which is open to considerable doubt. (See People v. de la Guerra, 24 Cal. 73; Ralphs v. Hensler, 97 Cal. 296 [32 P. 243].) There is nothing in the complaint to invite judicial notice to the contract, again assuming that judicial notice of it could be taken.
 If there are persons who are not defendants who claim any interest in the property sought to be condemned, they may be permitted to appear and defend the action (sec. 1246, Code Civ. Proc.), or, they may be brought into the action and their rights litigated. (Secs. 387 and 389, Code Civ. Proc.)
 The question of nonjoinder of parties defendant as presented at this time cannot be raised by demurrer to the complaint. (Kreling v. Kreling, 118 Cal. 413, 420 [50 P. 546]; 1 Cal.Jur., secs. 24 and 25, pp. 45 to 47; 21 Cal.Jur., p. 94, sec. 61.) That defect, if it be a defect, does not appear from the allegations of the pleading under consideration.
 For the reasons expressed the demurrers should have been overruled.
 Judgment reversed with directions to the trial court to overrule the demurrers and allow defendants a reasonable time within which to answer.
 Barnard, P. J., and Marks, J., concurred.
