
616 N.W.2d 532 (2000)
STATE of Iowa, Appellant,
v.
Michael Gallagher BEECHER, Appellee.
No. 99-1358.
Supreme Court of Iowa.
September 7, 2000.
*534 Thomas J. Miller, Attorney General, Kevin Cmelik, Assistant Attorney General, Thomas J. Ferguson, County Attorney, and Linda Myers, Assistant County Attorney, for appellant.
Linda A. Hall of Gallagher, Langlas & Gallagher, P.C., Waterloo, for appellee.
Considered en banc.
LAVORATO, Justice.
The State sought discretionary review of a district court ruling that ordered the State to either (1) dismiss pending contempt proceedings against Michael Gallagher Beecher or (2) move to amend a pending stalking charge in a separate action to remove the allegation that the stalking was committed in a series of violations of a criminal protective order. In so ruling, the district court concluded that double jeopardy prevents the State from prosecuting Beecher both for stalking and for violating the protective order.
We granted discretionary review and now conclude the district court erred in entering the order. We reverse and remand for further proceedings.
On September 8, 1998, the State charged Beecher with seven counts of harassment. In that case, the district court entered a protective order prohibiting Beecher from having contact with the victim, Angela Renee Rogers. Pursuant to a plea agreement with the State, Beecher pled guilty to two of the seven counts and received a deferred judgment with one year of unsupervised probation. Additionally, the court ordered that the previously entered protective order remain in effect during the period of probation.
In the following year, Beecher was charged with contempt for violating the protective order on three separate occasionsMarch 3, March 31, and April 27, 1999. A magistrate ordered that all three charges of contempt be tried on July 29, 1999.
On May 7, 1999, the State charged Beecher with stalking under Iowa Code sections 708.11(2) (1997) and 708.11(3)(b)(1), as amended. See 1998 Iowa Acts ch. 1021, § 4. Specifically, the trial information charged that Beecher "on or about May 1998 through May 1999 ... did ... [s]talk Angela Rogers ... while *535 being subject to restrictions contained in a criminal protective order which prohibited contact between Michael Gallagher Beecher and Angela Rogers ... [c]ontrary to and in violation of [section] 708.11(2) and [section] 708.11(3)(b)(1) of the Iowa Criminal Code." Stalking under amended Iowa Code section 708.11(3)(b)(1) is a class "D" felony. Trial for the stalking charge was scheduled for July 6, 1999.
On May 13 Beecher filed a motion to dismiss in both cases. He alleged a violation of his Fifth Amendment right against double jeopardy. In response, the State moved to consolidate the two cases. Beecher initially resisted the State's consolidation motion, but later withdrew his resistance to avoid waiver of his double jeopardy claim. See State v. Lange, 495 N.W.2d 105, 108 (Iowa 1992) ("If a defendant expressly asks for separate trials on offenses that, if the government brought and tried separately, would present double jeopardy problems, then the prohibition against multiple prosecutions for `the same offense' does not apply.").
On August 3 the district court ruled on the motion to dismiss. The court phrased the question raised in Beecher's motion to dismiss as "whether the State can punish him separately for each of those acts and then also punish him in a criminal prosecution for the same acts offered serially as evidence of a `course of conduct.'"
The district court concluded that the separate alleged violations of the protective order were lesser included offenses of the stalking charge. Therefore, the three violations would necessarily be merged in the stalking charge under Iowa Code section 701.9 unless the legislature intended to establish multiple punishments for the same offense. On this last question, the court stated that it could
see no reason to conclude that the legislature, having substantially increased the penalties for violating a [protective] order if the violation is part of a continued course of conduct, intended that each separate incident which makes up part of the course of conduct should also be punished individually as a less serious offense.
In light of this conclusion, the district court ruled that it was a violation of Beecher's right against double jeopardy for the State to prosecute him both on the stalking charge and the lesser included violations. The court sustained Beecher's motion to dismiss in part and ordered that
[w]ithin ten days after entry of this order the State shall either dismiss the contempt proceedings for alleged violations of a [protective] order or else move to amend the trial information in the stalking case to remove the allegation that the stalking was committed in violation of a criminal protective order.
Because of its ruling, the district court determined that the State's motion to consolidate was moot.
Later, the district court overruled the State's motion to reconsider. The State then sought discretionary review of the district court's order. We granted discretionary review and stayed all matters in the district court pending appellate review.
The parties agree that the proceeding and punishment for the protective-order violations are criminal in nature, and for that reason, traditional double jeopardy analysis applies. For purposes of this opinion, we assume the same.
Our review here is for correction of errors at law. State v. Dixon, 534 N.W.2d 435, 438 (Iowa 1995) ("We review for errors of law a trial court's grant of a motion to dismiss criminal charges on the ground that double jeopardy forbids reprosecution of the defendant.").

