f 1. Wisconsin Stat. § 971.23(l)(d) (2013-14)1 provides that if a defendant demands a witness list from the State, the district attorney "shall, within a reasonable time before trial," provide a list of all witnesses the district attorney intends to call at *796trial. If the district attorney fails to comply with this demand, "[t]he court shall exclude any witness not listed. . . unless good cause is shown for failure to comply." Sec. 971.23(7m).
¶ 2. Caroline Prieto was charged on May 24, 2012, with great bodily harm to a child in a type of case often referred to as "shaken baby." Prieto promptly made a statutory demand to the Kenosha county district attorney to disclose all witnesses that the district attorney intended to call against her at trial. The district attorney ignored Prieto's request. On December 4, 2013, the circuit court ordered the district attorney to provide its witness list within sixty days and scheduled a trial for June 23, 2014. The district attorney ignored the court's order to name its witnesses. The court postponed the trial and at a hearing on August 15, 2014, scheduled a trial for February 9, 2015, and ordered the district attorney to provide its witness list within twenty days. The district attorney ignored the court's order.
¶ 3. On January 23, 2015, Prieto moved to exclude any witness the State intended to call at trial that it had not already named. The court granted Prieto's motion, leaving the State with one witness whom the court found the State had previously disclosed that it would call. The district attorney's office offered no "good cause" for its failure to list its witnesses over the previous two-plus years. On January 26, 2015, fourteen days before trial, the district attorney filed a witness list followed by a motion for reconsideration of the court's exclusion order. The court denied the motion.
¶ 4. In its appeal, the State acknowledges that the district attorney's office did not have good cause for its failure to list its witnesses. The State nevertheless *797argues that the court erred as Wis. Stat. § 971.23(7m) does not mandate the exclusion of witnesses, and the naming of its witnesses thirteen days before trial was "within a reasonable time before trial." Accepting without deciding that exclusion is discretionary rather than mandatory under § 971.23(7m), we conclude the circuit court did not erroneously exercise its discretion in excluding the State's witnesses given the district attorney's flagrant disregard of § 971.23 and the court's orders.
BACKGROUND
¶ 5. The district attorney charged Prieto with one count of recklessly causing great bodily harm to a child after eight-month-old C.B. was diagnosed with a serious brain injury following a period in Prieto's care. The case centered on the theory that C.B. had suffered shaken baby syndrome at Prieto's hands. Soon after charges were filed, Prieto served the district attorney with a discovery demand pursuant to Wis. Stat. § 971.23(1) that included a request for "[a] list of all witnesses and their addresses whom the district attorney intends to call at trial." Discovery proceeded slowly over the next two and one-half years, during which more than 2000 pages of medical records were released and examined by national experts in preparation for trial.
¶ 6. Following several delays, a jury trial was scheduled for February 9, 2015. Seventeen days before trial, the district attorney's office had provided notice of only one witness that it intended to call in its case-in-chief — an expert whose name was submitted in December 2014 in response to a specific request by Prieto and a court order. When questioned at that time regarding her office's failure to file a list of lay wit*798nesses, the assistant district attorney stated that she had intended to file a list, but somehow had failed to do so. The court noted that it had given the parties twenty days after its August 15, 2014 status hearing to file their witness lists. The court also noted another judge who had been assigned the case in 2013 had given the parties a deadline to file their witness lists. After the district attorney's office offered no argument in opposition and no reason other than forgetfulness for not filing a witness list, the court granted Prieto's motion to prevent the State from calling any witnesses at trial other than the one expert witness.
¶ 7. Three days after the court's oral ruling, the district attorney filed a list naming twelve lay witnesses in addition to the already named expert. This submission was followed by a motion for reconsideration, in which the State argued that as the newly provided list contained witnesses previously known or disclosed to the defense through discovery, Prieto would not be prejudiced if the court allowed those witnesses to be called for trial. The court rejected this argument, stating:
This is a tragic case. It's a very sad case. Nonetheless, we have to follow court orders. We have to prosecute cases if we're going to prosecute cases .... [Y]ou dropped the ball. And I'm concerned for justice not just for the public, but also for the defendant. And — and to delay this — I think in your motion you had asked me to dismiss the case without prejudice or to give the defense an adjournment. But this case has been going on for 3 years. We need some finality to this case. And — and it's set for trial and it's unfortunate that the State chose not to file a witness list until prompted to do so by the Court.
The court denied the reconsideration motion and or*799dered trial to proceed as scheduled. The State appealed, and we granted the State's motion to stay the jury trial pending this appeal of the court's order.
DISCUSSION
¶ 8. The legislature has provided the procedures for prosecution of criminal cases in Wis. Stat. ch. 971. Among the duties imposed on district attorneys is that, when requested by the defense or ordered to by the court, the district attorney "shall, within a reasonable time before trial," provide "[a] list of all witnesses and their addresses" that the district attorney intends to call at trial in his or her case-in-chief. Wis. Stat. § 971.23(l)(d). If the district attorney fails to comply with this demand, "[t]he court shall exclude any witness not listed. . . unless good cause is shown for failure to comply." Sec. 971.23(7m)(a). In appropriate cases, the court may grant a recess or continuance to the opposing party or advise the jury about the failure. Sec. 971.23(7m)(a), (b).
¶ 9. Despite the two statutory "shall[s]," the State argues that the court erred in excluding all but one of its witnesses as a sanction for the district attorney's repeated failure to provide a witness list. The State argues that its witness list was submitted "within a reasonable time before trial," and even if it was not, the sanction under the statute is discretionary and the court erred by not imposing a lesser sanction as Prieto did not show she was prejudiced.
¶ 10. Whether a discovery violation has occurred poses a question of law that we review de novo. State v. Lock, 2012 WI App 99, ¶ 122, 344 Wis. 2d 166, 823 N.W.2d 378. What a court does after finding a statutory discovery violation, absent good cause for the *800violation, is an area where the State asks us to resolve an apparent conflict in the case law over whether the exclusion of witnesses is mandatory or discretionary. Compare id. and State v. DeLao, 2002 WI 49, ¶ 51 & n.9, 252 Wis. 2d 289, 643 N.W.2d 480, with State v. Harris, 2008 WI 15, ¶ 96 & n.47, 307 Wis. 2d 555, 745 N.W.2d 397.
¶ 11. We need not resolve whether exclusion is discretionary or mandatory, however, as we determine that even if the exclusion of witnesses is discretionary under Wis. Stat. § 971.23(7m)(a), the court properly exercised its discretion as it reasonably applied the appropriate legal standard to the relevant facts of this case. See Harris, 307 Wis. 2d 555, ¶ 96. The district attorney's submission of a witness list was not "within a reasonable time before trial," and therefore, the district attorney violated § 971.23(l)(d). The burden was on the district attorney's office to show that it had good cause for this violation, not on Prieto to show that she was prejudiced. The district attorney did not show good cause, and the court properly exercised its discretion when it excluded from trial all witnesses that the district attorney had not named in violation of § 971.23(l)(d) and the court's orders.
¶ 12. The State's argument that the district attorney did not violate the discovery statute as a witness list was provided within a reasonable time before trial ignores the fact that the late submission violated two court orders. Those court orders, in December 2013 and August 2014, established a "reasonable time before trial" for the parties to list their witnesses. If the district attorney's office did not agree with the court's scheduling orders and believed them to not provide for *801the listing of witnesses within a reasonable time before trial, it needed to show good cause for why it could not comply prior to the expiration of the time limits set in those orders. The district attorney's office never argued that it had good cause for its disobedience of its statutory obligation and its duty to abide by court orders, and the State concedes that the district attorney's office did not have good cause for its failure to provide a witness list pursuant to the court's orders.
¶ 13. The State's argument also disregards the fact that at the time of the court's sanction order, the district attorney had not submitted any witness list at all and had provided the name of only one expert witness. It was only after the court excluded the State's witnesses that the district attorney finally responded to a nearly three-year-old statutory demand. Providing a witness list after the court has already ordered a sanction for the failure to provide a witness list is not "within a reasonable time before trial" under Wis. Stat. § 971.23(l)(d).
¶ 14. We decline the State's request to adopt an exception for the discovery violation made by the district attorney so that the significant consequences of the court's order will not be borne by the "blameless public." It is difficult to imagine a circumstance in which the public would be to blame for the derelict performance of a prosecutor, and we cannot reconcile the State's position with a criminal justice system that affords fairness to both the State and defendant. See United States v. Gonzalez-Lopez, 548 U.S. 140, 152 (2006) (trial courts have an interest "that legal proceedings appear fair to all who observe them" (citation omitted)).
*802¶ 15. We share the circuit court's regret that the actions of the district attorney may prevent the merits of this case from being fully tried. We remind the State that the magnitude of the sanction imposed by Wis. Stat. § 971.23(7m) is measured by the degree of the district attorney's violation of § 971.23(1): the greater the number of witnesses a district attorney does not disclose upon demand, the greater the number of witnesses he or she puts at risk of being excluded from trial. It is the district attorney who ultimately determines what sanction is available against his or her office. The district attorney's office ignored § 971.23(l)(d) and the court's orders at its peril.
CONCLUSION
¶ 16. As the district attorney's office failed to show good cause for its violation of Wis. Stat. § 971.23(l)(d) and as the court did not err in its decision to sanction the violation by exclusion of the State's witnesses, we affirm.
By the Court. — Order affirmed.
All references to the Wisconsin Statutes are to the 2013-14 version unless otherwise noted.