From 607a5c26cd9fbb7fc370cba3991baa2ebc67a217 Mon Sep 17 00:00:00 2001 From: mtlcl410 <2368091+mtlcl410@users.noreply.github.com> Date: Sun, 1 Nov 2026 23:01:04 +0800 Subject: [PATCH] M12: XFA template parsing options built for each parse roxmltree's ParsingOptions on main is no longer Copy, so the options used for the template and again for the expanded template are built for each parse. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv --- crates/xfa/src/parse.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/xfa/src/parse.rs b/crates/xfa/src/parse.rs index 6585ea1d4d..a0d9018dad 100644 --- a/crates/xfa/src/parse.rs +++ b/crates/xfa/src/parse.rs @@ -725,8 +725,8 @@ pub fn parse(xml: &str) -> Result<(Template, Vec), XfaError> { crate::MAX_XML_DEPTH ))); } - let opts = roxmltree::ParsingOptions { allow_dtd: false, nodes_limit: MAX_NODES, ..Default::default() }; - let doc = roxmltree::Document::parse_with_options(xml, opts).map_err(|e| XfaError::Malformed(format!("template XML: {e}")))?; + let opts = || roxmltree::ParsingOptions { allow_dtd: false, nodes_limit: MAX_NODES, ..Default::default() }; + let doc = roxmltree::Document::parse_with_options(xml, opts()).map_err(|e| XfaError::Malformed(format!("template XML: {e}")))?; let root = doc.root_element(); // The XDP's config packet has a