From 19de16902468e7963cc4dc6b544574bc1ea3f251 Mon Sep 17 00:00:00 2001 From: Tobias Polley Date: Tue, 26 Oct 2021 19:28:53 +0200 Subject: [PATCH] Fixes #281. --- core/src/main/groovy/com/predic8/schema/Include.groovy | 7 +++++-- .../main/groovy/com/predic8/soamodel/AbstractParser.groovy | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/src/main/groovy/com/predic8/schema/Include.groovy b/core/src/main/groovy/com/predic8/schema/Include.groovy index e42f6c27..2609306e 100755 --- a/core/src/main/groovy/com/predic8/schema/Include.groovy +++ b/core/src/main/groovy/com/predic8/schema/Include.groovy @@ -38,8 +38,11 @@ class Include extends SchemaComponent { private parseIncludedSchema(ctx){ def resource = schema.resourceResolver.resolve(this, schema.baseDir) - - def incToken = XMLInputFactory.newInstance().createXMLStreamReader(resource) + + def inputFactory = XMLInputFactory.newInstance() + inputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, false) + inputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false) + def incToken = inputFactory.createXMLStreamReader(resource) while(incToken.hasNext()) { if(incToken.startElement) { if(incToken.name.getLocalPart() =='schema'){ diff --git a/core/src/main/groovy/com/predic8/soamodel/AbstractParser.groovy b/core/src/main/groovy/com/predic8/soamodel/AbstractParser.groovy index d37cf9f9..222f4d0a 100755 --- a/core/src/main/groovy/com/predic8/soamodel/AbstractParser.groovy +++ b/core/src/main/groovy/com/predic8/soamodel/AbstractParser.groovy @@ -48,6 +48,9 @@ abstract class AbstractParser{ } private getToken(res) { - XMLInputFactory.newInstance().createXMLStreamReader(res) + def inputFactory = XMLInputFactory.newInstance() + inputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, false) + inputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false) + inputFactory.createXMLStreamReader(res) } }