
64 S.W.3d 836 (2001)
Danny G. GOE and Edna Goe, Petitioner/Appellant,
v.
CITY OF MEXICO, Respondent.
No. ED 79327.
Missouri Court of Appeals, Eastern District, Division One.
December 26, 2001.
*837 Gregg T. Hyder, Columbia, MO, for appellant.
Louis Leonatti & Randall P. Baker, Mexico, MO, for respondent.
WILLIAM H. CRANDALL, JR., Presiding Judge.
Plaintiffs, Danny G. Goe and Edna Goe, appeal from the dismissal of their action for damages against defendant, City of Mexico, Missouri (hereinafter City), for failure to state a claim upon which relief can be granted. We reverse and remand.
Plaintiffs brought an action against City, titling their action "PETITION FOR DAMAGES (Inverse Condemnation)." In their petition, they alleged the following: that they were the owners of a mobile home located at 511 Eastholm in City; that City removed the mobile home without their permission and without due process of law; and that City's action constituted wrongful appropriation of their *838 property, resulting in actual damages of $15,000.00.
City moved to dismiss plaintiffs' action, alleging that plaintiffs' petition failed to state a cause of action, because under Missouri's statutes and constitution it had the police power to enforce its ordinances and to demolish unsafe structures. City further alleged that despite assurances from plaintiffs' attorney that corrections to the property would be undertaken, no corrections were made. The motion to dismiss was supported by the affidavit of City's public works director and exhibits, primarily letters sent by City to plaintiffs. Plaintiffs filed a response to City's motion, raising the lack of a hearing and their efforts to correct the violations cited by City.
The trial court granted City's motion to dismiss on the basis that plaintiffs' petition stated no claim "due to the valid exercise of [City's] `police power.'" Plaintiffs appeal from the dismissal of their action for failure to state a claim.
The salient issue is whether plaintiffs' petition stated a cause of action on the basis that City's ordinance pertaining to demolition did not provide for a hearing, as required under section 67.410, RSMo 2000.
As a preliminary matter, we address City's initial contention that the motion to dismiss was converted to a motion for summary judgment when the court considered matters outside the pleadings, because it submitted an affidavit as well as other documents for the court's consideration. Rule 55.27(a) provides that when, on a motion to dismiss for failure of the pleading to state a claim upon which relief can be granted, matters outside the pleadings are presented to and not excluded by the trial court, the motion shall be treated as one for summary judgment, provided all parties are afforded the reasonable opportunity to present all material pertinent to the motion. All parties are to be given notice by the court that it will consider the motion as one for summary judgment and must permit them to present all relevant evidence. St. Charles County v. City of O'Fallon, 972 S.W.2d 327, 329 (Mo.App. E.D.1998).
Here, a review of the record revealed no order notifying the parties that the pleadings and the documents were to be reviewed as a summary judgment. See, e.g., id. There also was no indication that the parties implicitly agreed to treat the motion to dismiss as one for summary judgment. See Boone County v. County Employees' Retirement Fund, 26 S.W.3d 257, 260 (Mo.App. W.D.2000) (appellate court reviewed motion to dismiss as a summary judgment where all parties agreed at oral argument that there were no genuine issues as to any material facts, that the issue was strictly a matter of law, and that they would like a final determination on the merits). Further, the trial court was not required to go beyond the pleadings to ascertain whether City's conduct was a valid exercise of its police powers. Thus, we decline to review the case at bar as one for summary judgment,[1] but review the case as an order granting a motion to dismiss on the pleadings.[2]
*839 The law generally favors trials upon the merits, and the criteria by which the sufficiency of petitions is judged have been developed to promote this purpose. Collins v. Swope, 605 S.W.2d 538, 540 (Mo. App. S.D.1980). On appeal, our review of a motion to dismiss for failure to state a claim requires that we consider the pleadings, allowing them their broadest intendment and treating all facts alleged as true, and that we determine whether the petition invokes substantive principles of law. Hyatt v. Trans World Airlines, Inc., 943 S.W.2d 292, 295 (Mo.App. E.D.1997). A petition cannot be dismissed for failure to state a claim unless it appears that the plaintiff can prove no set of facts in support of his claim that would entitle him to relief. McIntosh v. Foulke, 360 Mo. 481, 228 S.W.2d 757, 761 (1950).
In their petition, plaintiffs alleged that City removed a mobile home from their property "without adequate due process of law." City counters that the procedures set forth in its ordinances complied with due process and with the state statutes. The relevant portions of City's ordinances read as follows:

SECTION PM-110.0 DEMOLITION
PM-110.1 General: The code official shall order the owner of any premises upon which is located any structure, which in the code official's judgment is so old, dilapidated or has become so out of repair as to be dangerous, unsafe, unsanitary or otherwise unfit for human habitation or occupancy, and such that it is unreasonable to repair the structure, to raze and remove such structure; or if such structure is capable of being made safe by repairs, to repair and make safe and sanitary or to raze and remove at the owner's option; or where there has been a cessation of normal construction of any structure for a period of more than two years, to raze and remove such structure....
PM-110.3 Failure to comply: If the owner of a premises fails to comply with a demolition order within the time prescribed, the code official shall cause the structure to be razed and removed....

