SAX XML Parser-error <STORE> on large xml import

%XML.Reader.OpenFile fails with SAX XML Parser-Error: <STORE> on importing large (1.5 GB) xml file. Any workaround for it?

My goal is one-time import of the file using classes generated by its XML schema.

  • 0
  • 0
  • 292
  • 7
  • 1



For large files I use %XML.TextReader.ParseFile(). It allows me to pass a "concrete" global instead of using Cache defaults. Usually CacheTemp which is more limited than a concrete global. With this I'm able to process larger files. Granted, it's a little bit of more work (code) as you have to traverse the results (element by element) but it gets the job done.

Thanks but  I must use xml-to-object classes generated by the xsd

Understand. I haven't tried this myself yet but in theory you should be able to initialize the Reader with an XML.Document object. This Document can be initialized (%OnNew) with a global of your choice in the same manner that TextReader can. 

As I see it, xml-to-objects classes need DOM while the whole purpose of TextReaded is to read the xml without DOM creation

Correct. The alternative using TextReader was to "avoid" increasing memory but if you have that option then the answers provided by Timothy are the way to go.