From 883ac97f88ce079261b4b393bfba4a1abcd6c4ed Mon Sep 17 00:00:00 2001 From: Gareth Edwards Date: Mon, 6 Jul 2026 22:08:24 +1000 Subject: [PATCH] Raise totalEntitySizeLimit for dictionary XML parsing html.xml's shared attribute-group entities (event handlers, core/lang attributes) are &entity;-referenced 335 times across ~90 tag definitions, which legitimately accumulates past newer JDKs' tightened default for jdk.xml.totalEntitySizeLimit (confirmed failing on JDK 25, fine on JDK 21). Set it explicitly on this parser instance only, so other XML parsing in a consuming application is unaffected. Fixes #2 --- .../src/main/java/cfml/dictionary/SyntaxDictionary.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cfml.dictionary/src/main/java/cfml/dictionary/SyntaxDictionary.java b/cfml.dictionary/src/main/java/cfml/dictionary/SyntaxDictionary.java index 00d48ee..97aad15 100644 --- a/cfml.dictionary/src/main/java/cfml/dictionary/SyntaxDictionary.java +++ b/cfml.dictionary/src/main/java/cfml/dictionary/SyntaxDictionary.java @@ -555,7 +555,12 @@ private void loadDictionary() throws IOException, SAXException, ParserConfigurat factory.setNamespaceAware(false); factory.setValidating(false); final XMLReader xmlReader = factory.newSAXParser().getXMLReader(); - + // The dictionary XML reuses a handful of shared attribute-group entities (event handlers, + // core/lang attributes etc.) across ~90 tag definitions, which legitimately accumulates + // past newer JDKs' tightened jdk.xml.totalEntitySizeLimit default - raise it for this + // parser instance only. + xmlReader.setProperty("http://www.oracle.com/xml/jaxp/properties/totalEntitySizeLimit", "10000000"); + // setup the content handler and give it the maps for tags and functions xmlReader.setContentHandler(new DictionaryContentHandler(syntaxelements, functions, scopeVars, scopes)); xmlReader.parse(input);