phax / ph-schematron

Java Schematron library that supports XSLT and native application
Apache License 2.0
110 stars 36 forks source link

Avoid having whole SVRL DOM in memory #125

Closed robertmarkbram closed 2 years ago

robertmarkbram commented 2 years ago

Hi Philip,

I have a follow up on https://github.com/phax/ph-schematron/issues/124 if I may.

final Document document = schematronResource.applySchematronValidation(new StreamSource(new File(xbrlPath)));

There is a chance that the XML might be thousands of lines long and after this line, the whole DOM is in memory right? Any way that avoids it all being in memory?

Rob :)

phax commented 2 years ago

Hi Rob, Thanks for asking, but I think this question doesn't hit the target ;-) Schematron is using XSLT for the main transformations and checks, and all the XSLT transformations are done in memory. So if you want to validate large XML files (> 50 MB) you already require tons of memory. The SVRL will clearly not be problem here :) hth, Philip

robertmarkbram commented 2 years ago

I see. Very good point. Thanks for pointing that out. :)