I. The Issues.
The Fifth Amendment of the Federal Constitution provides that no person shall "be subject for the same offence to be twice put in jeopardy of life or limb." U.S. Const. Amend. V. This clause provides protection against the following: (1) a second *536 prosecution for the same offense after acquittal, (2) a second prosecution for the same offense after conviction, and (3) multiple punishments for the same offense. State v. McKettrick, 480 N.W.2d 52, 56 (Iowa 1992) (citing North Carolina v. Pearce, 395 U.S. 711, 717, 89 S.Ct. 2072, 2076, 23 L.Ed.2d 656, 664-65 (1969)). These protections are enforceable against the states through the Fourteenth Amendment of the Federal Constitution. See Dixon, 534 N.W.2d at 439 (citing Benton v. Maryland, 395 U.S. 784, 794, 89 S.Ct. 2056, 2062, 23 L.Ed.2d 707, 716 (1969)).
A. Whether the district court erred when it ordered the State to either dismiss the pending contempt proceeding or to amend the stalking charge. The purpose of the protections against double jeopardy is "to protect an individual from being subjected to the hazards of trial and possible conviction more than once for an alleged offense." Green v. United States, 355 U.S. 184, 187, 78 S.Ct. 221, 223, 2 L.Ed.2d 199, 204 (1957). Underlying this purpose is the idea
that the State with all its resources and power should not be allowed to make repeated attempts to convict an individual for an alleged offense, thereby subjecting him to embarrassment, expense and ordeal and compelling him to live in a continuing state of anxiety and insecurity, as well as enhancing the possibility that even though innocent he may be found guilty.
Id. at 187-88, 78 S.Ct. at 223, 2 L.Ed.2d at 204.
Whether double jeopardy is implicated depends upon whether jeopardy has attached. See Serfass v. United States, 420 U.S. 377, 390-91, 95 S.Ct. 1055, 1064, 43 L.Ed.2d 265, 275 (1975) (quoting United States v. Jorn, 400 U.S. 470, 480, 91 S.Ct. 547, 554, 27 L.Ed.2d 543, 554 (1971)) ("[T]he `constitutional policies underpinning the Fifth Amendment's guarantee' are not implicated before that point in the proceedings at which `jeopardy attaches.'")
As it did in the district court, the State asserts jeopardy has not yet attached, and therefore Beecher's double jeopardy claim is not ripe for judicial determination. We agree.
Jeopardy does not attach until a defendant is put to trial before the trier of facts, whether the trier be a jury or a judge. State v. Harrison, 578 N.W.2d 234, 238 (Iowa 1998) (citing Jorn, 400 U.S. at 479, 91 S.Ct. at 554, 27 L.Ed.2d at 553). When a defendant faces trial by jury, jeopardy attaches when the jury is empanelled and sworn. Crist v. Bretz, 437 U.S. 28, 35, 98 S.Ct. 2156, 2161, 57 L.Ed.2d 24, 31 (1978). The rationale for this "lies in the need to protect the interest of an accused in retaining a chosen jury." Id. Conversely, "[i]n a bench trial, double jeopardy attaches when the judge begins to receive evidence." State v. Taft, 506 N.W.2d 757, 760 (Iowa 1993) (citing United States v. Martin Linen Supply Co., 430 U.S. 564, 569, 97 S.Ct. 1349, 1353, 51 L.Ed.2d 642, 650 (1977)).
These principles of double jeopardy do not vary even though an accused may raise defenses or objections before trial that are capable of determination without trial of the general issue. Serfass, 420 U.S. at 391, 95 S.Ct. at 1064, 43 L.Ed.2d at 276. Nor do they vary even though the accused must raise certain other defenses or objections before trial. Id.
Here, we have two pending cases awaiting trial. In neither case has a jury been empanelled and sworn. And in neither case has a trial judge started taking evidence. Therefore, jeopardy has not attached. Until jeopardy attaches in one of those trials, there cannot be a threat of double jeopardy arising out of the other trial. This is so even if Beecher is correct in his assertion that he faces multiple punishments for the same offense. Beecher's double jeopardy claim is therefore not ripe for judicial determination. The district court erred in entering its conditional order of dismissal.
*537 B. Whether Beecher faces multiple punishments for the same offense. Because the issue may arise in further proceedings on remand, we address whether Beecheras he contendsfaces multiple punishments for the same offense. In support of his contention, Beecher makes two arguments. First, the offense of violating a protective order is a lesser included offense of stalking. Second, the State is seeking to punish him for a continuous offense, i.e., stalking, as well as the individual acts that form the basis for the ongoing offense, i.e., violations of a protective order.
The district court relied on both arguments in concluding Beecher faces multiple punishments for the same offense. For reasons that follow, we reject both arguments.
1. Lesser included offenses. Our merger statute, Iowa Code section 701.9, provides that "[n]o person shall be convicted of a public offense which is necessarily included in another public offense of which the person is convicted." If a jury returns a verdict that conflicts with this statute, the district court must enter judgment on the greater offense only. Iowa Code § 701.9. In several cases, we have recognized that this statute codifies the double jeopardy protection against multiple punishments for the same offense. See, e.g., State v. Daniels, 588 N.W.2d 682, 683 (Iowa 1998).
Like the Double Jeopardy Clause, section 701.9 "operates as a check on the courts, not the legislature." Id. The Double Jeopardy Clause does not prohibit the legislature from defining crimes and fixing punishment. Id. at 684. Section 701.9 merely prohibits a court "from imposing a greater punishment than the legislature intended." State v. Halliburton, 539 N.W.2d 339, 344 (Iowa 1995).
When more than one offense is charged from a single incident, we may infer legislative intent to impose multiple punishment from the plain language of the relevant statutes. State v. Perez, 563 N.W.2d 625, 628 (Iowa 1997). However, here, the district court applied the familiar "legal elements test." And on appeal, the dispute centers on the application of that test. The test involves comparing the elements of the two offenses to determine "whether it is possible to commit the greater offense without committing the lesser offense." Halliburton, 539 N.W.2d at 344.
We proceed to compare the elements of both offenses under the legal-elements test. The State must prove the following elements to establish a violation of a protective order: The defendant (1) was subject to a protective order and (2) violated that order. See Iowa Code § 236.8.
Iowa Code section 708.11(2) provides that a person commits stalking when all of the following occur:

