Skip to content

Commit

Permalink
Fixes #281.
Browse files Browse the repository at this point in the history
  • Loading branch information
rrayst committed Oct 26, 2021
1 parent 52730dd commit 19de169
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions core/src/main/groovy/com/predic8/schema/Include.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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'){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 19de169

Please # to comment.