SECTION PM-111.0 MEANS OF APPEAL
PM-111.1 Application for appeal: Any person affected by a decision of the code official or a notice or order issued under this code shall have the right to appeal to the board of appeals....
Section 67.400, RSMo 2000 grants a city the power to enact ordinances "to provide for vacation and the mandatory demolition... or mandatory repair and maintenance of buildings or structures within the corporate limits of the city ... which are detrimental to the health, safety or welfare of the residents and declared to be a public nuisance." In relevant part, section 67.410 requires that any ordinance enacted pursuant to section 67.400 shall:
(4) Provide that upon failure to commence work of reconditioning or demolition within the time specified or upon failure to proceed continuously with the work without unnecessary delay, the building commissioner or designated officer or officers shall call and have a full and adequate hearing upon the matter, giving the affected parties at least ten days' written notice of the hearing. Any *840 party may be represented by counsel, and all parties shall have an opportunity to be heard. After the hearings, if the evidence supports a finding that the building or structure is a nuisance or detrimental to the health, safety, or welfare of the residents of the city ... the building commissioner ... shall issue an order making specific findings of fact, based upon competent and substantial evidence, which shows the building or structure to be a nuisance and detrimental to the health, safety, or welfare of the residents of the city... and ordering the building or structure to be demolished and removed, or repaired. If the evidence does not support a finding that the building or structure is a nuisance or detrimental to the health, safety, or welfare of the residents of the city,... no order shall be issued.
(Emphasis added).
Here, City's ordinance relating to demolition did not provide for a full and adequate hearing upon the matter for the affected parties. City's ordinances only provided that an aggrieved party had the right to appeal a decision of the City's code official. Thus, the ordinances provided for a hearing only if the party adversely affected requested one. Section 67.410 clearly required City to "call and have a full and adequate hearing" for the affected parties. That statute also required City's code official, after the hearing, to issue an order making specific findings of fact, based upon competent and substantial evidence, with regard to the building or structure at issue. Because the demolition ordinance did not provide for a hearing to be held automatically, it did not comply with the requirements of section 67.410 and was therefore invalid.
City argues that plaintiffs waived any due process claim by failing to appeal to the board of appeals, as provided for in its ordinances. City's argument is without merit. Plaintiffs' failure to appeal from City's code official's decision to remove their mobile home from the property does not mean that plaintiffs waived their right to challenge the validity of City's ordinance relating to demolition. The right to appeal afforded plaintiffs by the ordinances is significantly different from the statutory right to have a "full and adequate hearing" on the merits in the first instance. Under City's ordinances, plaintiffs were required to request an appeal; but under the state statutes, City was required to provide an evidentiary hearing automatically, whether or not plaintiffs requested one. Because plaintiffs were not given the statutorily mandated hearing, they did not waive any right to challenge the validity of the demolition ordinance for failing to provide for that hearing.
City also argues that the court properly dismissed plaintiffs' action for failure to state a claim, because plaintiffs titled their action as one for inverse condemnation, an action which cannot lie because their property was not acquired for a public use. This argument also is without merit. The character of a cause of action is determined from the facts stated in the petition and not by the prayer or the name given the action. Memco, Inc. v. Chronister, 27 S.W.3d 871, 875 (Mo.App. S.D.2000). It is the facts stated in the petition, along with the relief sought, which under our system of code pleading are to be looked at to determine the cause of action, rather than the form of the petition. Id. Here, plaintiffs pleaded facts that would support an action for damages; and we are not bound by the name they ascribed to the action.
*841 The trial court erred in dismissing plaintiffs' petition for failure to state a claim upon which relief can be granted. City's demolition ordinance did not comply with section 67.410 for the reason that it did not require a full evidentiary hearing. The ordinance pertaining to demolition was therefore invalid.
The judgment of dismissal is reversed and the cause is remanded for proceedings not inconsistent with this opinion.
PAUL J. SIMON, J., and ROBERT G. DOWD, JR., J., concur.
NOTES
[1]  Although we do not review the case as one for summary judgment, we acknowledge that our analysis of the legal principles invoked by the pleadings would be the same, regardless of whether we consider the judgment as a dismissal or as a summary judgment.
[2]  Here, the trial court did not indicate whether the dismissal was with or without prejudice. Generally, under Rule 67.03, an involuntary dismissal is without prejudice unless the court specifies otherwise in its order. A dismissal without prejudice usually is not a final and appealable judgment. Ampleman v. Schweiss, 969 S.W.2d 862, 863 (Mo.App. E.D. 1998). Yet, where the practical effect of the court's dismissal is a termination of the litigation, the judgment is final and appealable. Id. Here, the dismissal of plaintiffs' petition for failure to state a claim upon which relief can be granted resulted in the termination of the litigation and was effectively with prejudice. Therefore, the judgment is final and appealable.