a. The person purposefully engages in a course of conduct directed at a specific person that would cause a reasonable person to fear bodily injury to, or the death of, that specific person or a member of the specific person's immediate family.

b. The person has knowledge or should have knowledge that the specific person will be placed in reasonable fear of bodily injury to, or the death of, that specific person or a member of the specific person's immediate family by the course of conduct.

c. The person's course of conduct induces fear in the specific person of bodily injury to, or the death of the specific person or a member of the specific person's immediate family.
Beecher attempts to uphold the district court's lesser-included-offense analysis by insisting that the provisions of Iowa Code section 708.11(3)(b)(1) (1997), pertaining to the violation of a protective order, are an element of the crime of stalking. Therefore, Beecher argues, a person could not *538 commit stalking without also having violated a protective order.
Iowa Code section 708.11(3)(b) (1997) provided that
[a] person who commits stalking in violation of this section commits a class "D" felony if any of the following apply:
(1) The person commits stalking in violation of a criminal or civil protective order or injunction, or any other court order.
Beecher contends that, although listed in a separate subsection, the provision regarding violation of a criminal protective order constitutes an element of the crime of stalking. The problem with Beecher's contention and the ruling of the district court is that both have apparently overlooked an amendment to section 708.11(3)(b)(1). In 1998, Iowa Code section 708.11(3)(b)(1) was amended. See 1998 Iowa Acts ch. 1021, § 4. The statute as amended now reads
[a] person who commits stalking in violation of this section commits a class "D" felony if any of the following apply:
(1) The person commits stalking while subject to restrictions contained in a criminal or civil protective order or injunction, or any other court order which prohibits contact between the person and the victim, or while subject to restrictions contained in a criminal or civil protective order or injunction or other court order which prohibits contact between the person and another person against whom the person has committed a public offense.
Iowa Code § 708.11(3)(b)(1) (1999).
The State charged Beecher under the amended statute, and Beecher has made no assertion that he was improperly charged. The district court, however, over the State's objection based its analysis on the old statute. The error was harmless because, as we shall see, contrary to the district court's analysis, violation of a protective order is not an element of the stalking offense. Nor is the new provision that the "person commits stalking while subject to restrictions in a criminal ... protective order" an element of the stalking offense.
Our cases are clear that stalking contains only three elementsthe elements found in section 708.11(2). See State v. Limbrecht, 600 N.W.2d 316, 318 (Iowa 1999) ("Iowa's stalking statute, section 708.11(2), contains three essential elements."); State v. Mulvany, 600 N.W.2d 291, 293 (Iowa 1999) (noting the three elements of stalking are found in Iowa Code section 708.11(2)).
The subsection pertaining to protective orders (Iowa Code section 708.11(3)(b)(1)) addresses the degree of the stalking offense. That subsection is simply a sentencing enhancement for an offense that would otherwise be an aggravated misdemeanor. See Iowa Code § 708.11(3)(c) ("A person who commits stalking in violation of this section commits an aggravated misdemeanor or if the offense is a first offense which is not included in paragraph "b ".").
We find support for our conclusion in the language of the statute that provides that "[a] person who commits stalking in violation of this section commits a class "D" felony if any of the following apply...." Iowa Code § 708.11(3)(b) (emphasis added). This language clearly indicates that the provisions of section 708.11(3)(b) apply only once a person has already been convicted of stalking. What this language suggests is that the provisions in section 708.11(3)(b), including the provision dealing with protective orders (section 708.11(3)(b)(1)), are not elements of the offense of stalking, but rather are merely predicates to an enhanced punishment. We also note that the explanation to the 1998 amendment to section 708.11(3)(b)(1) suggests this provision is a punishment enhancement. See 1998 Iowa Acts ch. 1021 ("An act relating to certain crimes against persons ... by providing for the application of enhanced stalking penalties for persons who are the subject *539 of certain restraining or protective orders....").
We have previously indicated that predicates used only for enhancement purposes are not elements of the offense charged. See State v. Tobin, 333 N.W.2d 842, 845 (Iowa 1983) (holding that a recidivist provision in theft statute, providing that theft of property not exceeding $500 in value by one who has before been twice convicted of theft constitutes theft in the second degree, does not violate protection against double jeopardy; prior convictions are predicates for enhanced punishment, rather than elements of current theft charge, and hence, current charge is not reprosecution of prior offenses).
Reviewing similarly worded stalking statutes, other courts have concluded that provisions relating to the violation of a restraining order do not define the crime of stalking but rather merely create a punishment enhancement. See, e.g., People v. Kelley, 52 Cal.App.4th 568, 576, 60 Cal. Rptr.2d 653, 658 (1997).
We therefore conclude that neither the language under former section 708.11(3)(b)(1)violation of a criminal protective ordernor the language under the amended version of this provisionwhile being subject to restrictions contained in a criminal protective ordermakes either version a lesser included offense of stalking. Former section 708.11(3)(b)(1) and its current version address only the degree of the offense for sentencing purposes and do not describe or define an element of stalking itself. Therefore, it is possible to commit the offense of stalking absent the factual circumstances under the provisions of former section 708.11(3)(b)(1) or its current version.
In sum, what we have here are two offenses that are not the sameviolation of a criminal protective order and stalking. Multiple punishments can be assessed in these circumstances without violating double jeopardy principles. See State v. Smith, 573 N.W.2d 14, 19 (Iowa 1997) ("Multiple punishments can be assessed after a defendant is convicted of two offenses that are not the same."); see also Kelley, 52 Cal.App.4th at 576, 60 Cal. Rptr.2d at 659.
2. Continuous offense. At the heart of Beecher's alternative theory is the "continuous offense doctrine." According to this doctrine, double jeopardy "prohibits multiple convictions of a defendant who commits only one, continuous offense." State v. Jacobs, 607 N.W.2d 679, 688 (Iowa 2000).
Beecher claims that the State is seeking to punish him for an ongoing offense stalkingas well as the individual acts that form the basis for the ongoing offensethe violations of the protective order. Beecher's argument is based on a faulty premise. The faulty premise is that the violations of the protective order form the basis of the stalking offense. As we mentioned, the violations of the protective order do not form the basis of the stalking offense. The State is therefore not seeking to punish Beecher for an ongoing offense as well as the individual acts that form the basis for the ongoing offense.
Moreover, even assuming stalking is a continuing crime, the continuous offense doctrine does not apply here. The continuous offense doctrine prohibits multiple convictions for a continuing crime when such convictions are based on the same course of conduct that gives rise to the crime. Here, the State has not charged Beecher with multiple offenses of stalking.

III. Disposition.
Because we conclude jeopardy has not yet attached, Beecher's double jeopardy claim is not ripe for judicial determination. The district court therefore erred in entering its conditional order of dismissal. We reverse and remand for further proceedings.
REVERSED AND REMANDED.
*540 All justices concur except CARTER, J., who concurs specially, and NEUMAN, J., who takes no part.
CARTER, Justice (concurring specially).
I concur in the result and in all portions of the court's opinion except those statements concerning merger that would permit a search for legislative intent beyond the application of section 701.9.
